Skip to content
XSS Write-up Beginner

Story Of Stored Xss

The 'Reason for Visit' field allowed HTML injection and stored a link with a javascript: URL, which executed script when clicked. An attacker could store a payload that runs in the context of a user who views the appointment, potentially stealing cookies.

Gajendra Follow

Published on systemweakness.com

I’m Gajendraworking as Penetration Tester. Today I am going to share how I found Stored Cross-Site Scripting (XSS).

Gajendra, on systemweakness.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 blacklisted only the word 'script' instead of properly encoding or sanitising user input, allowing other HTML and javascript: URLs.

Impact

An attacker could store a link that, when clicked by a user viewing the appointment, executes script in that user's browser and could access cookies.

What the attacker needed

A normal user account; victim clicks the stored link

How it was found

  1. Log in as a normal user and start booking an appointment.
  2. Fill in the required details such as doctor name and time slot.
  3. Enter special characters in the 'Reason for Visit' field and observe they are reflected as-is.
  4. Try a script tag payload, which is rejected because 'script' is blacklisted.
  5. Try an HTML injection payload, which executes in the response.
  6. Use an anchor tag with a javascript: URL in the field, which is stored successfully.

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.

A stored cross-site scripting (XSS) bug lets an attacker save malicious code in a website, so it runs later in another person's browser. Here, a text box accepted HTML, and a link with a javascript: address ran code when clicked.

What is XSS?

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

More by Gajendra

View all

1 more disclosed report, best first.

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.