Bug 214205 (CVE-2006-7234) - CVE-2006-7234 lynx: .mailcap and .mime.types files read from CWD
Summary: CVE-2006-7234 lynx: .mailcap and .mime.types files read from CWD
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2006-7234
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact: Brian Brock
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Depends On: 468541 468542 468543 468544 468545 468546 833938
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-06 15:44 UTC by Red Hat Product Security
Modified: 2019-09-29 12:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-10-28 08:18:50 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2008:0965 0 normal SHIPPED_LIVE Important: lynx security update 2008-10-27 17:09:50 UTC

Description Lubomir Kundrak 2006-11-06 15:44:00 UTC
Description of problem:

Lynx reads .mailcap and .mime.types from its CWD, making it
possible for a malicious person to make it execute arbitrairy
code when user launches lynx while its working directory
contains attacker-provided contents.

Steps to Reproduce:

$ cat .mime.types
application/x-bug       bug
$ cat .mailcap
application/x-bug; xmessage 'Hello, World!'
$ cat poc.bug
$ lynx poc.bug

( xmessage 'Hello, World!' ) < /home/lkundrak/L28618-1037TMP.bin

...

Fix:

Make lynx read files from ~ instead of CWD.
Debian patch is unusable here, they completly remove code
for reading the files in question.

Comment 1 Thomas E. Dickey 2006-11-07 00:02:14 UTC
This is more accurate than the Debian report, which does not
distinguish between the starting directory and directories
which lynx may visit.

I prefer (unless someone can point out a flaw) to use IsOurFile()
to verify that the file is safe to read.

Comment 2 Thomas E. Dickey 2006-11-15 11:11:00 UTC
Depending on the use, the Debian patch has some limited value.
As I noted, I added logic to use IsOurFile() to reduce the
scope (and that patch is easily resync'd to 2.8.5).  Properly
handling the user's mailcap/mime file settings is harder.
The effect of the Debian patch is to always append that setting
to the user's home-path.  It doesn't check if the global setting
is not a relative path.  I added a check for the latter, and chose
to address the user's settings by making tilde-expansion in those
work - and then enforcing absolute pathnames for the user's settings.
That's in lynx 2.8.7dev.4 (resyncing the tilde expansion stuff is
more work).  I'd suggest adding the 2.8.6rel.3 patch (for IsOurFile),
and combining that with the Debian patch for fixes to older releases.

Comment 3 Thomas E. Dickey 2006-11-15 12:55:49 UTC
I'll work on this, this evening to put together a possible
patch to combine the different aspects.

Comment 7 Tomas Hoger 2008-10-25 18:10:56 UTC
For the sake of completeness...  This issue was fixed upstream in 2.8.6rel.4.  As of this version, lynx will not search current working directory for PERSONAL_MAILCAP (.mailcap by default) and PERSONAL_EXTENSION_MAP (.mime.types by default) files, but will only try to find those files in the user's home directory.

Patches for older versions:
ftp://lynx.isc.org/lynx2.8.5/patches/2.8.5rel.6.patch.gz
ftp://lynx.isc.org/lynx2.8.4/patches/lynx2.8.4rel.1e.patch

Comment 11 Tomas Hoger 2008-10-27 16:38:45 UTC
CVE id CVE-2006-7234 was assigned to this issue:

Untrusted search path vulnerability in Lynx before 2.8.6rel.4 allows
local users to execute arbitrary code via malicious (1) .mailcap and
(2) mime.types files in the current working directory.

Comment 12 Red Hat Product Security 2008-10-28 08:18:50 UTC
This issue was addressed in:

Red Hat Enterprise Linux:
  http://rhn.redhat.com/errata/RHSA-2008-0965.html

Comment 13 Red Hat Bugzilla 2009-10-23 19:05:32 UTC
Reporter changed to security-response-team by request of Jay Turner.


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