REDHAT-BUG-625893: Low severity GNU glibc vulnerability
Harald van Dijk discovered [1],[2] that glibc's locale command does not sufficiently sanitize the user environment. According to POSIX specifications [3], the output of the 'locale' command must be appropriately quoted and safe to execute, in order to restore the locale after temporarily forcing a change (such as LCALL=C). However, this is not the case with glibc versions up to and including 2.12.1:
LANG=' rm -rf /' locale locale: Cannot set LCCTYPE to default locale: No such file or directory locale: Cannot set LCMESSAGES to default locale: No such file or directory locale: Cannot set LCALL to default locale: No such file or directory LANG= rm -rf / LCCTYPE=" rm -rf /" LCNUMERIC=" rm -rf /" LCTIME=" rm -rf /" LCCOLLATE=" rm -rf /" LCMONETARY=" rm -rf /" LCMESSAGES=" rm -rf /" LCPAPER=" rm -rf /" LCNAME=" rm -rf /" LCADDRESS=" rm -rf /" LCTELEPHONE=" rm -rf /" LCMEASUREMENT=" rm -rf /" LCIDENTIFICATION=" rm -rf /" LCALL=
Any script that does "eval $(locale)" or something similar will execute the unquoted commands.
The POSIX specification states:
"The <value> and <implied value> shown above shall be properly quoted for possible later reentry to the shell. The <value> shall not be quoted using double-quotes (so that it can be distinguished by the user from the <implied value> case, which always requires double-quotes)."
This has been corrected upstream [4].
[1] http://bugs.gentoo.org/showbug.cgi?id=330923 [2] http://sources.redhat.com/bugzilla/showbug.cgi?id=11904 [3] http://www.opengroup.org/onlinepubs/000095399/utilities/locale.html [4] http://sourceware.org/git/?p=glibc.git;a=patch;h=026373745eab50a683536d950cb7e17dc98c4259
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
glibcto a version that resolves this vulnerability.Patch 026373745eab50a683536d950cb7e17dc98c4259
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-625893?
The severity of REDHAT-BUG-625893 is considered high due to the insufficient sanitization of the user environment.
How do I fix REDHAT-BUG-625893?
To fix REDHAT-BUG-625893, upgrade to a version of glibc later than 2.12.1 that addresses this vulnerability.
What systems are affected by REDHAT-BUG-625893?
Systems using GNU glibc version 2.12.1 or earlier are affected by REDHAT-BUG-625893.
What is the impact of exploiting REDHAT-BUG-625893?
Exploiting REDHAT-BUG-625893 can lead to the execution of unsafe commands and environment variables, compromising system security.
Who discovered the vulnerability REDHAT-BUG-625893?
The vulnerability REDHAT-BUG-625893 was discovered by Harald van Dijk.