Skip to content
XSS Disclosed report Intermediate

Stored xss via template injection

A stored cross-site scripting flaw existed in the account name field of a WordPress site, triggered through template injection when the name was rendered. An attacker could plant a payload in an account created with a victim's email address, and the victim would later recover that account with the payload still present, allowing the attacker to run script in the victim's session.

morningstar Follow

Originally disclosed on HackerOne

  • Triaged in 26 hours
  • Fixed in 5 months
  • Paid in 4 months
  • Disclosed after 5 months

Hello Sir , I found Stored XSS in https://mercantile.wordpress.org/ POC is attached . Steps to reproduce: 1.Login to your account. 2. Go to https://mercantile.wordpress.org/my-account/edit-address/ & fill details , press save & intercept this request in burp suit.

3.change name to {{constructor.constructor('alert(1)')()}} & forward request. as shown in screenshot. Xss will popup when you visit your account page.

Although its self XSS. but  following attack  scenario makes it useful.

Anyone can make account on https://mercantile.wordpress.org/ using someone else email id, Its not verifying whether its your email id or not. Lets consider "A" makes account with "B" persons email & by using this technique store XSS payload in its account. After that "B" wants account on mercantile.wordpress.org with same email. so rather creating account with new email, "B" person just do forget password & recover & recover his account. but xss payload is still there in his account so attacker "A" can access victim "B" account anytime. One more thing, even after changing name with https://mercantile.wordpress.org/my-account/edit-account/ setting payload is not removed its still there. so its make attack more sophisticated.

Thanks & Regards, Akshay

Attachments

XSSPOc.png
XSSPOc.png From the original on HackerOne
burpreq.png
burpreq.png

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

Impact

The report itself calls it self-XSS, but it could become an account takeover because an attacker can register with a victim's email, store the payload, and the victim later recovers that same account with the payload still active.

What the attacker needed

Attacker can register with victim's email; victim later recovers that account; victim visits the account page

How it was found

  1. Log in to the account.
  2. Open the edit-address page, fill in the details, save, and intercept the request.
  3. Replace the name with a template expression and forward the request.
  4. Visit the account page to see the script execute.

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.

Cross-site scripting (XSS) is when a website displays user-supplied text as if it were part of the page's code, so a malicious snippet runs in a visitor's browser. Here the name field was treated as a template, so a special expression in the name was evaluated and produced a script alert. Because the name is saved, the script runs every time the account page is viewed.

What is XSS?

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

More from WordPress

View all

The newest disclosed reports for this program.

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.