# CVE-2021-40438: Apache HTTP Server-Side Request Forgery (SSRF)

> Attackers can force Apache mod_proxy to forward requests to arbitrary internal servers, enabling access to restricted resources.

- **Severity:** Critical 9.0 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 1 Dec 2021 (CISA KEV), used in ransomware
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 16 Sep 2021
- **Updated:** 6 Aug 2026
- **Also known as:** ALBA-2021:4604, ALPINE-CVE-2021-40438, AZL-6487, BIT-apache-2021-40438, CLEANSTART-2026-BM33422, DEBIAN-CVE-2021-40438, GHSA-rwxq-58vm-3v2j, RHSA-2021:3746, RHSA-2021:3754, RHSA-2021:3836, RHSA-2021:3837, RHSA-2021:3856, UBUNTU-CVE-2021-40438, openSUSE-SU-2025:14708-1

## What is CVE-2021-40438?

CVE-2021-40438 is a critical server-side request forgery vulnerability in Apache Http Server, published on 16 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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.

Weakness: CWE-918 (Server-Side Request Forgery)

## Which versions are affected by CVE-2021-40438?

1 open source package ship an affected version, including apache. It affects 39 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `apache` | Bitnami | All versions | 2.4.49 |
| `mod_http2` | AlmaLinux:8 | All versions | 1.15.7-3.module_el8.5.0+2609+b30d9eec |
| `mod_md` | AlmaLinux:8 | All versions | 1:2.0.8-8.module_el8.5.0+2609+b30d9eec |
| `mod_md` | AlmaLinux:8 | All versions | 1:2.0.8-8.module_el8.6.0+2872+fe0ff7aa |
| `httpd` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-manual` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-tools` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ldap` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::client | All versions | 1:2.4.6-97.el7_9.1 |
| `mod_session` | Red Hat:enterprise_linux:7::client | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ssl` | Red Hat:enterprise_linux:7::client | All versions | 1:2.4.6-97.el7_9.1 |
| `httpd` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-manual` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-tools` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ldap` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::computenode | All versions | 1:2.4.6-97.el7_9.1 |
| `mod_session` | Red Hat:enterprise_linux:7::computenode | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ssl` | Red Hat:enterprise_linux:7::computenode | All versions | 1:2.4.6-97.el7_9.1 |
| `httpd` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-devel` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-manual` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-tools` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ldap` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::server | All versions | 1:2.4.6-97.el7_9.1 |
| `mod_session` | Red Hat:enterprise_linux:7::server | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ssl` | Red Hat:enterprise_linux:7::server | All versions | 1:2.4.6-97.el7_9.1 |
| `httpd` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-debuginfo` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-devel` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-manual` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `httpd-tools` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ldap` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_proxy_html` | Red Hat:enterprise_linux:7::workstation | All versions | 1:2.4.6-97.el7_9.1 |
| `mod_session` | Red Hat:enterprise_linux:7::workstation | All versions | 0:2.4.6-97.el7_9.1 |
| `mod_ssl` | Red Hat:enterprise_linux:7::workstation | All versions | 1:2.4.6-97.el7_9.1 |

Products: Apache Http Server, Broadcom Brocade Fabric Operating System Firmware, Debian Debian Linux, F5 F5os, Fedoraproject Fedora, Netapp Cloud Backup, Netapp Clustered Data Ontap, Netapp Storagegrid, Oracle Enterprise Manager Ops Center, Oracle Http Server, Oracle Instantis Enterprisetrack, Oracle Secure Global Desktop, Oracle Zfs Storage Appliance Kit, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Arm 64, Redhat Enterprise Linux for Arm 64 Eus, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Ibm Z Systems Eus, Redhat Enterprise Linux for Ibm Z Systems Eus S390x and 19 more.

## How do I fix CVE-2021-40438?

Upgrade apache to 2.4.49 or later. US federal agencies must fix it by 15 Dec 2021.

## Is CVE-2021-40438 being exploited?

Yes. Attackers have exploited CVE-2021-40438 in the wild since at least 1 Dec 2021, including in ransomware campaigns.

Public exploit code:

- Apache forward request CVE (github_poc): https://github.com/Kashkovsky/CVE-2021-40438
- CVE-2021-40438 exploit PoC with Docker setup. (github_poc): https://github.com/sixpacksecurity/CVE-2021-40438
- CVE-2021-40438 Apache <= 2.4.48 SSRF exploit (github_poc): https://github.com/sergiovks/CVE-2021-40438-Apache-2.4.48-SSRF-exploit
- https://github.com/xiaojiangxl/CVE-2021-40438 (github_poc): https://github.com/xiaojiangxl/CVE-2021-40438
- https://github.com/BabyTeam1024/CVE-2021-40438 (github_poc): https://github.com/BabyTeam1024/CVE-2021-40438
- Sigma-Rule-for-CVE-2021-40438-Attack-Attemp (github_poc): https://github.com/pisut4152/Sigma-Rule-for-CVE-2021-40438-exploitation-attempt

## Other vulnerabilities in Apache Http Server

- [CVE-2021-42013](https://insights.sbomify.com/CVE-2021-42013/): Apache HTTP Server Path Traversal (critical 9.8, exploited in the wild)
- [CVE-2024-38475](https://insights.sbomify.com/CVE-2024-38475/): Apache HTTP Server Improper Escaping of Output (critical 9.1, exploited in the wild)
- [CVE-2019-0211](https://insights.sbomify.com/CVE-2019-0211/): Apache HTTP Server Privilege Escalation (high 7.8, exploited in the wild)
- [CVE-2021-41773](https://insights.sbomify.com/CVE-2021-41773/): Apache HTTP Server Path Traversal (high 7.5, exploited in the wild)
- [CVE-2010-0425](https://insights.sbomify.com/CVE-2010-0425/): Use after free in n/a (critical 10.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-40438 and fix it if it is affected.

What it is: CVE-2021-40438 is a critical server-side request forgery vulnerability in Apache Http Server, published on 16 Sep 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2021-40438 in the wild since at least 1 Dec 2021, including in ransomware campaigns.

Affected packages and fixed versions:
- apache (Bitnami): affected all versions; fixed in 2.4.49

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-40438/ (Markdown: https://insights.sbomify.com/CVE-2021-40438/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-40438
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-40438
- OSV: https://osv.dev/vulnerability/CVE-2021-40438

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-40438/
Summaries are generated and may contain mistakes; the official description above is the record.
