Potential XSS vector in curl via unsanitized URL parameter handling
The report claims that curl's handling of URL input through glob_url() and urlnode->url may allow untrusted data to be processed insecurely, potentially leading to XSS. The author suggests an attacker could steal cookies, redirect victims, or execute code in a browser context, but no actual exploit is demonstrated.
- Disclosed after 2 months
Description Summary: During the analysis of the curl source code, a possible vector for Cross-Site Scripting (XSS) was identified through the glob_url() function and how URL input is handled via urlnode->url. Improper input validation or escaping could result in untrusted data being processed insecurely.
Affected version: Latest GitHub clone of curl/curl. Tested on: Kali Linux (VirtualBox) Version command:
curl -v
Steps To Reproduce: Clone the repository:
git clone https://github.com/curl/curl.git
cd curl
Search vulnerable code references:
grep -rn "glob_url" src/
grep -rn "urlnode" src/
grep -rn "strcpy" src/
Try payloads in real requests using encoded XSS strings:
curl "http://test.com?param=%3Cscript%3Ealert(1)%3C/script%3E" -w "%{url_effective}"
Observe the failure behavior and how the payload is processed or rejected (301 redirect, malformed input, reflected parts, etc.).
Supporting Material/References: Terminal output with code search and payload attempts:
glob_url() usage and unsafe patterns
Attempts to inject payloads with curl
Screenshots attached for reference
Impact
Impact If successfully exploited, this flaw could lead to XSS through insecure processing of user-controlled URLs. An attacker could:
Steal session cookies or tokens
Redirect victims to malicious sites
Execute code in the browser context
Perform phishing or social engineering attacks
This issue becomes critical in contexts where curl is embedded in user-facing applications, CLI tools processing user input, or CI pipelines consuming untrusted URLs.
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
Impact
The report claims this could lead to XSS in contexts where curl is embedded in user-facing applications or CI pipelines, but no working exploit or browser execution is shown.
What the attacker needed
Curl embedded in a user-facing application; untrusted URL input reaches curl
How it was found
- Clone the curl repository and enter the source directory.
- Search the source for glob_url, urlnode and strcpy references.
- Send a request with an encoded script tag in a URL parameter and print the effective URL.
- Observe how the payload is processed or rejected.
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.
Cross-site scripting (XSS) is when a program puts untrusted text into a web page without cleaning it, so a browser runs it as code. This report guesses that curl might do that with URLs, but it only shows searches and a test request, not a working attack. curl is a command-line tool, so it does not run inside a browser by itself.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.