- Critical Thinking - Bug Bounty Podcast
- Posts
- [HackerNotes Ep. 201] AngularJS Sandbox Escapes, CSS Exfiltration, and Browser Weirdness with Gareth Heyes
[HackerNotes Ep. 201] AngularJS Sandbox Escapes, CSS Exfiltration, and Browser Weirdness with Gareth Heyes
Gareth Heyes on the curiosity, persistence, and luck behind browser bugs, parser differentials, DOM clobbering, and CSS attacks that turn small inconsistencies into serious impact.
Hacker TL;DR
A strange cross-domain property led from a tiny browser bug to environment poisoning, AngularJS sandbox escapes, and arbitrary JavaScript execution.
DOM clobbering, relative path overwrite, and email parser differentials all exploit the same broad weakness: different components disagree about what an input means.
CSS injection is not just visual. Selectors, pseudo-elements, mutation, and external requests can hide instructions, redirect clicks, and exfiltrate data.
The best research workflow is still curiosity plus persistence, supported by tools such as Shazzer and Hackvertor that make weird behavior easier to reproduce.

Sponsored by ThreatLocker – Zero Trust AI Control
Start with the property nobody thought to remove
The first bug is a perfect example of why browser security research rewards curiosity. In old Internet Explorer contexts, a cross-domain window reference exposed a closed property. The property was supposed to be a harmless Boolean, but it still carried a constructor chain:
newWin.closed.constructor.constructor("alert(1)")()The important observation was not just that a constructor existed. It was reachable through a property available across an origin boundary, including frames and newly opened windows.
That discovery led Gareth to write enumerators for similar properties. When a constructor could evaluate 1 + 1 but could not directly access window or document, he asked whether the execution environment itself could be poisoned.
Instead of running the attacker's code directly, overwrite a function that the application already trusts. If [].join or another common function becomes malicious, normal application code can trigger the payload later. The browser does not need to grant the injected code full access immediately. It only needs to let the attacker alter something that trusted code will eventually call.
This line of thinking eventually fed into the AngularJS sandbox work, where parser confusion and modified string methods such as charAt could make the sandbox interpret an expression differently from the browser.
When a primitive gives you less access than expected, do not stop at direct execution. Ask whether you can change the environment so that legitimate code executes your behavior for you.
The same bug pattern appears in DOM clobbering
DOM clobbering is another case where the browser constructs a surprising object from ordinary HTML. Matching id or name values can form collections that shadow globals, expose array-like members, or remove properties the application assumes are methods.
That matters because modern JavaScript often uses convenient fallbacks:
const config = window.config || defaultConfig; If an attacker can control window.config through markup, the code path changes before the application reaches its intended validation. The interesting sink may be several operations later, hidden behind a property chain or a feature check.
Dom Invader can identify common clobbering assignments, but manual review still matters. Search for global reads, || fallbacks, object chains, and code that assumes a property is native. Model the whole chain, not just the first clobbered name.
Relative Path Overwrite: why did one slash break the CSS?
Relative Path Overwrite started with a small observation: adding a slash to a URL caused a page's styles to break. DevTools showed that relative stylesheet paths were being resolved against the current page and returned a successful response.
If an attacker can inject persistent text into that response, the page can become a stylesheet context. Historically, this created particularly severe impact in Internet Explorer because CSS expressions could execute script. The browser behavior is old, but the research lesson remains useful:
Change the URL shape.
Watch which resources are resolved differently.
Inspect successful responses, not only errors.
Ask whether attacker-controlled text is now interpreted in a new context.
This is the same parser-differential mindset as the email research. The application, URL resolver, browser, and sanitizer do not necessarily agree on where one document ends and another begins.
We do subs at $25, $10, and $5, premium subscribers get access to:
– Hackalongs: live bug bounty hacking on real programs, VODs available
– Live data streams, exploits, tools, scripts & un-redacted bug reports
Need a Pentest? We just launched CTBB Pentests!
Hack full time? Check out the Full-Time Hunter’s Guild!
Splitting the email atom
Email validation is a rich source of parser differentials because one address passes through application regexes, libraries, mail transfer agents, and sometimes external services.
Gareth's research moved from a permissive local-part character set to delivery behavior that did not match validation. A bang path could make an address that looked like it belonged to one domain route through another. Encoded words introduced another discrepancy: validation treated the address as example.com, while a downstream parser split it so delivery reached a different domain.
Do not memorize one payload. Build a differential test matrix and compare:
what the application accepts;
what it stores;
what the mail library serializes;
what the receiving server interprets; and
where the message actually arrives.
When a parser behaves strangely, that result is valuable even before it becomes account takeover. The discrepancy tells you which trust boundary deserves deeper testing.
CSS is an attack surface, not decoration
The most recent research applies Gareth's front-end experience to webmail and AI interfaces. He built a CSS-only 3D environment to force himself to learn the language deeply, then reused those techniques for security research.
The first important primitive is ::before and ::after. Generated content can be visible to a human while absent from an AI system's text extraction path. Conversely, DOM content can be hidden from the user while available to an automated parser. Impact depends on how the application builds model context, so inspect the boundary between rendered UI and model input.
CSS can also become a data channel. Attribute selectors, nested selectors, conditional requests, and carefully chosen fragments can reveal page values through external requests. Gareth describes collecting overlapping chunks instead of brute-forcing a long token in one selector. Follow-up research demonstrated reconstruction of tokens hundreds of characters long, including a 640-character case under the tested budget.
Other techniques discussed include:
CSS mutations where escaped characters are decoded differently by the CSSOM and a sanitizer;
pseudo-elements that inherit click behavior and can cover an interface, a technique Gareth calls CSS hotwiring;
label and form-element behavior that turns a visual interaction into an unintended action; and
password-stealing UI overlays when a sanitizer permits enough control over the page.
The impact is often dismissed because the victim has to open an email or click. Opening a message is normal application behavior. Ask what the modified page can make the victim do, and whether that exposes credentials, changes account state, or authorizes a dangerous workflow.
Pro Tip: For CSS injection, document the rendering context, allowed selectors, external-request behavior, token stability, and required interaction. "CSS injection" is only the beginning of the report.
Build tools that preserve the weirdness
Shazzer is a shared browser fuzzing engine for templates that execute HTML and JavaScript, vary properties, and collect behavior from multiple researchers. Gareth's collections make experiments reusable instead of leaving them as private payloads.
Hackvertor lets researchers chain encoders, decoders, and custom tags while experimenting with parser boundaries. The value is making each mutation explicit and comparable.
The workflow is worth copying:
Find a behavior that looks wrong.
Reduce it to the smallest reproducible test.
Fuzz one variable at a time.
Run it across browsers and parsing layers.
Save the collection so someone else can reproduce it.
Follow it into a real impact path.
That is hacker intuition in practical terms: curiosity, persistence, and enough luck to notice the anomaly.
The luckiest bug report
The episode ends with a reminder that not every access path requires a complicated exploit. During the COVID period, Gareth received a Trello invitation that appeared related to an emergency-response project. It turned out that somebody with the same name had invited him to a government board by mistake.
He added a card explaining the mistake and left. Sometimes the most important security lesson is that identity, naming, and invitation workflows are attack surfaces too.
Resources
Gareth Heyes - portfolio and research hub.
JavaScript for Hackers - practical JavaScript security material.
Shazzer and its CSS collection - shared browser fuzzing.
AngularJS sandbox research and CSS: The Bomb Inside Your Inbox - browser and webmail research.
Inline style exfiltration, Smashing the Token Limit, and Splitting the email atom - CSS and email parser differentials.
DOM clobbering, Relative Path Overwrite, and XSSDoctor's Fuzzer - historical research and tooling.
That's it for the week, keep hacking!
