# CVE-2025-47947: ModSecurity Has Possible DoS Vulnerability

> Attackers can cause denial of service in ModSecurity when processing JSON payloads with specific sanitization rules, requiring a patch to mitigate.

- **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
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 May 2025
- **Updated:** 22 May 2025
- **Also known as:** ALSA-2025:8837, ALSA-2025:8844, AZL-62426, BIT-modsecurity-2025-47947, BIT-modsecurity2-2025-47947, CLSA-2025-1762421346, DEBIAN-CVE-2025-47947, DLA-4192-1, GHSA-859r-vvv8-rm8r, OESA-2025-1562, OESA-2025-1563, RHSA-2025:8605, RHSA-2025:8626, RHSA-2025:8627, RHSA-2025:8674, RHSA-2025:8837, RHSA-2025:8844, RHSA-2025:8917, RHSA-2025:8922, RHSA-2025:8937, RLSA-2025:8837, RLSA-2025:8844, UBUNTU-CVE-2025-47947

## What is CVE-2025-47947?

CVE-2025-47947 is a high-severity denial of service vulnerability in owasp-modsecurity ModSecurity, published on 21 May 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. Versions up to and including 2.9.8 are vulnerable to denial of service in one special case (in stable released versions): when the payload's content type is `application/json`, and there is at least one rule which does a `sanitiseMatchedBytes` action. A patch is available at pull request 3389 and expected to be part of version 2.9.9. No known workarounds are available.

Weakness: CWE-1050 (Excessive Platform Resource Consumption within a Loop)

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

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 | 3.0.12 |
| `modsecurity2` | Bitnami | All versions | 2.9.9 |
| `mod_security` | AlmaLinux:8 | All versions | 2.9.6-2.el8_10 |
| `mod_security-mlogc` | AlmaLinux:8 | All versions | 2.9.6-2.el8_10 |
| `mod_security` | AlmaLinux:9 | All versions | 2.9.6-2.el9_6 |
| `mod_security-mlogc` | AlmaLinux:9 | All versions | 2.9.6-2.el9_6 |
| `mod_security` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.6-2.el8_10 |
| `mod_security-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.6-2.el8_10 |
| `mod_security-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.6-2.el8_10 |
| `mod_security-mlogc` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.6-2.el8_10 |
| `mod_security-mlogc-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:2.9.6-2.el8_10 |
| `mod_security` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.6-2.el9_6 |
| `mod_security-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.6-2.el9_6 |
| `mod_security-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.6-2.el9_6 |
| `mod_security-mlogc` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.6-2.el9_6 |
| `mod_security-mlogc-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:2.9.6-2.el9_6 |
| `mod_security` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:2.9.2-8.el8_2.1 |
| `mod_security-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:2.9.2-8.el8_2.1 |
| `mod_security-debugsource` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:2.9.2-8.el8_2.1 |
| `mod_security-mlogc` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:2.9.2-8.el8_2.1 |
| `mod_security-mlogc-debuginfo` | Red Hat:rhel_aus:8.2::appstream | All versions | 0:2.9.2-8.el8_2.1 |
| `mod_security` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.2-9.el8_4.1 |
| `mod_security-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.2-9.el8_4.1 |
| `mod_security-debugsource` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.2-9.el8_4.1 |
| `mod_security-mlogc` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.2-9.el8_4.1 |
| `mod_security-mlogc-debuginfo` | Red Hat:rhel_aus:8.4::appstream | All versions | 0:2.9.2-9.el8_4.1 |
| `mod_security` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-debugsource` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-mlogc` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-mlogc-debuginfo` | Red Hat:rhel_aus:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-debuginfo` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-debugsource` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-mlogc` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security-mlogc-debuginfo` | Red Hat:rhel_e4s:8.6::appstream | All versions | 0:2.9.2-9.el8_6.1 |
| `mod_security` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:2.9.6-1.el8_8.1 |
| `mod_security-debuginfo` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:2.9.6-1.el8_8.1 |
| `mod_security-debugsource` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:2.9.6-1.el8_8.1 |
| `mod_security-mlogc` | Red Hat:rhel_e4s:8.8::appstream | All versions | 0:2.9.6-1.el8_8.1 |

Products: Trustwave Modsecurity.

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

Upgrade modsecurity to 3.0.12 or later.

## Is CVE-2025-47947 being exploited?

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

Public exploit code:

- POC for libapache2-mod-security2 (github_poc): https://github.com/yel1337/CVE-2025-47947

## Other vulnerabilities in owasp-modsecurity ModSecurity

- [CVE-2025-27110](https://insights.sbomify.com/CVE-2025-27110/): Libmodsecurity3 has possible bypass of encoded HTML entities (high 7.9)
- [CVE-2024-46292](https://insights.sbomify.com/CVE-2024-46292/): Memory corruption in n/a (high 7.5)

## Fix prompt for AI coding agents

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

What it is: CVE-2025-47947 is a high-severity denial of service vulnerability in owasp-modsecurity ModSecurity, published on 21 May 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-47947 exists.

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

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

## Sources

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

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