# CVE-2025-27091: OpenH264 Decoding Functions Heap Overflow Vulnerability

> A heap overflow in OpenH264 allows remote attackers to execute arbitrary code or cause denial of service via malicious video files.

- **Severity:** High 8.6 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 20 Feb 2025
- **Updated:** 20 Feb 2025
- **Also known as:** DEBIAN-CVE-2025-27091, DSA-5870-1, GHSA-5pmw-9j92-3c4c, GHSA-m99q-5j7x-7m9x, RUSTSEC-2025-0008, UBUNTU-CVE-2025-27091

## What is CVE-2025-27091?

CVE-2025-27091 is a high-severity memory corruption vulnerability in cisco openh264, published on 20 Feb 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

OpenH264 is a free license codec library which supports H.264 encoding and decoding. A vulnerability in the decoding functions of OpenH264 codec library could allow a remote, unauthenticated attacker to trigger a heap overflow. This vulnerability is due to a race condition between a Sequence Parameter Set (SPS) memory allocation and a subsequent non Instantaneous Decoder Refresh (non-IDR) Network Abstraction Layer (NAL) unit memory usage. An attacker could exploit this vulnerability by crafting a malicious bitstream and tricking a victim user into processing an arbitrary video containing the malicious bistream. An exploit could allow the attacker to cause an unexpected crash in the victim's user decoding client and, possibly, perform arbitrary commands on the victim's host by abusing the heap overflow. This vulnerability affects OpenH264 2.5.0 and earlier releases. Both Scalable Video Coding (SVC) mode and Advanced Video Coding (AVC) mode are affected by this vulnerability. OpenH264 software releases 2.6.0 and later contained the fix for this vulnerability. Users are advised to upgrade. There are no known workarounds for this vulnerability.

### For more information

If you have any questions or comments about this advisory:
* [Open an issue in cisco/openh264](https://github.com/cisco/openh264/issues)
* Email Cisco Open Source Security ([oss-security@cisco.com](mailto:oss-security@cisco.com)) and Cisco PSIRT ([psirt@cisco.com](mailto:psirt@cisco.com))

### Credits:

* **Research:** Octavian Guzu and Andrew Calvano of Meta
* **Fix ideation:** Philipp Hancke and Shyam Sadhwani of Meta
* **Fix implementation:** Benzheng Zhang (@BenzhengZhang)
* **Release engineering:** Benzheng Zhang (@BenzhengZhang)

Weakness: CWE-787 (Out-of-bounds Write), CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2025-27091?

3 open source packages ship an affected version, including openh264-sys2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `openh264-sys2` | crates.io | All versions | 0.8.0 |
| `openh264-sys2` | crates.io | All versions | 0.8.0 |
| `openh264-sys2` | crates.io | From 0.0.0-0 | 0.8.0 |

Products: Cisco Openh264.

## How do I fix CVE-2025-27091?

Upgrade openh264-sys2 to 0.8.0 or later.

## Is CVE-2025-27091 being exploited?

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

## Other vulnerabilities in cisco openh264

- [CVE-2014-8001](https://insights.sbomify.com/CVE-2014-8001/): Memory corruption in n/a (high 7.5)
- [CVE-2014-8002](https://insights.sbomify.com/CVE-2014-8002/): Use after free in n/a (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-27091 and fix it if it is affected.

What it is: CVE-2025-27091 is a high-severity memory corruption vulnerability in cisco openh264, published on 20 Feb 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2025-27091 in the wild and no public exploit code.

Affected packages and fixed versions:
- openh264-sys2 (crates.io): affected all versions; fixed in 0.8.0
- openh264-sys2 (crates.io): affected all versions; fixed in 0.8.0
- openh264-sys2 (crates.io): affected from 0.0.0-0; fixed in 0.8.0

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-2025-27091/ (Markdown: https://insights.sbomify.com/CVE-2025-27091/index.md)
```

## Sources

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

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