cbcvebase.
CVE-2024-38475
published 2024-07-01

CVE-2024-38475: 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…

PriorityP196critical9.1CVSS 3.1
AVNACLPRNUINSUCHIHAN
KEVITWEXPLOIT
CISA Known Exploited Vulnerabilitydue 2025-05-22
Exploited in the wild
EPSS
99.96%
100.0th percentile
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.

Affected

9 ranges
VendorProductVersion rangeFixed in
apachehttp_server>= 2.4.0 < 2.4.602.4.60
apache_software_foundationapache_http_server2.4.0 – 2.4.59
debianapache2< apache2 2.4.61-1~deb12u1 (bookworm)apache2 2.4.61-1~deb12u1 (bookworm)
paloaltopan-os
sonicwallsma_200_firmware< 10.2.1.14-75sv10.2.1.14-75sv
sonicwallsma_210_firmware< 10.2.1.14-75sv10.2.1.14-75sv
sonicwallsma_400_firmware< 10.2.1.14-75sv10.2.1.14-75sv
sonicwallsma_410_firmware< 10.2.1.14-75sv10.2.1.14-75sv
sonicwallsma_500v_firmware< 10.2.1.14-75sv10.2.1.14-75sv

Detection & IOCsextracted from sources · hover to see the quote

url{{BaseURL}}/tmp/temp.db%3f.1.1.1.1a-1.css
url{{BaseURL}}/mnt/ram/var/log/httpd.log%3f.1.1.1.1a-1.css
path/tmp/temp.db
path/mnt/ram/var/log/httpd.log
urlhttp://172.17.0.2/flag.txt%3flol.png
  • Exploit pattern uses URL-encoded '?' (%3f) to truncate file path in mod_rewrite — look for GET requests containing '%3f' followed by a crafted extension (e.g., '.css', '.png') targeting sensitive file paths on SonicWall SMA100 devices.
  • Detection of successful exploitation: HTTP 200 response body containing both 'SQLite format' and 'sessionId' strings indicates successful read of the SMA100 session database (temp.db).
  • Detection of successful exploitation via log file read: HTTP 200 response body containing both 'mod_antiloris' and '[pid' strings with content-type 'text/plain' indicates successful read of httpd.log.
  • CVE-2024-38475 on SonicWall SMA100 can enable session hijacking — monitor for unauthorized reuse of stolen session tokens following file-read exploitation.
  • Shodan query to identify exposed SonicWall SMA100 targets: html:"SonicWall" html:"SMA"
  • Post-exploitation: OVERSTEP rootkit is deployed as a .ELF binary decoded from base64; hunt for unexpected ELF binaries written to disk on SMA appliances, especially following base64 decode commands in shell history.
  • Threat actor UNC6148 manually cleared system logs before restarting the appliance — absence of expected log entries or log gaps on SMA100 devices should be treated as a compromise indicator.
  • ·The 'UnsafePrefixStat' rewrite flag can be used to opt back in to pre-fix behavior for RewriteRules broken by the patch — ensure any use of this flag is accompanied by appropriate input constraints, as it re-enables the vulnerable behavior.
  • ·Vulnerability affects SonicWall SMA 200, SMA 210, SMA 400, SMA 410, and SMA 500v devices; patched in firmware version 10.2.1.14-75sv and later. Exploitation was confirmed against devices not yet updated to 10.2.1.15-81sv.
  • ·GTIG assesses with high confidence that UNC6148 exploited CVE-2024-38475 to steal administrator credentials prior to the targeted SMA appliance being updated to the latest firmware, but Mandiant incident responders could not confirm exploitation of this specific CVE.
  • ·OVERSTEP's anti-forensic and rootkit capabilities (selective log deletion, hiding components) mean standard log-based detection may be insufficient; disk image acquisition is recommended to avoid rootkit interference during forensic analysis.

CVSS provenance

nvdv3.19.1CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
osv9.8CRITICAL
vulncheck9.1CRITICAL
cisa9.1CRITICAL
vendor_ubuntu9.8CRITICAL
vendor_debian9.1CRITICAL
vendor_redhat9.1CRITICAL
vendor_oracle8.2CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.