Skip to content
XSS Disclosed report Beginner

runs javascript on powershell when it shouldnt

On Windows, running curl in PowerShell against a URL that returns a script tag caused a JavaScript alert window to appear, even though curl should only fetch and print the response. The reporter also found the process hung while the alert was open, so it could potentially stall PowerShell scripts.

lim_e Follow

Originally disclosed on HackerOne

  • Disclosed after 2 hours

On windows, if I run a curl on powershell for a script that should show <script>alert(1)</script> it just executes the script when it shouldn't.

I did not use AI to find or report this bug.

Affected version

on CMD I ran curl --version curl 8.16.0 (Windows) libcurl/8.16.0 Schannel zlib/1.3.1 WinIDN on powershell it didn't recognise the --version flag. I haven't installed any specific curl version on this computer so it should be the default one that comes and gets updated with windows 11.

Steps To Reproduce:

  1. host an endpoint that will return <script>alert(1)</script> (in this case ctf.eztfsp.lv:8009/test.js)
  2. open powershell
  3. on powershell run curl ctf.eztfsp.lv:8009/test.js
  4. it opens a a window that states "message from webpage 1"

Supporting Material/References:

I've attached a .gif where I demonstrate how it works on powershell and how it works on CMD

  • [attachment / reference]

Impact

Summary:

  1. run javascript on powershell curl.
  2. It also hangs the process, I wasn't able to control+c to stop the curl process while the alert window was open, so it could potentially be used to hang powershell scripts.

Attachments

curl_powershell_issue_smaller.gif
curl_powershell_issue_smaller.gif From the original on HackerOne

The original report as published on HackerOne, by lim_e. 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

Root cause

Likely PowerShell's curl behaves differently from CMD's curl, executing the fetched script rather than printing it.

Impact

A script tag in a fetched page could run in a pop-up and hang the PowerShell process, potentially stalling scripts.

What the attacker needed

Windows with PowerShell; attacker-controlled URL; user runs curl in PowerShell

How it was found

  1. Host an endpoint that returns a script tag.
  2. Open PowerShell.
  3. Run curl against that endpoint.
  4. Observe a pop-up window appear.

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.

PowerShell is a command-line shell on Windows. The reporter ran curl in PowerShell against a page returning a script tag and got a pop-up running the script instead of plain text output.

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.