# CVE-2023-24021: Security feature bypass in n/a

> Attackers can bypass ModSecurity WAF protections and cause buffer over-reads by exploiting incorrect null byte handling in file uploads.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Jan 2023
- **Updated:** 2 Apr 2025
- **Also known as:** AZL-43843, AZL-44475, BIT-modsecurity-2023-24021, BIT-modsecurity2-2023-24021, DEBIAN-CVE-2023-24021, GHSA-845r-7x4c-q8qf, SUSE-SU-2023:0431-1, SUSE-SU-2023:0447-1, UBUNTU-CVE-2023-24021

## What is CVE-2023-24021?

CVE-2023-24021 is a high-severity vulnerability in Debian Debian Linux, published on 20 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Incorrect handling of '\0' bytes in file uploads in ModSecurity before 2.9.7 may allow for Web Application Firewall bypasses and buffer over-reads on the Web Application Firewall when executing rules that read the FILES_TMP_CONTENT collection.

Weakness: CWE-170 (Improper Null Termination)

## Which versions are affected by CVE-2023-24021?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `modsecurity` | Bitnami | All versions | 2.9.7 |
| `modsecurity2` | Bitnami | All versions | 2.9.7 |
| `apache2-mod_security2` | SUSE:Enterprise Storage 7 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Enterprise Storage 7.1 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Module for Server Applications 15 SP4 | All versions | 2.9.4-150400.3.6.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Manager Proxy 4.2 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Manager Retail Branch Server 4.2 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | SUSE:Manager Server 4.2 | All versions | 2.9.2-150000.3.9.1 |
| `apache2-mod_security2` | openSUSE:Leap 15.4 | All versions | 2.9.4-150400.3.6.1 |

Products: Debian Debian Linux, Trustwave Modsecurity.

## How do I fix CVE-2023-24021?

Upgrade modsecurity to 2.9.7 or later.

## Is CVE-2023-24021 being exploited?

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

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-24021 and fix it if it is affected.

What it is: CVE-2023-24021 is a high-severity vulnerability in Debian Debian Linux, published on 20 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-24021 in the wild and no public exploit code.

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

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

## Sources

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

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