# CVE-2025-54571: ModSecurity's Insufficient Return Value Handling can Lead to XSS and Source Code Disclosure

> Attackers can override HTTP Content-Type headers in ModSecurity, leading to Cross-Site Scripting and source code disclosure.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Aug 2025
- **Updated:** 3 Nov 2025
- **Also known as:** AZL-66087, AZL-66111, BIT-modsecurity-2025-54571, BIT-modsecurity2-2025-54571, DEBIAN-CVE-2025-54571, DLA-4294-1, GHSA-cg44-9m43-3f9v, OESA-2025-2012, OESA-2025-2013, OESA-2025-2014, OESA-2025-2015, OESA-2025-2016, OESA-2025-2062, SUSE-SU-2025:03422-1, SUSE-SU-2025:03423-1, UBUNTU-CVE-2025-54571, openSUSE-SU-2025:15456-1

## What is CVE-2025-54571?

CVE-2025-54571 is a medium-severity cross-site scripting vulnerability in owasp-modsecurity ModSecurity, published on 5 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx. In versions 2.9.11
and below, an attacker can override the HTTP response’s Content-Type, which could lead to several issues depending on the HTTP scenario. For example, we have demonstrated the potential for XSS and arbitrary script source code disclosure in the latest version of mod_security2. This issue is fixed in version 2.9.12.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation), CWE-252 (Unchecked Return Value)

## Which versions are affected by CVE-2025-54571?

2 open source packages ship an affected version, including modsecurity and modsecurity2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `modsecurity` | Bitnami | All versions | 2.9.12 |
| `modsecurity2` | Bitnami | All versions | 2.9.12 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Module for Server Applications 15 SP6 | All versions | 2.9.4-150400.3.12.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Module for Server Applications 15 SP7 | All versions | 2.9.4-150400.3.12.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 | All versions | 2.8.0-7.12.1 |
| `apache2-mod_security2` | openSUSE:Leap 15.6 | All versions | 2.9.4-150400.3.12.1 |
| `apache2-mod_security2` | openSUSE:Tumbleweed | All versions | 2.9.12-1.1 |

Products: Owasp Modsecurity.

## How do I fix CVE-2025-54571?

Upgrade modsecurity to 2.9.12 or later.

## Is CVE-2025-54571 being exploited?

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

## Other vulnerabilities in owasp-modsecurity ModSecurity

- [CVE-2026-52747](https://insights.sbomify.com/CVE-2026-52747/): Security feature bypass in ModSecurity (high 8.6)
- [CVE-2024-1019](https://insights.sbomify.com/CVE-2024-1019/): WAF bypass of the ModSecurity v3 release line (high 8.6)
- [CVE-2026-42268](https://insights.sbomify.com/CVE-2026-42268/): ModSecurity: Unsigned integer underflow in @verifySSN / @verifyCPF / @verifySVNR operators (high 8.2)
- [CVE-2026-30923](https://insights.sbomify.com/CVE-2026-30923/): libModSecurity3 denial of service via segfault when using t:hexDecode on single-character query strings (high 8.2)
- [CVE-2025-48866](https://insights.sbomify.com/CVE-2025-48866/): ModSecurity has possible DoS vulnerability in sanitiseArg action (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-54571 and fix it if it is affected.

What it is: CVE-2025-54571 is a medium-severity cross-site scripting vulnerability in owasp-modsecurity ModSecurity, published on 5 Aug 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-54571 exists.

Affected packages and fixed versions:
- modsecurity (Bitnami): affected all versions; fixed in 2.9.12
- modsecurity2 (Bitnami): affected all versions; fixed in 2.9.12

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

## Sources

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

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