CVE-2021-41773 in apache http server
LogPulse has a published detection rule for this CVE: it raises a notable when someone tries to exploit it.
What the vulnerability is
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.
Affected software: apache http server, fedoraproject fedora, oracle instantis enterprisetrack, netapp cloud backup
Scores
- CVSS: 9.8 (critical)
- EPSS: 99.99% chance of exploitation in the next 30 days
- CISA KEV: Known exploited, listed 2021-11-03, used in ransomware
- Published: 2021-10-05
What LogPulse has for it
- Detection rule: Yes, published
- Agent check (vulnerable version): Yes, published
- Mitigation: Yes, see below
How to mitigate it
Upgrade Apache HTTP Server 2.4.49/2.4.50 to 2.4.51 or later (CVE-2021-41773, CVE-2021-42013)
Patch or upgrade. Apache HTTP Server 2.4.49 lets encoded dot segments reach files outside the configured directories and, with CGI enabled, run commands. Version 2.4.50 fixed it incompletely (CVE-2021-42013), so upgrade straight to 2.4.51 or later.
Applies to: Apache HTTP Server 2.4.49 (CVE-2021-41773) and 2.4.50 (incomplete fix, CVE-2021-42013). Earlier releases are not affected by this flaw.
- Find every Apache HTTP Server: run `httpd -v` or `apachectl -v` (Linux) or `httpd.exe -v` in the bin folder (Windows), including container images based on httpd:2.4.49 or httpd:2.4.50.
- Upgrade each server on 2.4.49 or 2.4.50 to 2.4.51 or later (current 2.4.x preferred): use the distribution package update, a newer Apache Lounge/XAMPP build on Windows, or rebuild containers from a current httpd:2.4 image.
- Until you can upgrade, make sure the root directory block denies access: `<Directory />` with `Require all denied`, and turn off mod_cgi/mod_cgid if you do not need CGI.
- Restart Apache and confirm with `httpd -v` that the version is 2.4.51 or later.
- Search the access logs for requests with `.%2e/` or `%%32%65` under /cgi-bin/ or /icons/ from before the upgrade, and investigate any with status 200.
Sources:
Source data: NIST NVD, CISA KEV and FIRST EPSS. LogPulse processes new CVEs every hour.
We build every detection with great care, but no two environments are the same. Log sources, parsing and configuration differ, so test a detection in your own environment before you rely on it.