Bug 638427 - (CVE-2010-3394) CVE-2010-3394 TeXmacs: insecure library loading vulnerability
CVE-2010-3394 TeXmacs: insecure library loading vulnerability
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
impact=low,public=20100928,reported=2...
: Security
Depends On: 638428 1058553
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-28 20:19 EDT by Vincent Danen
Modified: 2015-08-19 04:56 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
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-09-28 20:19:10 EDT
Raphael Geissert conducted a review of various packages in Debian and found that TeXmacs contained two scripts that could be abused by an attacker to execute arbitrary code [1].

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/TeXmacs re-sets LD_LIBRARY_PATH insecurely:

LD_LIBRARY_PATH="$TEXMACS_BIN_PATH/lib${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}"
export LD_LIBRARY_PATH

and so does /usr/libexec/TeXmacs/bin/tm_mupad_help:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${MuPAD_ROOT_PATH}/${SYSINFO}/lib:/usr/local/X11R6/motif-2.0/lib:/usr/local/X11R6/lib:$MuPAD_ROOT_PATH/$SYSINFO/bin
export LD_LIBRARY_PATH

A solution is to patch the scripts to test if $LD_LIBRARY_PATH is set first before attempting to modify it:

if [ -z ${LD_LIBRARY_PATH} ]; then
    export LD_LIBRARY_PATH=/usr/lib/foo
else
    export LD_LIBRARY_PATH=/usr/lib/foo:${LD_LIBRARY_PATH}
fi

This issue has been assigned the name CVE-2010-3394.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598424
Comment 1 Vincent Danen 2010-09-28 20:22:31 EDT
Created TeXmacs tracking bugs for this issue

Affects: fedora-all [bug 638428]
Comment 2 Tomas Hoger 2010-09-29 03:44:32 EDT
This one-liner should work as an alternative to if-else-fi fix:
export LD_LIBRARY_PATH=/usr/lib/foo${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
Comment 3 Murray McAllister 2014-01-27 22:08:18 EST
From manual inspection it looks like TeXmacs in EPEL is affected by this issue. I will file tracking bugs shortly.
Comment 4 Murray McAllister 2014-01-27 22:11:30 EST
Created TeXmacs tracking bugs for this issue:

Affects: epel-all [bug 1058553]
Comment 5 Fedora Update System 2014-10-17 13:36:30 EDT
TeXmacs-1.0.7.2-3.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2014-10-17 13:39:14 EDT
TeXmacs-1.0.7.2-3.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.

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