[node-red] Stored XSS within Flow's - "Name" field
The flow name field in Node-RED did not sanitise user input, allowing stored cross-site scripting. An attacker could inject JavaScript that executes when a user double-clicks the flow, potentially stealing session cookies or defacing the application.
Originally disclosed on HackerOne
- Triaged in 31 hours
- Fixed in 4 months
- Disclosed after 5 months
NOTE! Thanks for submitting a report! Please replace all the [square] sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!
I would like to report Stored XSS in node-red. It allows to steal session cookies, deface web applications, etc.
Module
module name: node-red
version: 0.20.7
npm page: https://www.npmjs.com/package/node-red
Module Description
A visual tool for wiring the Internet of Things.
Module Stats
Replace stats below with numbers from npm’s module page:
Weekly downloads - 23,557
Vulnerability
Vulnerability Description
npm-red has flows to demonstrate the Inject, Debug and Function nodes, etc and you can define multiple flows. For your customization, when renaming the flow - malicious javascript can be inserted into the "Name" field and Click "Done". Then after clicking the "Deploy" button, changes will take effect. Then Everytime you double-click the flow, inserted malicious code will be executed.
Steps To Reproduce:
install node-red: sudo npm install -g --unsafe-perm node-red start node-red: node-red & Open http://localhost:1880
- Now Edit the flow (refer img_1.png)
- Insert malicious javascript code and click "Done" (refer img_2.png)
- Click Deploy and changes will take place.
- Double click on flow and you'll observe a pop-up executing the malicious content (refer img_3.png)
Patch
Deploy input sanitization/validation around the input fields.
If you're able to provide a patch with the fix please post it in this section
Supporting Material/References:
State all technical information about the stack where the vulnerability was found
- Kali linux
- Node.js v12.8.0
- NPM v6.10.2
- Firefox 60.8.0esr
- Burpsuite, if there would have been client side validation
Wrap up
Select Y or N for the following statements:
- I contacted the maintainer to let them know: N
- I opened an issue in the related repository: N
Impact
This vulnerability will allow the attacker to steal session cookies, deface web applications, etc.
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 flow name was rendered into the page without proper output encoding or sanitisation, allowing injected JavaScript to execute.
Impact
An attacker could steal session cookies and deface the web application, but the report does not demonstrate these actions beyond a pop-up.
What the attacker needed
Access to Node-RED editor; ability to edit and deploy flows
How it was found
- Install and start Node-RED, then open the editor in a browser.
- Edit a flow and enter malicious JavaScript in the flow's Name field.
- Click Done to save the name.
- Click Deploy to apply the changes.
- Double-click the flow to trigger the stored script.
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.
Node-RED is a tool for connecting devices and services visually. The name you give to a flow (a group of connected nodes) was not checked for harmful code. If someone put JavaScript code in that name, it would run in the browser of anyone who later opened that flow, which could let the attacker take over the user's session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.