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
Summary: CVE-2007-6514 When document is on smbfs, a trailing backslash at the end of f...
Keywords:
Status: CLOSED NOTABUG
Alias: CVE-2007-6514
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL: http://nvd.nist.gov/nvd.cfm?cvename=C...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-12-21 22:21 UTC by Lubomir Kundrak
Modified: 2021-11-12 19:47 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-01-09 18:16:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Lubomir Kundrak 2007-12-21 22:21:42 UTC
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
directive.

References:

http://www.securityfocus.com/archive/1/archive/1/485316/100/0/threaded
http://www.securityfocus.com/bid/26939
http://xforce.iss.net/xforce/xfdb/39158

Comment 7 Mark J. Cox 2008-01-09 16:52:22 UTC
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 127.0.0.1] (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 17:25:54 UTC
Testing on RHEL2.1:

# uname -r
2.4.9-e.72

# 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
argument)
...

...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 17:41:14 UTC
Ah, it works differently for me on my older kernel rhel-2.1

# uname -r
2.4.9-e.49

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

# cat /mnt/rachel/test.php\\\\\\\\\
<?php....


Comment 10 Mark J. Cox 2008-01-09 18:10:57 UTC
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 18:15:52 UTC
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.