# CVE-2024-45590: body-parser vulnerable to denial of service when url encoding is enabled


- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 10 Sep 2024
- **Updated:** 10 Sep 2024
- **Also known as:** AZL-49071, AZL-49097, AZL-49126, AZL-49149, CLSA-2026-1772583201, CLSA-2026-1773793044, CLSA-2026-1774225187, CLSA-2026-1782262676, CLSA-2026-1782262677, CLSA-2026-1782262678, CLSA-2026-1784596340, CLSA-2026-1792586687, DEBIAN-CVE-2024-45590, GHSA-qwcr-r2fm-qrc7, MINI-6jm6-9gcj-x7g5, ROOT-APP-NPM-CVE-2024-45590, UBUNTU-CVE-2024-45590

## What is CVE-2024-45590?

CVE-2024-45590 is a high-severity vulnerability in expressjs body-parser, published on 10 Sep 2024. 

### Official description

body-parser is Node.js body parsing middleware. body-parser <1.20.3 is vulnerable to denial of service when url encoding is enabled. A malicious actor using a specially crafted payload could flood the server with a large number of requests, resulting in denial of service. This issue is patched in 1.20.3.

Weakness: CWE-405 (Asymmetric Resource Consumption (Amplification))

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

2 open source packages ship an affected version, including body-parser. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `body-parser` | npm | All versions | 1.20.3 |
| `body-parser` | npm | All versions | 1.20.3 |

Products: Openjsf Body-Parser.

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

Upgrade body-parser to 1.20.3 or later.

## Is CVE-2024-45590 being exploited?

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

Public exploit code:

- Exploit for CVE-2024-45590 (github_poc): https://github.com/dhruvik-git/CVE-2024-45590
- https://github.com/Evillm/CVE-2024-45590-PoC (github_poc): https://github.com/Evillm/CVE-2024-45590-PoC

## Other vulnerabilities in expressjs body-parser

- [CVE-2026-12590](https://insights.sbomify.com/CVE-2026-12590/): body-parser vulnerable to denial of service when invalid limit value silently disables size enforcement (low 3.7)

## Fix prompt for AI coding agents

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

What it is: CVE-2024-45590 is a high-severity vulnerability in expressjs body-parser, published on 10 Sep 2024. 
Exploitation: There is no known exploitation of CVE-2024-45590 in the wild and no public exploit code.

Affected packages and fixed versions:
- body-parser (npm): affected all versions; fixed in 1.20.3
- body-parser (npm): affected all versions; fixed in 1.20.3

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

## Sources

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

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