# CVE-2012-6711: Memory corruption in n/a

> A heap-based buffer overflow in GNU Bash allows local attackers to execute arbitrary code or crash scripts via crafted echo commands.

- **Severity:** High 7.0 (`CVSS:3.0/AC:H/AV:L/A:H/C:H/I:H/PR:L/S:U/UI:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Jun 2019
- **Updated:** 6 Aug 2024
- **Also known as:** DEBIAN-CVE-2012-6711, GHSA-rwf6-27gf-7q62, SUSE-SU-2019:2976-1

## What is CVE-2012-6711?

CVE-2012-6711 is a high-severity memory corruption vulnerability in Redhat Enterprise Linux, published on 18 Jun 2019. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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().

Weakness: CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer)

## Which versions are affected by CVE-2012-6711?

It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bash` | SUSE:Linux Enterprise Server 12 SP1-LTSS | All versions | 4.2-83.6.1 |
| `bash` | SUSE:Linux Enterprise Server for SAP Applications 12 SP1 | All versions | 4.2-83.6.1 |

Products: Gnu Bash, Redhat Enterprise Linux.

## How do I fix CVE-2012-6711?

Upgrade to a fixed version.

## Is CVE-2012-6711 being exploited?

There is no known exploitation of CVE-2012-6711 in the wild and no public exploit code.

## Other vulnerabilities in Redhat Enterprise Linux

- [CVE-2014-6278](https://insights.sbomify.com/CVE-2014-6278/): GNU Bash OS Command Injection (high 8.8, exploited in the wild)
- [CVE-2014-7186](https://insights.sbomify.com/CVE-2014-7186/): Memory corruption in n/a (critical 10.0)
- [CVE-2014-7187](https://insights.sbomify.com/CVE-2014-7187/): Memory corruption in n/a (critical 10.0)
- [CVE-2014-6277](https://insights.sbomify.com/CVE-2014-6277/): Code injection in n/a (critical 10.0)
- [CVE-2022-3715](https://insights.sbomify.com/CVE-2022-3715/): Memory corruption in bash (high 7.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2012-6711 and fix it if it is affected.

What it is: CVE-2012-6711 is a high-severity memory corruption vulnerability in Redhat Enterprise Linux, published on 18 Jun 2019. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2012-6711 in the wild and no public exploit code.

Affected product: Redhat Enterprise Linux. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2012-6711/ (Markdown: https://insights.sbomify.com/CVE-2012-6711/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2012-6711
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2012-6711
- OSV: https://osv.dev/vulnerability/CVE-2012-6711

---
From sbomify Insights: https://insights.sbomify.com/CVE-2012-6711/
Summaries are generated and may contain mistakes; the official description above is the record.
