CVE-2006-5815: remote code execution in ProFTPD

2006-11-27 Thread John Morrissey
===
Summary
===

On 6 November 2006, Evgeny Legerov <[EMAIL PROTECTED]> posted to BUGTRAQ[1],
announcing his commercial VulnDisco Pack for Metasploit 2.7[2]. One of the
included exploits, vd_proftpd.pm, takes advantage of an off-by-one string
manipulation flaw in ProFTPD's sreplace() function to allow a remote
attacker to execute arbitrary code.

This vulnerabillity, identified as CVE-2006-5815[3], is believed to affect
all versions of ProFTPD up to and including 1.3.0, but exploitability has
only been demonstrated with version 1.3.0rc3. The demonstrated exploit
relies on write access via FTP for exploitability, but other attack vectors
may make exploitation of a read-only FTP server possible.

This vulnerability has been patched[4] in the latest release of ProFTPD,
1.3.0a, which is available from the ProFTPD web site,
http://www.proftpd.org/. Mitigation techniques have also been developed for
use until a patched version can be installed.



Timeline


10 November - [EMAIL PROTECTED] receives a message from a ProFTPD
  user inquiring about a fix for the vulnerability announced
  in GLEG's product.
10 November - ProFTPD core team attempts contact with [EMAIL PROTECTED]
15 November - Second contact attempt with [EMAIL PROTECTED]
16 November - Contact established, vulnerability details transferred.
20 November - Disclosure date coordinated.
27 November - Coordinated disclosure.

Given the Thanksgiving holiday, the ProFTPD core team chose to perform a
coordinated disclosure the following Monday, to allow affected users and
vendors ample opportunity to perform patching operations.

Unfortunately, erroneous information on the location and nature of this flaw
has disseminated from unofficial sources. Some vendors have already released
patches that attempt to address CVE-2006-5815 based on reports that a bug in
ProFTPD's CommandBufferSize processing is its cause. To the best of the core
team's knowledge, the CommandBufferSize bug in ProFTPD is not exploitable.

Vendors are welcomed and encouraged to contact [EMAIL PROTECTED] to
exchange information on announced vulnerabilities, and we endeavor to work
to the best of our abilities with those contacting the core team. Given that
we had no information about this vulnerability until several days after it
was published and a CVE issued, we attempted to address it to the best of
our abilities. Constructive criticism is welcome on how to better handle
similar situations should they arise in the future.


==
Mitigation
==

Some users may not be able to immediately patch their ProFTPD installations.
Until they are able to install a patched version, the following steps can
mitigate the impact of this flaw:

- Remove DisplayConnect, DisplayLogin, DisplayChdir, DisplayFirstChdir,
  DisplayFileTransfer, AccessDenyMsg, and WrapDenyMsg directives from your
  ProFTPD configuration.

- Avoid using variable substitutions/magic cookies/%-style escapes in
  /etc/shutmsg, when specifying a warning message with the ftpshut(8)
  command, or in RewriteRule directives.

- Add a DenyFilter directive to your configuration to limit FTP command
  arguments to only characters that you require. For example: 'DenyFilter
  [^A-Za-z0-9_.-]' limits FTP command arguments (such as filenames) to
  alphanumeric characters, the underscore, period, and dash.


[1] http://seclists.org/bugtraq/2006/Nov/0094.html
[2] http://gleg.net/vulndisco_meta.shtml
[3] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5815
[4] 
http://proftp.cvs.sourceforge.net/proftp/proftpd/src/support.c?r1=1.79&r2=1.80&sortby=date


pgp3SP4aGkwkN.pgp
Description: PGP signature


Response to ProFTPD issues

2001-02-06 Thread John Morrissey

===
Summary
===

Three issues with the ProFTPD FTP server have been reported to BUGTRAQ in
the past month. These issues have been addressed by the ProFTPD core team.

The following vulnerabilities are addressed in this advisory:

1. "SIZE memory leak"
   http://www.securityfocus.com/archive/1/151991
   Reported by Wojciech Purczynski <[EMAIL PROTECTED]>

2. "USER memory leak"
   http://www.securityfocus.com/archive/1/155349
   Reported by Wojciech Purczynski <[EMAIL PROTECTED]>

3. "Minor format string vulnerabilities"
   http://www.securityfocus.com/archive/1/155428
   Reported by Przemyslaw Frasunek <[EMAIL PROTECTED]>

All three are thought to exist in all previous 1.2.0 test releases,
(1.2.0pre[1-10], 1.2.0rc[1-2]). All three now have been fixed, and patches
have been committed to the ProFTPD CVS repository. A new release, 1.2.0rc3,
containing these fixes has been made available as of 5 February and is
available from:

http://www.proftpd.org/download.html
ftp://ftp.proftpd.org/distrib/proftpd-1.2.0rc3.tar.gz

Instructions for accessing the CVS repository via Anonymous CVS are
available at:

http://www.proftpd.org/docs/cvs.html


=
1. "SIZE memory leak"
=

ProFTPD may leak memory when commands are executed. However, this leak will
take place *only* if ProFTPD's scoreboard file is not writable. If ProFTPD
is installed properly and is allowed to write to the scoreboard file, no
leak will take place. The scoreboard file is created in
/usr/local/var/proftpd/ in a standard installation from source. If you did
not install ProFTPD from sources, please contact your vendor for the
intended location of your scoreboard file.

More information, including patches, can be found at
http://bugs.proftpd.net/show_bug.cgi?id=408

=
2. "USER memory leak"
=

A memory leak in the USER command was found. Issuing additional USER
commands causes the ProFTPD server to consume additional memory.

More information, including patches, can be found at
http://bugs.proftpd.net/show_bug.cgi?id=408


3. "Minor format string vulnerabilities"


Two minor format string vulnerabilities were found in ProFTPD. Due to the
nature of the data processed by the affected sections of code, these
vulnerabilities are very difficult, if not impossible, to exploit.

A full audit was done on the callers of any functions that accept
printf-like format arguments. One minor, unexploitable issue was found in a
third-party module (mod_ratio) and has been fixed. No other format string
vulnerabilites were found.

More information, including patches, can be found at
http://bugs.proftpd.net/show_bug.cgi?id=430

--
John Morrissey  _o/\   __o
[EMAIL PROTECTED]_-< \_  /  \     <  \,
www.horde.net/__(_)/_(_)/\___(_) /_(_)__