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

Medium 6.9 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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, CWE-252

Which versions are affected by CVE-2025-54571?

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

PackageAffectedFixed in
modsecurity BitnamiAll versions2.9.12
modsecurity2 BitnamiAll versions2.9.12
Linux distribution packages (5)
apache2-mod_security2 SUSE:Linux Enterprise Module for Server Applications 15 SP6All versions2.9.4-150400.3.12.1
apache2-mod_security2 SUSE:Linux Enterprise Module for Server Applications 15 SP7All versions2.9.4-150400.3.12.1
apache2-mod_security2 SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5All versions2.8.0-7.12.1
apache2-mod_security2 openSUSE:Leap 15.6All versions2.9.4-150400.3.12.1
apache2-mod_security2 openSUSE:TumbleweedAll versions2.9.12-1.1

Products include Owasp Modsecurity.

How do I fix CVE-2025-54571?

Upgrade modsecurity to 2.9.12 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-54571 being exploited?

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

Sources

Also known as AZL-66087, AZL-66111, BIT-modsecurity-2025-54571, BIT-modsecurity2-2025-54571, DEBIAN-CVE-2025-54571, DLA-4294-1 and 11 more.

Is CVE-2025-54571 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free