CVE-2024-38475
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.
Summary dbcve.org
A flaw in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows improper escaping of output, enabling attackers to map URLs to filesystem locations that the server is permitted to serve but are not intentionally reachable. This can lead to code execution or source code disclosure by exploiting substitutions in server context that use backreferences or variables as the first segment of the substitution.
Mitigation
Upgrade to Apache HTTP Server 2.4.60 or later, then review and constrain all RewriteRules that use backreferences or variables in the substitution, using the UnsafePrefixStat flag only after verifying appropriate constraints are in place.