# CVE-2024-13903: quickjs-ng QuickJS qjs quickjs.c JS_GetRuntime stack-based overflow

> A stack-based buffer overflow in QuickJS allows remote attackers to execute arbitrary code or cause denial of service.

- **Severity:** Medium 5.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:L/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:** No
- **Published:** 21 Mar 2025
- **Updated:** 21 Mar 2025
- **Also known as:** DEBIAN-CVE-2024-13903, GHSA-phgv-62jq-9jj7

## What is CVE-2024-13903?

CVE-2024-13903 is a medium-severity memory corruption vulnerability in quickjs-ng QuickJS, published on 21 Mar 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

A vulnerability was found in quickjs-ng QuickJS up to 0.8.0. It has been declared as problematic. Affected by this vulnerability is the function JS_GetRuntime of the file quickjs.c of the component qjs. The manipulation leads to stack-based buffer overflow. The attack can be launched remotely. Upgrading to version 0.9.0 is able to address this issue. The patch is named 99c02eb45170775a9a679c32b45dd4000ea67aff. It is recommended to upgrade the affected component.

Weakness: CWE-121 (Stack-based Buffer Overflow), CWE-787 (Out-of-bounds Write), CWE-119 (Improper Restriction of Operations within the Bounds of a Memory Buffer)

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

It affects 1 product.


Products: Quickjs-Ng Quickjs.

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

No fix has been published for CVE-2024-13903 yet. Limit exposure of the affected software until one is available.

## Is CVE-2024-13903 being exploited?

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

## Other vulnerabilities in quickjs-ng QuickJS

- [CVE-2026-0821](https://insights.sbomify.com/CVE-2026-0821/): quickjs-ng quickjs quickjs.c js_typed_array_constructor heap-based overflow (medium 6.9)
- [CVE-2025-46688](https://insights.sbomify.com/CVE-2025-46688/): Memory corruption in QuickJS (medium 5.6)
- [CVE-2026-1144](https://insights.sbomify.com/CVE-2026-1144/): quickjs-ng quickjs Atomics Ops quickjs.c use after free (medium 5.3)
- [CVE-2026-1145](https://insights.sbomify.com/CVE-2026-1145/): quickjs-ng quickjs quickjs.c js_typed_array_constructor_ta heap-based overflow (medium 5.3)
- [CVE-2026-0822](https://insights.sbomify.com/CVE-2026-0822/): quickjs-ng quickjs quickjs.c js_typed_array_sort heap-based overflow (medium 5.3)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-13903 is a medium-severity memory corruption vulnerability in quickjs-ng QuickJS, published on 21 Mar 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-2024-13903 in the wild and no public exploit code.

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

## Sources

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

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