Bug 426548 - (CVE-2007-6514) CVE-2007-6514 When document is on smbfs, a trailing backslash at the end of file name bypasses content type match
CVE-2007-6514 When document is on smbfs, a trailing backslash at the end of f...
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On:
  Show dependency treegraph
Reported: 2007-12-21 17:21 EST by Lubomir Kundrak
Modified: 2017-03-19 12:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-01-09 13:16:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Lubomir Kundrak 2007-12-21 17:21:42 EST
Common Vulnerabilities and Exposures assigned an identifier CVE-2007-6514 to the following vulnerability:

Apache HTTP Server, when running on Linux with a document root on a
Windows share mounted using smbfs, allows remote attackers to obtain
unprocessed content such as source files for .php programs via a
trailing "" (backslash), which is not handled by the intended AddType


Comment 7 Mark J. Cox 2008-01-09 11:52:22 EST
So it seems there is code in smbfs/dir.c to make sure that a EINTR is returned
if an attempt is made to open a file containing a backslash.  Where the EINTR is
returned, Apache reports a permission denied error:

[Wed Jan 09 16:39:06 2008] [error] [client] (22)Invalid argument:
access to /rachel/test.php\\ failed

This code exists in RHEL3,4,5 and therefore this is not an issue for RHEL3,4,5.

But the check is not there in the RHEL2.1 kernel, so we'd need to check what
happens there.
Comment 8 Jeff Layton 2008-01-09 12:25:54 EST
Testing on RHEL2.1:

# uname -r

# grep scratch /proc/mounts
//salusa/scratch /mnt/scratch smbfs rw 0 0

# strace -f cat  '/mnt/scratch/hosts.php\'
open("/mnt/scratch/hosts.php\\", O_RDONLY|O_LARGEFILE) = -1 EINVAL (Invalid

...unless apache is doing something different at the syscall level, I'd say that
RHEL2.1 doesn't seem to be susceptible to this either.

It might be good to run apache with '-X' so that it's single threaded and then
strace it and see if you can determine what it's doing when it tries to open the
file. There's a chance that it uses some oddball set of flags or something that
could be affecting the outcome here.
Comment 9 Mark J. Cox 2008-01-09 12:41:14 EST
Ah, it works differently for me on my older kernel rhel-2.1

# uname -r

# mount -t smbfs //rachel/delme1 /mnt/rachel

# cat /mnt/rachel/test.php\\\\\\\\\
Comment 10 Mark J. Cox 2008-01-09 13:10:57 EST
Okay, so the backtick patch is backported in linux-2.4.9-updates.patch therefore
an up to date RHEL2.1 kernel is also not affected by this issue.
Comment 11 Mark J. Cox 2008-01-09 13:15:52 EST
Fixed in rhel2.1 kernel by RHSA-2007:0672

Note You need to log in before you can comment on or make changes to this bug.