# CVE-2024-40897: Memory corruption in ORC

> A stack-based buffer overflow in the ORC compiler allows arbitrary code execution when processing crafted files, compromising developer and CI environments.

- **Severity:** High 7.0 (`CVSS:3.1/AV:L/AC:H/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:** 26 Jul 2024
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2024-40897, ALSA-2024:5306, ALSA-2024:6184, AZL-47050, AZL-47122, CLSA-2024-1725650489, CLSA-2025-1755114348, DEBIAN-CVE-2024-40897, GHSA-247v-6wr5-3wf3, MGASA-2024-0288, OESA-2024-1975, RHSA-2024:5306, RHSA-2024:5629, RHSA-2024:5638, RHSA-2024:5882, RHSA-2024:6159, RHSA-2024:6184, RLSA-2024:5306, ROOT-OS-DEBIAN-12-CVE-2024-40897, SUSE-SU-2024:2643-1, SUSE-SU-2024:2663-1, SUSE-SU-2025:0314-1, SUSE-SU-2025:0344-1, SUSE-SU-2025:20060-1, SUSE-SU-2025:20152-1, SUSE-SU-2025:20272-1, UBUNTU-CVE-2024-40897, USN-6964-1, USN-6964-2, openSUSE-SU-2024:14216-1

## What is CVE-2024-40897?

CVE-2024-40897 is a high-severity memory corruption vulnerability in GStreamer ORC, published on 26 Jul 2024. 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

Stack-based buffer overflow vulnerability exists in orcparse.c of ORC versions prior to 0.4.39. If a developer is tricked to process a specially crafted file with the affected ORC compiler, an arbitrary code may be executed on the developer's build environment. This may lead to compromise of developer machines or CI build environments.

Weakness: CWE-787 (Out-of-bounds Write), CWE-121 (Stack-based Buffer Overflow)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `orc` | AlmaLinux:8 | All versions | 0.4.28-4.el8_10 |
| `orc-compiler` | AlmaLinux:8 | All versions | 0.4.28-4.el8_10 |
| `orc-devel` | AlmaLinux:8 | All versions | 0.4.28-4.el8_10 |
| `orc` | AlmaLinux:9 | All versions | 0.4.31-7.el9_4 |
| `orc-compiler` | AlmaLinux:9 | All versions | 0.4.31-7.el9_4 |
| `orc-devel` | AlmaLinux:9 | All versions | 0.4.31-7.el9_4 |
| `orc` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc-compiler` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc-compiler-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:0.4.28-4.el8_10 |
| `orc` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc-compiler` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc-compiler-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:0.4.31-7.el9_4 |
| `orc` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc-compiler` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc-compiler-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc-debugsource` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc-devel` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:0.4.28-4.el8_2 |
| `orc` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-compiler` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-compiler-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-devel` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-compiler` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-compiler-debuginfo` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-debuginfo` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-debugsource` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc-devel` | Red Hat:rhel_e4s:8.4::appstream | All versions | 0:0.4.28-4.el8_4 |
| `orc` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.4.31-7.el9_0 |
| `orc-compiler` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.4.31-7.el9_0 |
| `orc-compiler-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.4.31-7.el9_0 |
| `orc-debuginfo` | Red Hat:rhel_e4s:9.0::appstream | All versions | 0:0.4.31-7.el9_0 |

Products: Gstreamer Orc.

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

Upgrade to a fixed version.

## Is CVE-2024-40897 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-40897 is a high-severity memory corruption vulnerability in GStreamer ORC, published on 26 Jul 2024. 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-2024-40897 in the wild and no public exploit code.

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

## Sources

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

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