Apache HTTP Server Path Traversal
CVE-2021-41773 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 2.4.49. 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
- Check which version of Apache HTTP Server you run against the affected versions below, and install the vendor's latest release.
- 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 2.4.49 | Not stated |
| Apache | HTTP Server | 2.4.49 | Not stated |
| Fedora Project | Fedora | 34; 35 | Not stated |
| Oracle | Instantis Enterprisetrack | 17.1; 17.2; 17.3 | Not stated |
| 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 | 7.5 | High | CISA (ADP) |
| CVSS 2.0 | 4.3 | Medium | NVD |
Official description
A flaw was found in a change made to path normalization in Apache HTTP Server 2.4.49. 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 is known to be exploited in the wild. This issue only affects Apache 2.4.49 and not earlier versions. The fix in Apache HTTP Server 2.4.50 was found to be incomplete, see CVE-2021-42013.
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
- 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
- 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/cpujan2022.htmlThird Party Advisory
Third-party and government advisories
- openwall.com/lists/oss-security/2021/10/05/2Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/07/1Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/07/6Mailing 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/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/16/1Mailing List, Third Party Advisory
- security.gentoo.org/glsa/202208-20Third Party Advisory
- security.netapp.com/advisory/ntap-20211029-0009/Third Party Advisory
- tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-apache-httpd-pathtrv-LAzg68cZThird Party Advisory
- cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2021-41773US Government Resource
Technical write-ups (may include proof of concept)
- packetstormsecurity.com/files/164418/Apache-HTTP-Server-2.4.49-Path-Traversal-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- packetstormsecurity.com/files/164418/Apache-HTTP-Server-2.4.49-Path-Traversal.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
- openwall.com/lists/oss-security/2021/10/08/1Exploit, Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2021/10/08/3Exploit, Mailing List, Third Party Advisory
Other references
- lists.apache.org/thread.html/r6abf5f2ba6f1aa8b1030f95367aaf17660c4e4c78cb2338aee18982f%40%3Cusers.httpd.apach…Mailing List
- lists.apache.org/thread.html/r7c795cd45a3384d4d27e57618a215b0ed19cb6ca8eb070061ad5d837%40%3Cannounce.apache.o…Mailing List
- lists.apache.org/thread.html/r98d704ed4377ed889d40479db79ed1ee2f43b2ebdd79ce84b042df45%40%3Cannounce.apache.o…Mailing List
- lists.apache.org/thread.html/rb5b0e46f179f60b0c70204656bc52fcb558e961cb4d06a971e9e3efb%40%3Cusers.httpd.apach…Mailing List
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
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
- 4.9 Medium severity
SonicWall Email Security Path Traversal Exploited
Spotted an error? Tell us.