Skip to content
XSS Disclosed report Beginner

Reflected XSS in the npm module express-cart.

The 'Product option' field in the express-cart admin product form accepted unsanitised input, and a script payload placed there was reflected and executed in the browser.

avi3719 Follow

Originally disclosed on HackerOne

Medium 4.8 View original
  • Triaged in 2 months
  • Fixed in 5 months
  • Disclosed after 6 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 Reflected XSS in the npm module express-cart. It allows a user to insert malicious payload in the user input field and the script gets reflected in the browser

Module

module name: express-cart version: 1.1.5 npm page: https://www.npmjs.com/package/express-cart

Module Description

expressCart is a fully functional shopping cart built in Node.js (Express, MongoDB) with Stripe, PayPal, and Authorize.net payments.

Module Stats

[27] downloads in the last week

Vulnerability

Vulnerability Description

when the admin user creates a request for a new product, then the field 'Product option' accepts any malicious user input. This lead me to identify the reflected XSS attack.

Steps To Reproduce:

  1. Login with admin user credentials.
  2. From Left Menu panel, select new under product tab
  3. In 'product options' details, insert any javascript payload eg. <script>alert(1234)</script>
  4. The reflected XSS in the form of an alert box will be pop up in a browser window.

Supporting Material/References:

l technical information about the stack where the vulnerability was found

  • OS used Windows 10
  • NODEJS VERSION - V8.11.3
  • NPM VERSION - 5.6.0
  • Browser - Chrome 68.0.3440.106

Wrap up

  • I contacted the maintainer to let them know: [N]
  • I opened an issue in the related repository: [N]

Impact

This vulnerability would allow a user to insert javascript payloads which can be reflected in a browser.

Attachments

2.png
2.png From the original on HackerOne
1.png
1.png

The original report as published on HackerOne, by avi3719. 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 the product option value was rendered into the response without output encoding or input sanitisation.

Impact

This could allow a user to insert JavaScript payloads that are reflected and executed in a browser, though the report only demonstrates an alert box and requires an admin to submit the payload.

What the attacker needed

Admin user credentials; attacker submits payload via product form

How it was found

  1. Log in with admin user credentials.
  2. From the left menu panel, select new under the product tab.
  3. In the product options details, insert a JavaScript payload.
  4. The reflected XSS appears as an alert box in the browser window.

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) happens when a website takes something a user typed and puts it back into the page without cleaning it first. Here, a product option field echoed the input straight back, so a script tag ran as code in the browser instead of showing as text.

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 Node.js third-party modules

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.