Bug 644933 (CVE-2010-3999)

Summary: CVE-2010-3999 gnucash: insecure library loading vulnerability
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: info, notting, vkrizan
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-12-22 15:41:54 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: 644934    
Bug Blocks:    

Description Vincent Danen 2010-10-20 16:08:25 UTC
Ludwig Nussel discovered that gnucash contained a script that could be abused by an attacker to execute arbitrary code.

The vulnerability is due to an insecure change to LD_LIBRARY_PATH, and environment variable used by ld.so(8) to look for libraries in directories other than the standard paths.  When there is an empty item in the colon-separated list of directories in LD_LIBRARY_PATH, ld.so(8) treats it as a '.' (current working directory).  If the given script is executed from a directory where a local attacker could write files, there is a chance for exploitation.

In Fedora, /usr/bin/gnc-test-env re-sets LD_LIBRARY_PATH insecurely:

106 (display
107  (adapt-dirsep
108   (get-dir-adder "LD_LIBRARY_PATH" library-dirs "/.libs" path-sep-str))) 

which could result in something like this if called with, say, --library-dir /foo:

LD_LIBRARY_PATH="/foo/.libs:${LD_LIBRARY_PATH}"  export LD_LIBRARY_PATH;

I'm not sure what the best solution here to fix this flaw is, however it looks as though gnc-test-env is only required for building gnucash, so it should probably be removed from the RPM package (it isn't something an end-user would be running normally).

Comment 1 Vincent Danen 2010-10-20 16:09:35 UTC
Created gnucash tracking bugs for this issue

Affects: fedora-all [bug 644934]
Affects: fedora-all [bug 644934]

Comment 2 Tomas Hoger 2010-12-22 15:41:54 UTC
Fixed in Fedora 13 and 14, and EPEL 4 and 5.

Comment 3 info@kobaltwit.be 2011-11-10 17:19:35 UTC
I don't seem to remember any notice on the usual gnucash channels (bugzilla, mailing lists,...) regarding this issue.

I have just stumbled upon this one here by accident. Just for your reference, I have committed a fix to the upstream gnucash source that will skip the unsafe file from installation altogether. As you say, it's only used by developers and packagers for running tests.

Comment 5 info@kobaltwit.be 2011-11-11 11:07:05 UTC
Yes, that's the one.

Comment 6 Vincent Danen 2011-11-15 17:46:38 UTC
Perfect, thank you for the confirmation.