Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 529982 (CVE-2014-7817)

Summary: <sys-libs/glibc-2.20-r2: command execution in wordexp() with WRDE_NOCMD specified (CVE-2014-7817)
Product: Gentoo Security Reporter: Agostino Sarubbo <ago>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: major CC: gentoo.org, gentoo, toolchain
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a39208bd7fb76c1b01c127b4c61f9bfd915bfe7c
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=1157689
Whiteboard: A2 [glsa]
Package list:
Runtime testing required: ---
Bug Depends on: 516884    
Bug Blocks:    

Description Agostino Sarubbo gentoo-dev 2014-11-20 18:49:25 UTC
From ${URL} :

Tim Waugh from Red Hat has reported the below issue:

The wordexp() function will perform command substitution even when explicitly told not to, when expanding "$((`...`))".
...
#include <wordexp.h>
int main (void)
{
  wordexp_t we;
  return wordexp ("$((1`touch /tmp/x`))", &we, WRDE_NOCMD);
}

This can allow a local authenticated attacker to execute arbitrary commands with the credentials of a process calling wordexp() on an 
attacker-supplied data.


@maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
Comment 1 Christian Schmidt 2014-12-25 11:32:38 UTC
CVE-2014-7817 and thus common knowledge, please add the patch shown in https://sourceware.org/ml/libc-alpha/2014-11/msg00519.html until a new upstream release is around.
Comment 2 GLSAMaker/CVETool Bot gentoo-dev 2015-01-11 20:51:37 UTC
CVE-2014-7817 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-7817):
  The wordexp function in GNU C Library (aka glibc) 2.21 does not enforce the
  WRDE_NOCMD flag, which allows context-dependent attackers to execute
  arbitrary commands, as demonstrated by input containing "$((`...`))".
Comment 3 SpanKY gentoo-dev 2015-02-17 08:09:07 UTC
fix is also in glibc-2.20-r2 now
Comment 4 GLSAMaker/CVETool Bot gentoo-dev 2016-02-17 15:38:05 UTC
This issue was resolved and addressed in
 GLSA 201602-02 at https://security.gentoo.org/glsa/201602-02
by GLSA coordinator Tobias Heinlein (keytoaster).