Skip to content
XSS Write-up Advanced

Chaining multiple vulnerabilities for credential stealing

The login form was vulnerable to Angular template injection, allowing an attacker to execute JavaScript in the victim's browser. By chaining with a CSRF token bypass and a separate XSS on another subdomain, the attacker could steal credentials when the victim logs in.

Bartłomiej Bergier Follow

Published on web.archive.org

Once upon a time in far, far hackalaxy…. there was a login form built with angular. This story is about how I managed to steal credentials using Angular template injection, post-based XSS, and CSRF protection bypass.

bergee, on web.archive.org

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

Impact

An attacker could steal user credentials by redirecting the login form submission to their own server, but the attack required a separate XSS on another subdomain and user interaction.

What the attacker needed

Victim visits malicious page; attacker has XSS on another subdomain; victim enters credentials

The fix

The application should sanitise user input to prevent Angular template injection and implement proper CSRF protection that cannot be bypassed by setting cookies from other subdomains.

How it was found

  1. Visit the login page and enter an Angular template expression as the username.
  2. Observe the expression is evaluated, confirming template injection.
  3. Use a more complex payload to execute JavaScript and trigger an alert.
  4. To bypass CSRF, fetch the login page to extract the form token and cookie token.
  5. Use an XSS on another subdomain to set the CSRF cookie for the target domain.
  6. Submit the login form with the injected Angular payload that changes the form action to the attacker's 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.

The login page used a framework called Angular that can evaluate expressions like {{7*7}}. The attacker found they could inject code that runs in the victim's browser. By combining this with another flaw that let them set a cookie, they could redirect the login form to their own server and capture the username and password.

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 Bartłomiej Bergier

View all

11 more disclosed reports, 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.