Modsecurity: Improper Null Termination
CVE-2023-24021 is a high-severity improper null termination vulnerability in Modsecurity from Trustwave, with a CVSS 3.1 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 2.9.7 as the first without the flaw, so updating Modsecurity to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 0.93% chance of exploitation within 30 days, higher than 61% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update Modsecurity to 2.9.7 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Trustwave | Modsecurity | before 2.9.7 | 2.9.7 |
| Debian | Debian Linux | 10.0 | Not stated |
Version data comes from NVD's product matching. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- NoneNo data is disclosed.
- Integrity
- HighData or code can be modified at will.
- Availability
- NoneAvailability is not affected.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 7.5 | High | NVD |
| CVSS 3.1 | 7.5 | High | CISA (ADP) |
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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Null Termination
The product does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.
How developers prevent this class of flaw
- Use a language that is not susceptible to these issues. However, be careful of null byte interaction errors (CWE-626) with lower-level constructs that may be written in a language that is susceptible.
- Ensure that all string functions used are understood fully as to how they append null characters. Also, be wary of off-by-one errors when appending nulls to the end of strings.
- If performance constraints permit, special code can be added that validates null-termination of string buffers, this is a rather naive and error-prone solution.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
Third-party and government advisories
- lists.debian.org/debian-lts-announce/2023/01/msg00023.htmlMailing List, Third Party Advisory
Other references
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/52TGCZCOHYBDCVWJYNN2…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/SYRTXTOQQI6SB2TLI5QX…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WCH6JM4I4MD4YABYFHSB…
Recent Improper Null Termination vulnerabilities
- 7.5 High severity
Spotted an error? Tell us.