Bug 481548 (CVE-2008-5985)

Summary: CVE-2008-5985 epiphany: untrusted python modules search path
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: ddumas, gecko-bugs-nobody
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504363
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-22 14:58:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 665467    
Bug Blocks:    

Description Jan Lieskovsky 2009-01-26 09:23:13 UTC
Untrusted search path vulnerability in Epiphany's Python interface allows local users to execute arbitrary code via a Trojan horse Python file in the current working directory, related to an erroneous setting of sys.path by the PySys_SetArgv function.

References:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504363

Test case available in:
http://www.nabble.com/Bug-484305%3A-bicyclerepair%3A-bike.vim-imports-untrusted-python-files-from-cwd-td18848099.html

Proposed patch:
http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=sanitize_sys.path.diff;att=1;bug=504363

Patch notes:
The path for affected file in Fedora is BUILD/epiphany-N.V.R/src/ephy-python.c,
the proposed patch won't apply cleanly, but the change of:

++	/* Sanitize sys.path to prevent relative imports loading modules in
++	 * the current working directory
++	 */
++	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)")

in ephy-python.c should be enough to fix this issue.

Comment 1 Jan Lieskovsky 2009-01-26 09:24:50 UTC
This issue affects all versions of the epiphany browser packages, as shipped
with Fedora releases of 9, 10 and devel.

Please fix.

Comment 2 Jan Lieskovsky 2009-01-28 11:13:33 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2008-5985 to
this vulnerability:

Untrusted search path vulnerability in the Python interface in
Epiphany 2.22.3, and possibly other versions, allows local users to
execute arbitrary code via a Trojan horse Python file in the current
working directory, related to a vulnerability in the PySys_SetArgv
function (CVE-2008-5983).

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5985
http://www.openwall.com/lists/oss-security/2009/01/26/2
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=504363

Comment 3 Jan Lieskovsky 2009-01-29 11:27:41 UTC
More explanation why this issue wasn't fixed in Python yet, can be
found here:

https://bugzilla.redhat.com/show_bug.cgi?id=482814#c1

here:

https://bugzilla.redhat.com/show_bug.cgi?id=482814#c4

and here:

https://bugzilla.redhat.com/show_bug.cgi?id=482814#c5

Looks like the Python fix won't come anytime soon, so please
fix the issue in the package, till we find the proper Python solution.

Ray Strode's test case to check the work of the fix can be found here:

https://bugzilla.redhat.com/show_bug.cgi?id=481556#c8

Comment 4 Vincent Danen 2010-12-23 23:02:07 UTC
Created epiphany tracking bugs for this issue

Affects: fedora-all [bug 665467]