Apache HTTP Server 2.4.49: a path-traversal fix that needed a second fix
CVE-2021-41773 was a path traversal in Apache httpd 2.4.49 that could leak files and, with CGI enabled, reach RCE. The 2.4.50 fix was incomplete, so CVE-2021-42013 followed days later. Two CVEs, one bug, a textbook patch-the-patch.
In October 2021, Apache HTTP Server 2.4.49 shipped with a path-traversal flaw, CVE-2021-41773: a change to how the server normalized URL paths let an attacker use encoded ../ sequences to read files outside the document root, and where mod_cgi was enabled, escalate that to remote code execution. The httpd team released 2.4.50 to fix it. Within days, researchers showed the fix was incomplete, a different encoding bypassed it, and CVE-2021-42013 was assigned, requiring 2.4.51. Two CVEs, one underlying weakness, days apart: a textbook patch-the-patch, and both were mass-exploited because Apache httpd is everywhere and the exploit was trivial.
What the bugs are
CVE-2021-41773 stemmed from a path-normalization change in 2.4.49 that failed to reject traversal sequences in certain encodings, allowing access to files outside directories configured with require all denied. With CGI scripts enabled, the traversal could reach an interpreter and execute commands. CVE-2021-42013 is the bypass of the 2.4.50 fix, using double-encoding to defeat the incomplete patch. Only 2.4.49 and 2.4.50 were affected (a recent regression, not a long-standing bug), but those versions saw rapid adoption, and CISA lists both with the ransomware flag. Public exploits and mass scanning appeared almost immediately.
The lesson: incomplete fixes, and a near-miss on the danger
Two things stand out:
- The patch-the-patch pattern, again. As with the Log4Shell cascade and the SmartScreen narrow-fix bypass, the first fix (2.4.50) addressed the specific encoding the proof-of-concept used, not the full normalization weakness, so a variant bypassed it within days. The operational takeaway is to not close the ticket on the first patch during a fast-moving event; watch for the follow-up CVE, which for path-traversal and parsing bugs is common.
- The exposure depended on configuration. The pure file-disclosure impact required directories not protected by the default
require all denied, and the RCE escalation required CGI to be enabled. So the worst outcomes hit specific configurations, but file disclosure alone (reading config files, credentials) is serious, and many servers were exploitable.
What to do
- Upgrade to Apache httpd 2.4.51 or later. If you’re on 2.4.49 or 2.4.50, you’re exposed to one or both bugs; 2.4.51 closes the full normalization weakness. Anything older than 2.4.49 was never affected by this specific regression, but should be current regardless.
- Audit your directory access controls. Ensure filesystem directories are protected with
require all deniedby default, so a traversal can’t read them, and only open what’s intended. - Disable CGI where you don’t need it.
mod_cgi/mod_cgidis the escalation path from file-read to RCE here; if your site doesn’t use CGI, don’t load it. - Assume compromise on exposed 2.4.49/2.4.50 servers from the October 2021 window and hunt for file-disclosure access to sensitive paths and, where CGI was on, web shells and command execution.
- During fast vuln events, track the follow-up. Build the expectation of a patch-the-patch into your process; the first fix for a parsing/traversal bug is often revised.
The reframe is the recurring patch-quality one: a fix that stops the published exploit isn’t necessarily a fix for the bug, and Apache’s 2.4.49-to-2.4.51 sequence is a tight, fast example, an incomplete fix bypassed within days. Get to 2.4.51, lock down your directory controls and CGI, and don’t assume the first emergency patch was the last one. We flag the patch-bypass entries because they’re the cases where “we patched it” was briefly, dangerously, untrue.
Sources
- CISA Known Exploited Vulnerabilities Catalog
- NVD CVE-2021-41773 — 2021-10
- NVD CVE-2021-42013 — 2021-10
- Apache HTTP Server 2.4.51 security advisory — 2021-10
Share
Related field notes
-
TeamCity's path traversal took two years to reach KEV. That's a long time to leave a CI server exposed.
CVE-2024-27199, a path traversal in JetBrains TeamCity On-Premises, was patched in March 2024 and exploited by BianLian ransomware within days. CISA added it to KEV in April 2026 with a May 4 federal deadline. If you're still below 2023.11.4, this is two years overdue.
-
Your attack surface isn't just port 443
CVE-2023-46604 is a perfect-10 RCE in Apache ActiveMQ. The exploit isn't a web request; it's a single message to the broker on port 61616, a port most web-focused scanning and firewalling never considers. The broker then fetches a remote XML file and runs whatever's in it.
-
A new critical Confluence RCE stopped being news. That's the problem.
CVE-2022-26134, CVE-2023-22515, CVE-2023-22518, CVE-2023-22527: Atlassian Confluence Server and Data Center has been mass-exploited so many times that the headline repeats. If you run it on the internet, you're operating one of the most reliably-targeted boxes there is.
One email, every weekday morning.
You're in. Check your inbox.