Abusing URL Parsers by long schema name
The curl library's URL parser mishandles long scheme names, causing a mismatch between the scheme and the host. An attacker could bypass a whitelist and perform server-side request forgery against internal infrastructure.
- Disclosed after 36 days
Summary:
There is known technique to exploit inconsistency of URL parser and URL requester logic to perform Server Side Request Forgery attack. Firstly it was presented by Orange Tsai at A New Era Of SSRF Exploiting URL Parser. Firstly I found the familiar issue at old versions of curl, but exploit did not seems works at latest releases. But now I'm ready to share new exploit of issue.
Steps To Reproduce:
Schema parser logic of curl library is vulnerable to "Abusing URL Parsers". Malicious user can use this weakness to bypass whitelist protection and perform Server Side Request Forgery against targets, that use vulnerable version of library.
- curl "ssrf3.twowaysyncapp.tk://google.com" Protocol "ssrf3.twowaysyncapp.tk" not supported or disabled in libcurl
- curl "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.twowaysyncapp.tk://google.com" Host aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.twowaysyncapp.tk requested
Supporting Material/References:
Details about attack presented at https://btlfry.gitlab.io/owasp/#/21 The main difference at new version of library subdomain name should be much longer.
- F1102530
Impact
Incorrect schema parser logic will allow malicious user to bypass protection mechanism and get access to the internal infrastructure of affected web servers.
Attachments

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 the URL parser does not correctly handle very long scheme names, leading to a mismatch between the parsed scheme and host.
Impact
An attacker could bypass a whitelist and access internal infrastructure of affected web servers.
What the attacker needed
Vulnerable version of curl library; attacker can control a URL
How it was found
- Run curl with a short custom scheme and a host; curl reports the protocol is not supported.
- Run curl with a very long custom scheme and a host; curl treats the long scheme as the host and makes a request.
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.
A URL has a scheme (like http) and a host (like example.com). The curl tool decides which protocol to use based on the scheme. This report shows that if the scheme name is very long, curl can get confused and treat part of the scheme as the host, which might let an attacker reach internal systems that should be blocked.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.