Apache HTTP Server Path Traversal
CVE-2021-42013 is a critical-severity improper limitation of a pathname to a restricted directory vulnerability in Apache HTTP Server from Apache, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected Apache HTTP Server versions: Apache HTTP Server 2.4.49; Apache HTTP Server 2.4.50. The record does not name a fixed version, so check the vendor advisory. CISA added it to the Known Exploited Vulnerabilities catalogue on November 3, 2021, which means attacks have been observed in the wild, including in ransomware campaigns.
Attackers are already exploiting this vulnerability, according to CISA.
What to do
- Update Jd Edwards Enterpriseone Tools to 9.2.6.0 or a later version.
- Update Secure Backup to 18.1.0.1.0 or a later version.
- CISA's required action: Apply updates per vendor instructions.
- Read the advisory on httpd.apache.org for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Apache | Apache HTTP Server | Apache HTTP Server 2.4.49; Apache HTTP Server 2.4.50 | Not stated |
| Apache | HTTP Server | 2.4.49; 2.4.50 | Not stated |
| Fedora Project | Fedora | 34; 35 | Not stated |
| Oracle | Instantis Enterprisetrack | 17.1; 17.2; 17.3 | Not stated |
| Oracle | Jd Edwards Enterpriseone Tools | before 9.2.6.0 | 9.2.6.0 |
| Oracle | Secure Backup | before 18.1.0.1.0 | 18.1.0.1.0 |
| NetApp | Cloud Backup | Not specified in the record | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.8 | Critical | NVD |
| CVSS 3.1 | 9.8 | Critical | CISA (ADP) |
| CVSS 2.0 | 7.5 | High | NVD |
Official description
It was found that the fix for CVE-2021-41773 in Apache HTTP Server 2.4.50 was insufficient. An attacker could use a path traversal attack to map URLs to files outside the directories configured by Alias-like directives. If files outside of these directories are not protected by the usual default configuration "require all denied", these requests can succeed. If CGI scripts are also enabled for these aliased pathes, this could allow for remote code execution. This issue only affects Apache 2.4.49 and Apache 2.4.50 and not earlier versions.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Limitation of a Pathname to a Restricted Directory
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
How developers prevent this class of flaw
- For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid.
- Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth.
More Improper Limitation of a Pathname to a Restricted Directory vulnerabilities (CWE-22)
Timeline
- CVE record published.
- Added to CISA's Known Exploited Vulnerabilities catalogue.
- Deadline for US federal agencies to remediate, set by CISA.
- CISA published its SSVC assessment (exploitation: active, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- httpd.apache.org/security/vulnerabilities_24.htmlRelease Notes
Patches and release notes
- lists.apache.org/thread.html/r17a4c6ce9aff662efd9459e9d1850ab4a611cb23392fc68264c72cb3%40%3Ccvs.httpd.apache…Mailing List
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RMIIEFINL6FUIOPD2A3M…Release Notes
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WS5RVHOIIRECG65ZBTZY…Release Notes
- oracle.com/security-alerts/cpuapr2022.htmlThird Party Advisory
- oracle.com/security-alerts/cpujan2022.htmlThird Party Advisory
Third-party and government advisories
- jvn.jp/en/jp/JVN51106450/index.htmlThird Party Advisory
- packetstormsecurity.com/files/165089/Apache-HTTP-Server-2.4.50-CVE-2021-42013-Exploitation.htmlThird Party Advisory, VDB Entry
- openwall.com/lists/oss-security/2021/10/07/6Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/1Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/2Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/3Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/4Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/5Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/6Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/09/1Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/11/4Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/15/3Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/16/1Mailing List, Third Party Advisory
- security.gentoo.org/glsa/202208-20Third Party Advisory
- security.netapp.com/advisory/ntap-20211029-0009/Third Party Advisory
Technical write-ups (may include proof of concept)
- packetstormsecurity.com/files/164501/Apache-HTTP-Server-2.4.50-Path-Traversal-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- packetstormsecurity.com/files/164609/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- packetstormsecurity.com/files/164629/Apache-2.4.49-2.4.50-Traversal-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- packetstormsecurity.com/files/164941/Apache-HTTP-Server-2.4.50-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- packetstormsecurity.com/files/167397/Apache-2.4.50-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- povilaika.com/apache-2-4-50-exploit/Exploit, Third Party Advisory
Other references
Other vulnerabilities in Apache HTTP Server
- 8.1 High severity
- 8.8 High severity
- 7.3 High severity
- 8.1 High severity
- 7.5 High severity
- 7.5 High severity
Recent Improper Limitation of a Pathname to a Restricted Directory vulnerabilities
- 9.8 Critical severity
Apache HTTP Server Path Traversal Exploited
- 9.8 Critical severity
VMware vCenter Server File Upload Exploited
- 7.8 High severity
Microsoft MSHTML Remote Code Execution Exploited
- 8.8 High severity
SAP NetWeaver Unrestricted File Upload Exploited
- 5.3 Medium severity
- 9.8 Critical severity
Arcadyan Buffalo Firmware Path Traversal Exploited
Spotted an error? Tell us.