CVE-2021-40438: Apache HTTP Server-Side Request Forgery (SSRF)
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.
CVE-2021-40438 is a server-side request forgery weakness in the Apache HTTP Server's mod_proxy component. A crafted request URI path can cause the server to forward traffic to an origin chosen by a remote user. This matters because Apache HTTP Server is widely deployed as a reverse proxy and front-end; successful abuse can let an attacker reach internal systems that were never meant to be directly accessible from the internet.
CISA notes the issue affects Apache HTTP Server 2.4.48 and earlier. Teams should treat any unpatched instance running mod_proxy as in scope until they confirm otherwise against the vendor advisory.
How it works
The flaw belongs to CWE-918 (Server-Side Request Forgery). In normal operation mod_proxy accepts a client request and forwards it to a configured backend. With this vulnerability, a specially formed URI path can influence that forwarding decision so the request is sent to an origin server selected by the attacker rather than by the administrator.
An attacker who can reach the vulnerable Apache instance sends a request whose path is crafted to abuse the proxy logic. The server then initiates a connection to the attacker-chosen target. Depending on network placement, that target may be an internal host, a cloud metadata endpoint, or another service reachable only from the proxy. No further exploit mechanics are detailed in the provided facts; defenders should consult the vendor advisory for precise request patterns and fixed behavior.
Am I affected? How to find it in your systems
Apache HTTP Server commonly runs on Linux and Windows hosts that terminate HTTP/HTTPS traffic, act as reverse proxies, or sit in front of application servers. Inventory every system that listens on ports 80/443 or that loads the mod_proxy family of modules.
- Query package managers (rpm, dpkg, etc.) or Windows installers for the installed httpd/apache2 version string and compare it with the range given by CISA: 2.4.48 and earlier.
- Inspect configuration files (httpd.conf, apache2.conf, and included proxy-*.conf fragments) for LoadModule proxy_module and related ProxyPass/ProxyPassMatch directives.
- Where centralized configuration management exists, search for hosts whose Apache version is at or below 2.4.48 and that have proxy modules enabled.
- Review access and error logs for unusual URI paths that contain unexpected scheme or host components; such patterns can indicate probing, though absence of obvious log entries does not prove safety.
Confirm exact affected builds and any additional prerequisites directly against the vendor advisory, because packaging and module combinations vary.
How to remediate
The primary action is to apply the vendor-supplied update that corrects the mod_proxy handling of crafted URI paths. CISA's required action is simply: apply updates per vendor instructions. After patching, restart the Apache service and verify the new version string.
- Prefer the official Apache HTTP Server release or the patched package from your OS vendor.
- Once updated, re-validate that proxy modules still function as intended for legitimate backends.
- As hardening for this class of weakness, restrict ProxyPass targets to an explicit allow-list of internal hosts, disable unused proxy sub-modules, and ensure the Apache process runs with least privilege and limited network egress.
If you can't patch immediately
Until the update can be installed, reduce exposure with compensating controls:
- Network segmentation: place the Apache host so it cannot initiate connections to sensitive internal segments or cloud metadata services.
- Virtual patching / WAF: deploy rules that reject or sanitize request URIs containing unexpected schemes, double-encoded characters, or host portions that do not match known backends. Test rules carefully to avoid breaking legitimate traffic.
- Feature disablement: if reverse-proxy functionality is not required, unload mod_proxy and related modules.
- Monitoring: alert on Apache access-log entries whose request lines show anomalous path structures, and on unexpected outbound connections from the Apache process.
These measures lower risk but do not replace the vendor patch.
If your data may have been exposed
Actively exploited SSRF vulnerabilities can be used as an initial foothold that leads to broader compromise and data exposure. Known ransomware use of this specific CVE is not documented in the supplied facts. If you suspect your environment was targeted, examine proxy and firewall logs for evidence of internal scanning or data access, rotate any credentials that may have been reachable, and consider running a free exposure scan of organizational email addresses against known breach data sets to determine whether related accounts already appear in public breach corpora.
AICompiled with AI assistance from public sources and published under our editorial standards.