CVE-2021-40438·Apache vulnerability
A crafted request uri-path can cause mod_proxy to forward the request to an origin server choosen by the remote user. This issue affects Apache HTTP Server 2.4.48 and earlier.
- Severity
- critical
- Software
- Apache
- Fixed in
- 2.4.49-1
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 100% — among the highest-scoring CVEs ever published. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
Until: 2.4.49-1
Fixed in: 2.4.49-1
How to fix this CVE
Upgrade Apache HTTP Server to version 2.4.49-1 or later to patch the mod_proxy request routing vulnerability. This critical flaw allows attackers to manipulate URI paths and redirect traffic to arbitrary origin servers under their control. Organizations using Apache 2.4.48 or earlier with mod_proxy enabled should prioritize this update immediately, as active exploitation has been documented.
sudo dnf update httpdDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
GET|POST|CONNECT .*(\.\.%2f|\.\.%5c|://[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|ProxyPassReverse|X-Forwarded-Host:.*[0-9]{1,3}\.[0-9]{1,3}) HTTPWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Configure ModSecurity or other WAF to block requests containing path traversal sequences (../ or encoded variants) and requests with X-Forwarded-Host headers pointing to RFC1918 or non-whitelisted external IP ranges. Implement strict validation on URI paths before they reach mod_proxy handlers. Additionally, restrict ProxyPass directives to explicitly defined destination hosts only and reject any dynamic host resolution.How to check if you are affected
- Step 1: Check your Apache version by running: apache2ctl -v or httpd -v — confirm if version is 2.4.48 or earlier
- Step 2: Verify mod_proxy is loaded by running: apache2ctl -M | grep proxy or httpd -M | grep proxy — if output shows 'proxy_module' or 'proxy_http_module', the attack surface is active
- Step 3: Review Apache access logs for suspicious URI patterns containing encoded or double-encoded path segments targeting external IPs: grep -E '\.\.%|%2e%2e|://[0-9]{1,3}\.[0-9]{1,3}' /var/log/apache2/access.log*
- Step 4: Verify the patch by running: apache2ctl -v or httpd -v again after upgrading and confirm version is 2.4.49-1 or higher
FAQ
What is CVE-2021-40438?
CVE-2021-40438 is a critical request routing vulnerability in Apache's mod_proxy module that allows remote attackers to craft malicious URI paths which redirect server-to-server requests to attacker-controlled destination servers, bypassing intended access controls.
Is CVE-2021-40438 being actively exploited?
Yes, CVE-2021-40438 is listed in the CISA KEV catalog, indicating active exploitation in the wild. Threat actors are leveraging this vulnerability to perform request smuggling and server-side request forgery (SSRF) attacks.
What versions of Apache are affected by CVE-2021-40438?
Apache HTTP Server version 2.4.48 and all earlier versions are vulnerable. The vulnerability was patched in version 2.4.49-1.
How do I check if my server is vulnerable to CVE-2021-40438?
Run 'apache2ctl -v' or 'httpd -v' to check your version. If it reports 2.4.48 or earlier AND mod_proxy is enabled (confirmed via 'apache2ctl -M | grep proxy'), your server is vulnerable.
Does Defensia detect CVE-2021-40438?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If Apache is installed on a monitored server, CVE-2021-40438 will appear in your dashboard with remediation steps.
Related Apache CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2021-40438. Free for 1 server.
Get started free