← back
CVE-2024-38475

Apache HTTP Server weakness in mod_rewrite when first segment of substitution matches filesystem path.

CVSS 9.1 CRITICALEPSS 100.0%● KEVCWE-116
In short

Apache HTTP Server's mod_rewrite module incorrectly handles URL rewriting when the first part of a rewrite rule uses backreferences or variables, allowing attackers to access files on the server that shouldn't be publicly reachable. This can lead to running malicious code or exposing sensitive source code.

Technical detail

A flaw in mod_rewrite's output escaping (CWE-116) in Apache HTTP Server 2.4.59 and earlier allows path traversal when substitution rules begin with backreferences or variables in server context. An attacker can craft requests matching the rewrite pattern to bypass intended access restrictions and reach arbitrary filesystem locations served by the web server, enabling remote code execution or information disclosure.

Summary generated and translated by AI from the official description.
Improper escaping of output in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows an attacker to map URLs to filesystem locations that are permitted to be served by the server but are not intentionally/directly reachable by any URL, resulting in code execution or source code disclosure. Substitutions in server context that use a backreferences or variables as the first segment of the substitution are affected.  Some unsafe RewiteRules will be broken by this change and the rewrite flag "UnsafePrefixStat" can be used to opt back in once ensuring the substitution is appropriately constrained.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
⚠ Public resources, to assess the exposure of systems you control or are authorized to test. Test only with authorization.

Want to know if your infrastructure is exposed to this?

Talk to TrueHacking →