I. Description
Filename "globbing" is the process of expanding short-hand notation
into complete file names. For example, the expression "*.c" (without
the quotes) is short-hand notation for "all files ending in ".c"
(again, without the quotes). This is commonly used in UNIX shells, in
commands such as ls *.c. Globbing also often includes the expansion of
certain characters into system-specific paths, such as the expansion
of tilde character (~) into the path of the home directory of the user
specified to the right of the tilde character. For example, "~foo"
expands to the home directory for the user "foo" on the current
system. The expressions used in filename globbing are not strictly
regular expressions, but they are syntactically similar in many
ways.
Many FTP servers also implement globbing, so that the command
mget *.c means retrieve all the files ending in ".c," and get
~foo/file.name means get the file named "file.name" in the home
directory of foo.
The COVERT Labs at PGP Security have discovered a means to use the
expansion done by the glob function to overflow various buffers in FTP
servers, allowing an intruder to execute arbitrary code. For more
details about their discovery, see
-
http://www.pgp.com/research/covert/advisories/048.asp
Quoting from that document:
-
[...] when an FTP daemon receives a request involving a file that has
a tilde as its first character, it typically runs the entire filename
string through globbing code in order to resolve the specified home
directory into a full path. This has the side effect of expanding
other metacharacters in the pathname string, which can lead to very
large input strings being passed into the main command processing
routines. This can lead to exploitable buffer overflow conditions,
depending upon how these routines manipulate their input.
-
For the latest information regarding this vulnerability, including
information related to vendors' exposure to this problem, consult the
vulnerability note describing this problem, available at
-
http://www.kb.cert.org/vuls/id/808552