Bug #323


Need fix for glob() resource exhaustion

Added by Jason King almost 13 years ago. Updated over 12 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:

Description describes the bug. In short, carefully crafted values passed to glob(3c) can cause excessive resource consumption. This means any external facing apps using glob(3c) such as in.ftpd or sftp are vulnerable to a denial of service attack.

Actions #1

Updated by sham pavman over 12 years ago

  • Assignee set to sham pavman
Actions #2

Updated by sham pavman over 12 years ago

After spending some time on this issue I can see that the issue of resource exhaustion using ftp did not occur.

I ftp'd into a ncp machine from illumos and here are the results

1.)#ftp> ls /..//../*/../*/../*/../*/../*
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
226 Transfer complete.
remote: /..//../*/../*/../*/../*/../*
83 bytes received in 0.00079 seconds (103.25 Kbytes/s)
(As you see there are no duplicate entries either.)

However when I try the regex as given in the CVE this is what happens..
ftp> ls /{..,..}//{..,..}/*/{..,..}/*/{..,..}/*
200 PORT command successful.
550 Arguments too long
(From the discussions that Ive gone through it clearly states that this regex is sufficient to bring down a machine but here we can see that this is not allowed at all.)

Apart from this Ive also read the ftpd.c file and found out that there is a fix for a possible DOS already.
(under the fixpath() )

Apart from this the bug reports that 'sftp' is also vulnerable.
Initial tests i did suggests that this problem exists in sftp, however ftp looks clean.


Actions #3

Updated by Garrett D'Amore over 12 years ago

We need to make sure that we are testing an illumos machine, not NCP (unless testing NCP4 prealpha).

Specifically, NCP 3.x probably has a different ftp daemon.

While Nexenta needs to know that NCP3 is free from the problem (or a patch will need to be created), illumos is a separate matter. The interesting change to ftpd was integrated in 140, after the NCP3 was forked from OpenSolaris (which was in build 134.)

Actions #4

Updated by Dan McDonald over 12 years ago

  • Difficulty set to Medium
  • Tags set to needs-triage

Sorry this took so long.

in.ftpd (which is a version of WUftpd) has its own globbing here:


sftp also has its own globbing here:


the latter is a port of NetBSD/OpenBSD, and it's likely a direct drop from NetBSD will work here.

Actions #5

Updated by Gary Mills over 12 years ago

The FTP server in oi_148b is version wu-2.6.2+Sun.
It uses a private globbing function called `ftpglob'.
I've built a test program that calls this function in a
similar way to the FTP server. With this, I've verified
that the resource exhaustion bug exists when it's given
a carefully-crafted path.

Oracle has fixed this bug in their copy of the source and
issued patches for it. The original wu-2.6.2 FTP server
has not been maintained for many years. An updated
version is available at but
even this one has not been maintained since 2009. The
BSD FTP servers appear to be completely different from
the WU version. I'd recommend that the BSD version be
ported to Illumos, replacing the wu-2.6.2+Sun version.

In the interim, I should be able to develop a patch for the
glob.c file that will eliminate the resource exhaustion
vulnerability described in CVE-2010-2632.

Actions #6

Updated by Gordon Ross over 12 years ago

  • Status changed from New to Resolved
  • Assignee changed from sham pavman to Gary Mills

changeset: 13385:3d898cde151e
tag: tip
user: Gary Mills <>
date: Tue Jun 07 21:38:05 2011 -0500
323 Need fix for glob() resource exhaustion
Reviewed by: Garrett D'Amore <>
Reviewed by: Dan McDonald <>
Approved by: Gordon Ross <>


Also available in: Atom PDF