CVE-2011-1095: Medium severity gnu c library vulnerability

Published Aug 20, 2010
·
Updated

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

Other sources

locale/programs/locale.c in locale in the GNU C Library (aka glibc or libc6) before 2.13 does not quote its output, which might allow local users to gain privileges via a crafted localization environment variable, in conjunction with a program that executes a script that uses the eval function.

MITRE

Affected Software

57 affected components
GNU glibc=2.2.2
GNU glibc=2.9
GNU glibc=2.7
GNU glibc=2.1.2
GNU glibc=2.11
GNU glibc=2.0.5
GNU glibc=2.2.5
GNU glibc=2.0.6
GNU glibc=2.10.1
GNU glibc=1.00
GNU glibc=1.06
GNU glibc=2.1.1
GNU glibc=1.02
GNU glibc=2.0.3
GNU glibc=1.07
GNU glibc=2.3.1
GNU glibc=2.3
GNU glibc=2.12.0
GNU glibc=2.0
GNU glibc=2.1.1.6
GNU glibc=1.04
GNU glibc=1.01
GNU glibc=2.3.10
GNU glibc=2.4
GNU glibc=2.1
GNU glibc=2.3.4
GNU glibc=1.09.1
GNU glibc=2.1.9
GNU glibc=2.3.3
GNU glibc=2.12.1
GNU glibc=2.6.1
GNU glibc=2.0.1
GNU glibc=1.09
GNU glibc=2.10
GNU glibc=2.11.2
GNU glibc=2.5.1
GNU glibc=2.6
GNU glibc=2.0.4
GNU glibc=2.0.2
GNU glibc=2.2.1
GNU glibc=2.3.2
GNU glibc=1.03
GNU glibc=2.1.3.10
GNU glibc=2.3.6
GNU glibc<=2.12.2
GNU glibc=2.2.3
GNU glibc=2.5
GNU glibc=2.11.3
GNU glibc=1.08
GNU glibc=2.3.5
GNU glibc=2.8
GNU glibc=2.11.1
GNU glibc=2.2.4
GNU glibc=2.1.3
GNU glibc=1.05
GNU glibc=2.2
GNU glibc=2.10.2

Event History

Aug 20, 2010
Data Sourced
via Red Hat·06:00 PM
DescriptionSeverityAffected Software
Apr 10, 2011
CVE Published
via MITRE·01:29 AM
Data Sourced
via MITRE·01:29 AM
Description

Frequently Asked Questions

1

What is the severity of CVE-2011-1095?

CVE-2011-1095 is classified as a high severity vulnerability due to its potential for exploitation via arbitrary command execution.

2

How do I fix CVE-2011-1095?

To mitigate CVE-2011-1095, update the GNU C Library (glibc) to the latest version that addresses this vulnerability.

3

Which versions of glibc are affected by CVE-2011-1095?

CVE-2011-1095 affects various versions of glibc, including but not limited to 2.0 through 2.12.2.

4

What are the potential impacts of CVE-2011-1095?

Exploiting CVE-2011-1095 may allow an attacker to execute arbitrary commands, which could lead to system compromise.

5

Is there a workaround for CVE-2011-1095 if I cannot immediately update?

As a temporary workaround for CVE-2011-1095, consider restricting user permissions or disabling the locale command in untrusted environments.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203