How I got JS Execution (DOM XSS) Via CSTI
A website reflected template expressions like {7*7} as 49, and the author found that the site used Vue.js, a client-side template engine. By injecting a crafted template expression, the author achieved JavaScript execution (DOM XSS) in the victim's browser.
A few months ago, I worked on a VDP on the HackerOne platform. I usually start my testing with passive and active recon to discover subdomains.
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 passed user-controlled input into a client-side template engine (Vue.js) without proper sanitisation, allowing template expressions to be evaluated as JavaScript.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable website, potentially stealing cookies or performing actions on behalf of the user.
What the attacker needed
Victim visits a crafted URL or page
How it was found
- Notice that the website reflects {7*7} as 49, indicating template evaluation.
- Identify that the site uses Vue.js, a client-side template engine.
- Inject a template expression to trigger an alert, such as {{alert(document.cookie)}}.
- If that fails, use the browser debugger to inspect the error and find the constructed function.
- Use the constructor property via a template expression to create and execute a function that shows an alert.
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.
Some websites use JavaScript frameworks like Vue.js to fill in parts of a page on your own computer (the client side). If the site takes text you type and treats it as a template instruction, an attacker can make the site run their JavaScript. This is called DOM XSS, and it lets the attacker run code in your browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.