Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517934 (CVE-2014-2972) - <mail-mta/exim-4.84: local code execution via string expansion (CVE-2014-2972)
Summary: <mail-mta/exim-4.84: local code execution via string expansion (CVE-2014-2972)
Status: RESOLVED FIXED
Alias: CVE-2014-2972
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Gentoo Security
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard: B1 [glsa]
Keywords:
Depends on: 489676 524154
Blocks:
  Show dependency tree
 
Reported: 2014-07-24 07:52 UTC by Agostino Sarubbo
Modified: 2016-07-20 11:20 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2014-07-24 07:52:24 UTC
From ${URL} :

As reported to the exim user's mailing list [1], Exim suffers from a local vulnerability where a string expansion is evaluated twice.  If a local attacker were able to provide unsanitized data to a data source used by Exim for looking up a value, in certain 
situations, the data would be eval()'d twice.  This is not remotely exploitable and requires a user account on the Exim server, and an Exim configuration that does lookups against files to which the user has edit access.  The end result is that, if the conditions 
are true, arbitrary code could be executed as the exim user.  As described in the posting:

"""
The root cause of this issue is the arguments to mathematical comparison 
operations are expanded twice (<, <=, >, >=, =). The intent of the 
original code was the first expansion could (for example) lookup an item 
from a file. The assumption was that entry would be some form of valid 
integer so that value was then passed to the expand function again to do 
a numeric conversion of values such as 19k or 45M to integers. However, 
if the content of the lookup is under direct user control, they could 
insert something with an expansion, such as: 

${run {/bin/touch /tmp/OUCH}} 

Since the data is not sanitized when the second expansion occurs 
(intended to process numerical conversion), that command would get 
executed as the exim user. 
"""

This is corrected in the Exim 4.83 release [2],[3],[4].  From the description, it looks as though every version of Exim released since 2004 is affected.

[1] https://lists.exim.org/lurker/message/20140722.152452.d6c019e8.en.html
[2] http://git.exim.org/exim.git/blob/exim-4_83:/doc/doc-txt/ChangeLog
[3] http://git.exim.org/exim.git/commitdiff/7685ce68148a083d7759e78d01aa5198fc099c44
[4] http://git.exim.org/exim.git/commitdiff/0de7239e563eff6e83c3e72d7deb9fd26a54a3a7


@maintainer(s): since the fixed package is already in the tree, please let us know if it is ready for the stabilization or not.
Comment 1 Fabian Groffen gentoo-dev 2014-07-24 08:54:56 UTC
I added the update yesterday.  Been running the RCs for as long as they are out (months) on my own servers, so I see no immediate problems going forward with stabilisation.  There is just a bug for a new dependency that needs fast forwarding too in that case.  Bug #489676
Comment 2 Yury German Gentoo Infrastructure gentoo-dev 2014-07-26 01:52:28 UTC
Since all versions from 2004 are vulnerable do we have to keyword for?
alpha, amd64, arm, hppa, ia64, ppc, ppc64, sparc, x86

Since the only version with all of them keyworded is: 4.80.1-r2
Comment 3 GLSAMaker/CVETool Bot gentoo-dev 2014-10-14 21:31:49 UTC
CVE-2014-2972 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-2972):
  expand.c in Exim before 4.83 expands mathematical comparisons twice, which
  allows local users to gain privileges and execute arbitrary commands via a
  crafted lookup value.
Comment 4 Yury German Gentoo Infrastructure gentoo-dev 2014-10-15 04:49:35 UTC
 =mail-mta/exim-4.84 =dev-libs/hiredis-0.11.0-r1 =mail-filter/opendmarc-1.1.3
is being stabilized in bug #524154 (Dependency already set).
Comment 5 Tobias Heinlein (RETIRED) gentoo-dev 2015-03-28 20:48:14 UTC
GLSA request filed.
Comment 6 GLSAMaker/CVETool Bot gentoo-dev 2016-07-20 11:20:05 UTC
This issue was resolved and addressed in
 GLSA 201607-12 at https://security.gentoo.org/glsa/201607-12
by GLSA coordinator Aaron Bauman (b-man).