Bug 644933 - (CVE-2010-3999) CVE-2010-3999 gnucash: insecure library loading vulnerability
CVE-2010-3999 gnucash: insecure library loading vulnerability
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
public=20100929,reported=20100929,sou...
: Security
Depends On: 644934
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-20 12:08 EDT by Vincent Danen
Modified: 2015-08-19 04:58 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-22 10:41:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vincent Danen 2010-10-20 12:08:25 EDT
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 12:09:35 EDT
Created gnucash tracking bugs for this issue

Affects: fedora-all [bug 644934]
Affects: fedora-all [bug 644934]
Comment 2 Tomas Hoger 2010-12-22 10:41:54 EST
Fixed in Fedora 13 and 14, and EPEL 4 and 5.
Comment 3 info@kobaltwit.be 2011-11-10 12:19:35 EST
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 06:07:05 EST
Yes, that's the one.
Comment 6 Vincent Danen 2011-11-15 12:46:38 EST
Perfect, thank you for the confirmation.

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