Skip to content
XSS Write-up Intermediate

Escaping the Sandbox: Client-Side Template Injection (CSTI) via O

The Ecwid API Playground used an outdated AngularJS version (1.3.15) whose expression sandbox could be escaped, allowing an attacker to execute arbitrary JavaScript in the browser. This could lead to reflected cross-site scripting, session token theft, or UI redressing.

Mustafa Follow

Published on medium.com

In this write-up, I will share my findings regarding a Client-Side Template Injection (CSTI) vulnerability I discovered while hunting on the Ecwid API Playground. The vulnerability stems from the use of an outdated version of the AngularJS library.

Mustafa, on 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 application loaded a known-vulnerable version of AngularJS (1.3.15) whose expression sandbox could be bypassed, enabling arbitrary JavaScript execution.

Impact

Although rated informational, the vulnerability could enable reflected XSS to steal session tokens or OAuth keys, and allow UI redressing.

What the attacker needed

Victim visits a crafted URL; outdated AngularJS 1.3.15 loaded

The fix

The application should update AngularJS to a modern or patched version and implement a strict Content Security Policy.

How it was found

  1. Inspect the target page and note the AngularJS version loaded from a CDN.
  2. Craft a payload that escapes the AngularJS expression sandbox.
  3. Inject the payload to execute JavaScript such as 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.

AngularJS is a JavaScript framework that lets web pages use special expressions like {{...}} to display data. Older versions tried to block dangerous JavaScript inside those expressions with a 'sandbox', but researchers found ways to break out. Here, the outdated version allowed an attacker to run their own JavaScript in the victim's browser, which is called cross-site scripting (XSS).

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.