CVE-2012-6711
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Jun 18, 2019
CISA due date
—
Cloudanix analysis
A flaw in a widely used command interpreter can let someone already logged into the computer run harmful commands or crash programs by feeding it certain special characters.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in ansicstr() within lib/sh/strtrans.c when echo -e processes wide characters unsupported by the current LC_CTYPE locale, allowing memory corruption and potential code execution under the bash process privileges.
Why it matters to the business
Local attackers can crash scripts or gain elevated code execution on systems running vulnerable Bash, risking unauthorized access, data tampering, or service disruption especially in environments with many legacy or unpatched shells.
How an attack unfolds
An attacker with local access sets LC_CTYPE to a locale lacking wide-character support, then supplies crafted wide-character data to a script invoking the echo -e built-in, triggering the mishandled u32cconv() conversion to overflow the heap and execute arbitrary code.
How to fix it
Upgrade GNU Bash to version 4.3 or newer on all affected systems including Red Hat Enterprise Linux deployments; where immediate upgrade is impossible, restrict untrusted local accounts and audit scripts that rely on echo -e.
How to confirm the fix worked
Verify Bash version is 4.3 or later; test exposure by running echo -e with wide characters under a mismatched LC_CTYPE locale and confirming no crash or overflow occurs.
Typical attack path
- Obtain local shell access on the target system
- Configure LC_CTYPE environment variable to an incompatible locale
- Invoke or supply input to a Bash script that uses echo -e with wide characters
- Trigger the buffer overflow to corrupt memory and run attacker-controlled code
How to detect it
Review process environment variables for unusual LC_CTYPE settings combined with Bash crashes or segfaults; examine shell history and script logs for invocations of echo -e containing non-ASCII or wide characters.
- LC_CTYPE set to locale without wide character support
- bash segfault or heap corruption logs near echo invocations
- echo -e commands containing \u or wide-character sequences in scripts
What your security team should do
- Prioritize patching Bash to 4.3+ across all hosts given its universal presence in Linux environments
- Scan for and replace any scripts using echo -e with wide-character sequences
- Enforce least-privilege local accounts to limit exploitation surface
- Monitor for new EPSS increases or exploit code releases despite current low scores
The record
A heap-based buffer overflow exists in GNU Bash before 4.3 when wide characters, not supported by the current locale set in the LC_CTYPE environment variable, are printed through the echo built-in function. A local attacker, who can provide data to print through the "echo -e" built-in function, may use this flaw to crash a script or execute code with the privileges of the bash process. This occurs because ansicstr() in lib/sh/strtrans.c mishandles u32cconv().
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | bash | 0 | 4.3-1 |
| Debian:12 | bash | 0 | 4.3-1 |
| Debian:13 | bash | 0 | 4.3-1 |
| SUSE:Linux Enterprise Server 12 SP1-LTSS | bash | 0 | 4.2-83.6.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | bash | 0 | 4.2-83.6.1 |
| Ubuntu:16.04:LTS | bash | 0 | 4.3-14ubuntu1.3 |
| Ubuntu:18.04:LTS | bash | 0 | 4.4.18-2ubuntu1.1 |
Related vulnerabilities
- CVE-2022-3715 A flaw was found in the bash package, where a heap-buffer overflow can occur in valid… Also affects bash
- CVE-2016-0634 The expansion of '\h' in the prompt string in bash 4.3 allows remote authenticated users… Also affects bash
- CVE-2016-9401 popd in bash might allow local users to bypass the restricted shell and cause a… Also affects bash
- CVE-2016-7543 Bash before 4.4 allows local users to execute arbitrary commands with root privileges via… Also affects bash
- CVE-2014-6278 GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the… Also affects bash
- CVE-2014-7187 Off-by-one error in the read_token_word function in parse.y in GNU Bash through 4.3… Also affects bash
- CVE-2014-7186 The redirection implementation in parse.y in GNU Bash through 4.3 bash43-026 allows… Also affects bash
- CVE-2014-6277 GNU Bash through 4.3 bash43-026 does not properly parse function definitions in the… Also affects bash