# CVE-2021-20294: Memory corruption in binutils

> An attacker can trigger a stack buffer overflow in binutils readelf by convincing a victim to process a crafted file, potentially leading to arbitrary code execution.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 29 Apr 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-20294, GHSA-rrj7-qm3x-w26v, SUSE-SU-2021:3637-1, SUSE-SU-2021:3643-1, openSUSE-SU-2021:3643-1, openSUSE-SU-2024:11634-1

## What is CVE-2021-20294?

CVE-2021-20294 is a high-severity memory corruption vulnerability in Gnu Binutils, published on 29 Apr 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

A flaw was found in binutils readelf 2.35 program. An attacker who is able to convince a victim using readelf to read a crafted file could trigger a stack buffer overflow, out-of-bounds write of arbitrary data supplied by the attacker. The highest impact of this flaw is to confidentiality, integrity, and availability.

Weakness: CWE-787 (Out-of-bounds Write)

## Which versions are affected by CVE-2021-20294?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `binutils` | SUSE:Enterprise Storage 6 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:HPE Helion OpenStack 8 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Development Tools 15 SP2 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Development Tools 15 SP3 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Package Hub 15 SP2 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 2.37-7.26.1 |
| `binutils` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 2.37-9.44.1 |
| `cross-ppc-binutils` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 2.37-9.44.1 |
| `cross-spu-binutils` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:OpenStack Cloud 8 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:OpenStack Cloud 9 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:OpenStack Cloud Crowbar 8 | All versions | 2.37-9.44.1 |
| `binutils` | SUSE:OpenStack Cloud Crowbar 9 | All versions | 2.37-9.44.1 |
| `binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-aarch64-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-arm-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-avr-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-epiphany-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-hppa-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-hppa64-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-i386-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-ia64-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-m68k-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-mips-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |
| `cross-ppc-binutils` | openSUSE:Leap 15.3 | All versions | 2.37-7.26.1 |

Products: Gnu Binutils.

## How do I fix CVE-2021-20294?

Apply the vendor's patch.

## Is CVE-2021-20294 being exploited?

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

Public exploit code:

- Simple CVE-2021-20294 poc (github_poc): https://github.com/tin-z/CVE-2021-20294-POC

## Other vulnerabilities in Gnu Binutils

- [CVE-2017-7614](https://insights.sbomify.com/CVE-2017-7614/): Null dereference in n/a (critical 9.8)
- [CVE-2014-9939](https://insights.sbomify.com/CVE-2014-9939/): Memory corruption in n/a (critical 9.8)
- [CVE-2017-7226](https://insights.sbomify.com/CVE-2017-7226/): Information disclosure in n/a (critical 9.1)
- [CVE-2017-6969](https://insights.sbomify.com/CVE-2017-6969/): Information disclosure in n/a (critical 9.1)
- [CVE-2020-19726](https://insights.sbomify.com/CVE-2020-19726/): Denial of service in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-20294 and fix it if it is affected.

What it is: CVE-2021-20294 is a high-severity memory corruption vulnerability in Gnu Binutils, published on 29 Apr 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2021-20294 in the wild and no public exploit code.

Affected product: Gnu Binutils. 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-2021-20294/ (Markdown: https://insights.sbomify.com/CVE-2021-20294/index.md)
```

## Sources

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

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