Skip to content
XSS Write-up Intermediate

From {{3*3}} to $$: One Payload Changed Everything

A form-builder header field evaluated user input as a server-side template, so a probe expression returned a computed value instead of being reflected. The hunter then achieved JavaScript execution in the victim's browser and used it to call internal API endpoints with the victim's session and send the responses to an external server.

kartik001 Follow

Published on kartik001.medium.com

Hi, I’m Kartik — a bug bounty hunter who enjoys turning simple findings into real-world impact.

Kartik Garg, on kartik001.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 form-builder header field passed user input into a server-side template without sanitisation, and the template context also allowed construction and execution of JavaScript.

Impact

Anyone who opened the form, including admins, could have their session used to silently read internal API data and have it exfiltrated to an attacker-controlled server, without interaction or visible change.

What the attacker needed

A custom form with a header field; victim opens the crafted form

How it was found

  1. Find the custom form feature and its dynamic header field
  2. Submit a simple arithmetic template expression and confirm the response contains the computed result
  3. Try code-execution and object-traversal payloads, which did not work
  4. Try alternative payload variations until a JavaScript alert fired
  5. Craft a payload that fetches internal API endpoints with the victim's credentials and sends the encoded response to an external server
  6. Have a user or admin open the form and observe data arriving at the attacker server

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 template engine is software that fills in placeholders in a page, and if it treats your text as instructions rather than plain text, it will run it. Here a small arithmetic expression came back as the answer, which showed the server was running the input. The hunter then found a way to make the page run JavaScript, the language browsers use, and used that to read data the victim could see and send it elsewhere.

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.