moderate: Apache HTTP Server: mod_rewrite proxy handler substitution (CVE-2024-39573) CWE-20 Improper Input Validation
Apache HTTP Server versions up to 2.4.59 had an input validation flaw in mod_rewrite that could cause unsafe RewriteRules to unexpectedly route URLs to mod_proxy, and a related encoding problem in mod_proxy could send incorrectly encoded request URLs to backend services. An attacker could potentially bypass authentication or cause server-side request forgery (SSRF) through crafted requests.
Originally disclosed on HackerOne
- Fixed in 37 hours
- Paid in 37 hours
- Disclosed after 40 days
Summary by the program
###moderate: Apache HTTP Server proxy encoding problem (CVE-2024-38473)
Encoding problem in mod_proxy in Apache HTTP Server 2.4.59 and earlier allows request URLs with incorrect encoding to be sent to backend services, potentially bypassing authentication via crafted requests. This affects configurations where mechanisms other than ProxyPass/ProxyPassMatch or RewriteRule with the 'P' flag are used to configure a request to be proxied, such as SetHandler or inadvertent proxying via CVE-2024-39573. Note that these alternate mechanisms may be used within .htaccess.
Users are recommended to upgrade to version 2.4.60, which fixes this issue.
Acknowledgements: finder: Orange Tsai (@orange_8361) from DEVCORE
Reported to security team: 2024-04-01 fixed by r1918559, r1918666, r1918600, r1918625, r1918668 in 2.4.x: 2024-07-01 Update 2.4.60 released: 2024-07-01 Affects: 2.4.0 through 2.4.59
The report
I reported this vulnerability through the official Apache HTTP Server security email on April 1, 2024, and received a fix along with a CVE number on July 1, 2024. You can check detailed information from there:
Impact
Potential SSRF in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows an attacker to cause unsafe RewriteRules to unexpectedly setup URL's to be handled by mod_proxy.
Users are recommended to upgrade to version 2.4.60, which fixes this issue.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely improper input validation in mod_rewrite allowed crafted URLs to be handled by mod_proxy unexpectedly, and mod_proxy failed to correctly encode request URLs sent to backend services.
Impact
An attacker could potentially bypass authentication via crafted requests and cause SSRF when unsafe RewriteRules are used, though the text notes this affects only certain configurations.
What the attacker needed
Apache HTTP Server 2.4.0 to 2.4.59; unsafe RewriteRules or alternate proxy config
The fix
The issues were fixed in Apache HTTP Server version 2.4.60.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Apache is a web server that can forward some requests to other servers using a module called mod_proxy. A bug in how it checked rewritten URLs meant that certain rules could accidentally send requests to places they should not, and a related encoding bug could let attackers sneak past login checks or make the server fetch internal resources. Upgrading to version 2.4.60 fixes both issues.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.