# CVE-2022-40152: Stack Buffer Overflow in Woodstox

> An attacker can cause a denial of service via stack overflow in Woodstox XML parser when DTD support is enabled.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **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:** 16 Sep 2022
- **Updated:** 21 Apr 2025
- **Also known as:** CLEANSTART-2026-PV59376, CLEANSTART-2026-VM58824, CLSA-2024-1733443231, CLSA-2026-1773101686, CLSA-2026-1793138767, DEBIAN-CVE-2022-40152, ECHO-811e-858f-b863, GHSA-3f7h-mf4q-vrm4, MGASA-2023-0104, MINI-94rm-82q5-6q76, MINI-h28c-hh3p-fqpr, MINI-jcf2-rr76-7f2c, OESA-2024-2378, RHLW-2026-36d9ed0bb47c794f, RHLW-2026-403d1e66c95ef9bb, RHLW-2026-dd8ed0b211be109b, SUSE-SU-2023:0679-1, UBUNTU-CVE-2022-40152, openSUSE-SU-2024:13150-1, openSUSE-SU-2026:11226-1

## What is CVE-2022-40152?

CVE-2022-40152 is a medium-severity denial of service vulnerability in xstream Woodstox, published on 16 Sep 2022. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Those using Woodstox to parse XML data may be vulnerable to Denial of Service attacks (DOS) if DTD support is enabled. If the parser is running on user supplied input, an attacker may supply content that causes the parser to crash by stackoverflow. This effect may support a denial of service attack.

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

## Which versions are affected by CVE-2022-40152?

4 open source packages ship an affected version, including com.fasterxml.woodstox:woodstox-core. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `com.fasterxml.woodstox:woodstox-core` | Maven | All versions | 5.4.0 |
| `com.fasterxml.woodstox:woodstox-core` | Maven | All versions | 5.4.0 |
| `com.fasterxml.woodstox:woodstox-core` | Maven | From 6.0.0 | 6.4.0 |
| `com.fasterxml.woodstox:woodstox-core` | Maven | From 6.0.0 | 6.4.0 |
| `woodstox` | SUSE:Manager Server Module 4.3 | All versions | 4.4.2-150400.3.6.1 |
| `woodstox-core` | openSUSE:Tumbleweed | All versions | 7.2.1-1.1 |

Products: Fasterxml Woodstox, Xstream Xstream.

## How do I fix CVE-2022-40152?

Upgrade com.fasterxml.woodstox:woodstox-core to a fixed version for your release line: 5.4.0 or 6.4.0.

## Is CVE-2022-40152 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-40152 and fix it if it is affected.

What it is: CVE-2022-40152 is a medium-severity denial of service vulnerability in xstream Woodstox, published on 16 Sep 2022. 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-2022-40152 exists.

Affected packages and fixed versions:
- com.fasterxml.woodstox:woodstox-core (Maven): affected all versions; fixed in 5.4.0
- com.fasterxml.woodstox:woodstox-core (Maven): affected all versions; fixed in 5.4.0
- com.fasterxml.woodstox:woodstox-core (Maven): affected from 6.0.0; fixed in 6.4.0
- com.fasterxml.woodstox:woodstox-core (Maven): affected from 6.0.0; fixed in 6.4.0

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

## Sources

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

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