# CVE-2021-3185: Memory corruption in gstreamer

> An attacker can cause stack smashing and memory corruption in GStreamer's H.264 parser, potentially leading to code execution or denial of service.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jan 2021
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2021-3185, DLA-2528-1, DSA-4833-1, GHSA-fr84-36xq-g72g, MGASA-2021-0079, OESA-2021-1035, OESA-2021-1047, SUSE-SU-2021:1819-1, SUSE-SU-2021:1873-1, SUSE-SU-2021:1875-1, SUSE-SU-2021:1904-1, SUSE-SU-2021:1944-1, UBUNTU-CVE-2021-3185, openSUSE-SU-2021:0822-1, openSUSE-SU-2021:1012-1, openSUSE-SU-2021:1819-1, openSUSE-SU-2024:11776-1, openSUSE-SU-2024:11777-1, openSUSE-SU-2024:11782-1

## What is CVE-2021-3185?

CVE-2021-3185 is a critical memory corruption vulnerability in gstreamer, published on 25 Jan 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A flaw was found in the gstreamer h264 component of gst-plugins-bad before v1.18.1 where when parsing a h264 header, an attacker could cause the stack to be smashed, memory corruption and possibly code execution.

Weakness: CWE-787 (Out-of-bounds Write), CWE-120 (Buffer Copy without Checking Size of Input)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gstreamer-plugins-bad` | SUSE:Enterprise Storage 6 | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:HPE Helion OpenStack 8 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 1.12.5-3.6.1 |
| `gstreamer` | SUSE:Linux Enterprise Micro 5.0 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Micro 5.0 | All versions | 1.16.3-4.3.1 |
| `gstreamer` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 1.16.3-4.4.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 1.16.3-4.3.1 |
| `gstreamer-plugins-good` | SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 1.16.3-3.3.1 |
| `gstreamer` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.16.3-9.3.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.16.3-4.3.1 |
| `gstreamer-plugins-good` | SUSE:Linux Enterprise Module for Basesystem 15 SP3 | All versions | 1.16.3-3.3.1 |
| `gstreamer` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP2 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP2 | All versions | 1.16.3-4.4.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP2 | All versions | 1.16.3-4.3.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Module for Desktop Applications 15 SP3 | All versions | 1.16.3-9.3.1 |
| `gstreamer` | SUSE:Linux Enterprise Module for Package Hub 15 SP2 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Module for Package Hub 15 SP2 | All versions | 1.16.3-4.3.1 |
| `gstreamer` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 1.16.3-3.3.1 |
| `gstreamer-plugins-base` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 1.16.3-4.3.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 1.2.4-3.7.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP2-BCL | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP3-BCL | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP3-LTSS | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP4-LTSS | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server 15-LTSS | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.12.5-3.6.1 |
| `gstreamer-plugins-bad` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 1.8.3-18.3.5 |
| `gstreamer-plugins-ugly` | SUSE:Linux Enterprise Workstation Extension 15 SP2 | All versions | 1.16.3-3.3.1 |

Products: Freedesktop Gst-Plugins-Bad.

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

Upgrade to a fixed version.

## Is CVE-2021-3185 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2021-3185 is a critical memory corruption vulnerability in gstreamer, published on 25 Jan 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-3185 in the wild and no public exploit code.

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

## Sources

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

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