CVE-2026-84243

gettext: Directory traversal via the LANGUAGE environment variable

Published Oct 30, 2026 CVSS 3.1 · 7 High EPSS < 1% KEV · Not listed
Description
The gettext family of functions in the GNU C Library version 2.0 and later accept LANGUAGE environment variable entries that contain '/' or that are equal to "..", unless the program is setuid or setgid (AT_SECURE). An attacker who can set LANGUAGE in the environment of a program that uses gettext can make it load a message catalog (.mo file) from an arbitrary location in the file system. A crafted .mo file can crash the program through out-of-range offsets, or supply translations whose format directives do not match the arguments passed by the program. That causes undefined behaviour in the printf family of functions and may allow arbitrary code execution with the privileges of the program. The safety of message catalogs relies on them being installed in trusted, read-only locations, and the directory traversal bypasses this.

The fix for CVE-2014-0475 rejects ".." path components in locale names passed to setlocale or taken from the LC_ALL, LC_* and LANG environment variables. gettext reads LANGUAGE directly and appends each colon-separated entry to the message catalog directory, so that fix did not cover LANGUAGE.

LANGUAGE is only used when the LC_MESSAGES locale is not "C", "C.<encoding>" or "POSIX", so the attacker must also be able to select another installed locale, for example through LANG or LC_ALL. Exploitation also requires that the attacker can place the crafted file in a location readable by the target program, and that the environment crosses a trust boundary without the program running as AT_SECURE. An example is an SSH server that accepts LANGUAGE and LANG from clients through the AcceptEnv directive and restricts an account to a forced command; the attacker may use this to escape the restriction.

Analysis

AI-generated

Technical impact

The gettext libraries in glibc allow the LANGUAGE environment variable to include directory traversal characters such as '/' or the string '..'. When a program uses gettext, it concatenates each LANGUAGE entry to its message catalog path, potentially loading an attacker‑provided .mo file from an arbitrary location. A crafted .mo file can trigger out‑of‑range offsets or contain mismatched format directives that lead to undefined behaviour in printf‑style functions, which may be leveraged to execute arbitrary code with the program’s privileges. This flaw is a classic file‑path traversal error (CWE‑22) that compromises confidentiality, integrity, and availability of affected applications.

Affected Systems

All installations of the GNU C Library (glibc) from version 2.0 onward are affected. The vulnerability exists whenever a non‑AT_SECURE binary reads the LANGUAGE variable – for example, a setuid or setgid program that does not enforce the AT_SECURE flag. No specific product versions beyond the glibc version boundary are listed, so any active glibc installation could be vulnerable.

Risk and Exploitability

The CVSS score of 7 indicates a high severity, but the EPSS score is not available, and the vulnerability is not currently listed in the CISA KEV catalog. Exploitation requires that an attacker can influence the LANGUAGE environment of a running process, which often means compromising a trusted environment such as an SSH server that accepts LANGUAGE via AcceptEnv or an application that copies this variable from user input. The attacker must also be able to place a malicious .mo file in a location readable by the target process and ensure the process is not running with AT_SECURE. While the attack surface is somewhat limited, once achieved it allows arbitrary code execution with the privileges of the vulnerable program, making the risk significant for systems that expose such environments to untrusted input.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade glibc to a version that applies the correct check for slashes and '..' in the LANGUAGE variable
  • Configure the environment so that LANGUAGE (and LC_MESSAGES) cannot be set by untrusted users, for example by disabling AcceptEnv for services that run as setuid or by removing LANGUAGE from shell profiles
  • Enforce that sensitive binaries run with the AT_SECURE flag or otherwise prevent them from processing unauthenticated environment variables

Generated by OpenCVE AI on October 30, 2026 at 18:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-9065-1 GNU C Library vulnerabilities
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared The Gnu C Library
The Gnu C Library glibc
Vendors & Products The Gnu C Library
The Gnu C Library glibc
Type Values Removed Values Added
Description The gettext family of functions in the GNU C Library version 2.0 and later accept LANGUAGE environment variable entries that contain '/' or that are equal to "..", unless the program is setuid or setgid (AT_SECURE). An attacker who can set LANGUAGE in the environment of a program that uses gettext can make it load a message catalog (.mo file) from an arbitrary location in the file system. A crafted .mo file can crash the program through out-of-range offsets, or supply translations whose format directives do not match the arguments passed by the program. That causes undefined behaviour in the printf family of functions and may allow arbitrary code execution with the privileges of the program. The safety of message catalogs relies on them being installed in trusted, read-only locations, and the directory traversal bypasses this. The fix for CVE-2014-0475 rejects ".." path components in locale names passed to setlocale or taken from the LC_ALL, LC_* and LANG environment variables. gettext reads LANGUAGE directly and appends each colon-separated entry to the message catalog directory, so that fix did not cover LANGUAGE. LANGUAGE is only used when the LC_MESSAGES locale is not "C", "C.<encoding>" or "POSIX", so the attacker must also be able to select another installed locale, for example through LANG or LC_ALL. Exploitation also requires that the attacker can place the crafted file in a location readable by the target program, and that the environment crosses a trust boundary without the program running as AT_SECURE. An example is an SSH server that accepts LANGUAGE and LANG from clients through the AcceptEnv directive and restricts an account to a forced command; the attacker may use this to escape the restriction.
Title gettext: Directory traversal via the LANGUAGE environment variable
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
glibc
Published
Updated
Oct 31, 2026, 3:56 AM
Reserved
Sep 1, 2026, 1:12 PM
Status
Awaiting Analysis
Published
Oct 30, 2026, 6:18 PM
Modified
Oct 31, 2026, 4:18 AM
Severity
Moderate
Public date
Oct 30, 2026, 5:43 PM