This bug is from 2024, but CISA says attackers are using it, so make sure none of your servers missed the fix.

At a glance

  • CVE: CVE-2024-38475, one of the Apache bugs Orange Tsai of DEVCORE reported in 2024 and later presented at Black Hat USA 2024 as “Confusion Attacks”.
  • Severity: 9.1 (Critical) at NVD and CISA. Apache rates it “important”.
  • Affected: Apache HTTP Server 2.4.0 through 2.4.59. NVD also lists SonicWall SMA 100-series firmware (SMA 200, 210, 400, 410 and 500v) before 10.2.1.14-75sv, plus NetApp ONTAP 9.
  • Known exploited: Yes. CISA added it to its KEV list on 2025-05-01.

What’s going on

This one lives in mod_rewrite, the module behind RewriteRule. It hits rules in server context (your main config or a <VirtualHost> block, not .htaccess) whose substitution starts with a backreference or variable, such as $1. In Apache 2.4.59 and earlier, if the rewritten result happened to match a real path on disk, Apache could use that path directly instead of treating it as something under your DocumentRoot.

So an attacker could map a URL to files the server is allowed to serve but that no URL was ever meant to reach. Apache says that can end in code execution or source code disclosure. In Orange Tsai’s write-up, a rule as ordinary as RewriteRule "^/html/(.*)$" "/$1.html", combined with an encoded ? (%3F, the trick behind CVE-2024-38474), was enough to read the source of a CGI script outside the web root.

Who should care? Anyone running Apache 2.4.59 or older with rewrite rules like that, plus anyone with an appliance that embeds an affected Apache. CISA’s entry notes that this bug sits in a common open-source component used by other products, so check with those vendors for their patch status.

Timeline

  • Reported to Apache: 2024-04-01
  • Disclosed and patched: 2024-07-01 (Apache HTTP Server 2.4.60)
  • Researcher’s write-up: 2024-08-09
  • Added to CISA KEV: 2025-05-01 (deadline for US federal agencies: 2025-05-22)

== UPDATE ==

To be clear, this isn’t a new bug. The fix has been out since July 2024. What changed is that CISA confirmed it’s being exploited, so any server still on 2.4.59 or older is a real target.

  • Patch available: Yep, since July 2024.
  • Fixed in: Apache HTTP Server 2.4.60. That said, aim for 2.4.62 or later. Another fix in 2.4.60 (for CVE-2024-38476) caused a source-code-disclosure regression that took 2.4.61 and 2.4.62 to sort out. The newest release on Apache’s page is 2.4.71, from 2026-11-11. For SonicWall SMA 100-series appliances, NVD lists firmware 10.2.1.14-75sv as the first unaffected release.
  • How to apply: Update Apache through your package manager: sudo apt update && sudo apt install --only-upgrade apache2 on Debian/Ubuntu, or sudo dnf upgrade httpd on RHEL, Alma, Rocky or Fedora. Then run apachectl configtest and restart Apache. Distros backport fixes, so your version string may still read lower than 2.4.60. Check your distro’s security tracker for CVE-2024-38475 instead. If you build from source, grab the current 2.4.x release from httpd.apache.org.
  • Heads-up after upgrading: Apache now refuses server-context rules whose substitution starts with a backreference or variable and resolves to a filesystem path, so some rules will break. If you’ve checked that a rule can’t resolve to anything outside your web root, the UnsafePrefixStat flag opts that one rule back in (Apache’s docs example: RewriteRule "^/mirror/(.+)$" "$1" [PT,UnsafePrefixStat]). Use it sparingly.
  • If you can’t patch yet: CISA’s required action is to apply the vendor’s mitigations, or stop using the product if there aren’t any. Apache doesn’t offer a workaround other than upgrading. While you get there, look through your main config and virtual hosts for rules whose substitution’s first path segment is a backreference or variable ($1, %1, %{...}), and change them to start with a fixed directory instead.

References