CVE-2024-38428 Wget Vulnerability: All you need to know
Wget misparses the userinfo part of a URL when it contains a semicolon, causing the host to be interpreted incorrectly. An attacker who controls the userinfo can redirect FTP/FTPS requests to a malicious host, enabling SSRF, phishing, or man-in-the-middle attacks.
Published on jfrog.com
On Sunday, June 2nd 2024, a fix commit was pushed for a vulnerability in GNU’s popular Wget tool. Two weeks later, the vulnerability was assigned the ID CVE-2024-38428 and later was classified as a critical vulnerability – with a CVSS score of 9.1.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the URL parser treats a semicolon as a host terminator even inside the userinfo, contrary to RFC 2396, so the host is taken from the userinfo.
Impact
An attacker could perform SSRF, phishing, man-in-the-middle attacks, or data leakage, potentially leading to resource restriction bypass, sensitive information exposure, or malware installation.
What the attacker needed
Attacker controls userinfo in URL; Wget version ≤ 1.24.5; FTP or FTPS protocol used
The fix
The vulnerability should be fixed by not treating a semicolon as a host terminator inside userinfo, or by disallowing semicolons in userinfo; some Linux distributions have provided fixes.
How it was found
- Identify an application that uses Wget to fetch FTP or FTPS URLs and lets the user control the userinfo part.
- Craft a username that includes a semicolon and the attacker's domain name.
- Supply a URL where the userinfo contains the crafted username and the host is a trusted server.
- Wget parses the URL and sends the request to the attacker's domain instead of the trusted server.
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 write-up has not been written yet. The Original tab links to the source.
Wget is a tool for downloading files from the internet. A URL has a part called 'userinfo' that can contain a username, and a part called 'host' that says which server to contact. Wget confused these two parts when the username contained a semicolon, so it could end up contacting a different server than the one written after the '@' sign.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.