Skip to content
XSS Write-up Intermediate

XSS BYPASS on Web Application with API via Possible Ways

The author demonstrates several cross-site scripting (XSS) vulnerabilities in OWASP Juice Shop, a deliberately insecure training application. An attacker could inject scripts through search fields, order tracking, API requests, profile updates, HTTP headers, and feedback forms to execute code in a victim's browser.

medium.com

Published on medium.com

OWASP Juice Shop is a deliberately insecure web application designed to educate users about common security vulnerabilities, particularly those listed in the OWASP Top 10. Among the most prevalent security threats is Cross-Site Scripting (XSS), where attackers inject malicious scripts into web pages viewed by other…

Aman Gupta, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application fails to properly sanitise or encode user input before inserting it into web pages, and some client-side or server-side filters can be bypassed.

Impact

An attacker could execute arbitrary scripts in victims' browsers, potentially stealing data, hijacking sessions, or performing actions on their behalf.

What the attacker needed

Access to the Juice Shop application; Ability to submit input in various fields; A victim to view the injected content

The fix

The application should properly sanitise and encode all user input, use a strong Content Security Policy, and apply sanitisation recursively.

How it was found

  1. Enter a crafted iframe payload in the search bar to trigger DOM XSS.
  2. Place an order and then track it, injecting a payload into the order ID field to trigger reflected XSS.
  3. Use an HTTP tool to send a PUT request to the product API, altering the description with a stored XSS payload.
  4. Register a new account and submit a payload through the registration form to bypass client-side protection.
  5. Update the profile page with a crafted payload that bypasses the CSP, then visit the profile to trigger the alert.
  6. Send a request to the logout page with a malicious True-Client-IP header to trigger HTTP-header XSS.

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 write-up has not been written yet. The Original tab links to the source.

Cross-site scripting (XSS) is when a website lets an attacker sneak harmful code into pages that other people view. The code runs in the victim's browser and can steal their data or do things on their behalf. This article shows many ways that can happen in a practice app built to be unsafe.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

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.