# CVE-2024-21548: Other in bun

> Prototype pollution in Bun runtime allows attackers to manipulate object prototypes via APIs, potentially leading to code execution or privilege escalation.

- **Severity:** High 7.7 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Dec 2024
- **Updated:** 19 Aug 2026
- **Also known as:** GHSA-v9mx-4pqq-h232

## What is CVE-2024-21548?

CVE-2024-21548 is a high-severity vulnerability in bun, published on 18 Dec 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Versions of the package bun after 0.0.12 and before 1.1.30 are vulnerable to Prototype Pollution due to improper input sanitization. An attacker can exploit this vulnerability through Bun's APIs that accept objects.**Note:** This issue relates to the widely known and actively developed 'Bun' JavaScript runtime. The bun package on NPM at versions 0.0.12 and below belongs to a different and older project that happened to claim the 'bun' name in the past.

Weakness: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

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

1 open source package ship an affected version, including bun.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bun` | npm | All versions | 1.1.30 |

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

Upgrade bun to 1.1.30 or later.

## Is CVE-2024-21548 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-21548 is a high-severity vulnerability in bun, published on 18 Dec 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21548 exists.

Affected packages and fixed versions:
- bun (npm): affected all versions; fixed in 1.1.30

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

## Sources

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

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