Skip to content
XSS Disclosed report Advanced

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.

redfoxsec Follow

Originally disclosed on HackerOne

  • 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

curl_poc_combined.jpg
curl_poc_combined.jpg From the original on HackerOne
17459739859212994623293594568921.jpg
17459739859212994623293594568921.jpg
17459739370401280908417306382914.jpg
17459739370401280908417306382914.jpg
17459740127977524118070527789321.jpg
17459740127977524118070527789321.jpg
17459739156244733383455011964397.jpg
17459739156244733383455011964397.jpg

The original report as published on HackerOne, by redfoxsec. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Clone the curl repository and enter the source directory.
  2. Search the source for glob_url, urlnode and strcpy references.
  3. Send a request with an encoded script tag in a URL parameter and print the effective URL.
  4. 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.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.