# CVE-2024-5171: heap buffer overflow in libaom

> An integer overflow in libaom's image allocation can lead to heap buffer overflows, potentially allowing code execution or denial of service.

- **Severity:** Critical 10.0 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Jun 2024
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2024-5171, AZL-62420, BELL-CVE-2024-5171, DEBIAN-CVE-2024-5171, DLA-3881-1, DSA-5753-1, GHSA-592c-fmq9-g63c, JLSEC-2026-122, MGASA-2024-0220, OESA-2024-1949, OESA-2026-2776, OESA-2026-2779, SUSE-SU-2024:2030-1, SUSE-SU-2024:2052-1, SUSE-SU-2024:2056-1, UBUNTU-CVE-2024-5171, USN-6815-1, USN-7397-1

## What is CVE-2024-5171?

CVE-2024-5171 is a critical vulnerability in libaom, published on 5 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Integer overflow in libaom internal function img_alloc_helper can lead to heap buffer overflow. This function can be reached via 3 callers:

  *  Calling aom_img_alloc() with a large value of the d_w, d_h, or align parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid.
  *  Calling aom_img_wrap() with a large value of the d_w, d_h, or align parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid.
  *  Calling aom_img_alloc_with_border() with a large value of the d_w, d_h, align, size_align, or border parameter may result in integer overflows in the calculations of buffer sizes and offsets and some fields of the returned aom_image_t struct may be invalid.

Weakness: CWE-190 (Integer Overflow or Wraparound), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2024-5171?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libaom` | SUSE:Enterprise Storage 7.1 | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | All versions | 3.7.1-150600.3.3.1 |
| `libaom` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise Server 15 SP4-LTSS | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 1.0.0-150200.3.18.1 |
| `libaom` | SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Manager Proxy 4.3 | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | SUSE:Manager Server 4.3 | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | openSUSE:Leap 15.5 | All versions | 3.2.0-150400.3.6.1 |
| `libaom` | openSUSE:Leap 15.6 | All versions | 3.7.1-150600.3.3.1 |
| `libaom-devel-doc` | openSUSE:Leap 15.6 | All versions | 3.7.1-150600.3.3.1 |

Products: Aomedia Libaom.

## How do I fix CVE-2024-5171?

Apply the vendor's patch.

## Is CVE-2024-5171 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5171 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-5171 and fix it if it is affected.

What it is: CVE-2024-5171 is a critical vulnerability in libaom, published on 5 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5171 exists.

Affected product: libaom. 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-2024-5171/ (Markdown: https://insights.sbomify.com/CVE-2024-5171/index.md)
```

## Sources

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

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