Skip to content
CSRF Disclosed report Beginner

CSRF - Adding/Removing items to cart - shop.khanacademy.org

The cart update endpoint on shop.khanacademy.org lacked CSRF protection, allowing an attacker to add or remove items from a victim's cart by tricking them into submitting a crafted form. The attacker could set quantities to zero to remove items or increase quantities to add new items.

internetwache Follow

Originally disclosed on HackerOne

  • Disclosed after 30 days

Hi there,

I've discovered a possiblity to remove/add items to a users' cart at shop.khanacademy.org.

###Details

- Host: shop.khanacademy.org
- URL: http://shop.khanacademy.org/cart
- Affected parameters: updates[PRODUCTID]

###Steps to reproduce

<html>
  <body>
    <form action="http://shop.khanacademy.org/cart" method="POST">
      <input type="hidden" name="updates&#91;211669705&#93;" value="1" />
      <input type="hidden" name="update" value="Update&#32;quantities" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>
    1. Take a look into your cart again
    1. There should be a new item.

An attacker can set the quantity to zero to remove an item or increase / add new items to the cart.

###How to fix? You should add a CSRF token to the form.

Best regards, Sebastian Neef

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

The cart update form lacked a CSRF token, so forged requests could update the cart.

What the attacker needed

Victim visits attacker's page; victim has an active session

How it was found

  1. Visit the cart page and empty your cart.
  2. Run the provided CSRF proof-of-concept form.
  3. Check your cart again.
  4. A new item should 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.

When you add something to a shopping cart on a website, your browser sends a request to the site. If the site doesn't check that the request actually came from its own pages, another website can secretly make your browser send that request for you. This is called CSRF (Cross-Site Request Forgery). Here, an attacker could make your browser add or remove items in your cart without you knowing.

What is CSRF?

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

More by internetwache

View all

10 more disclosed reports, best first.

More from Khan Academy

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.