Locking down untrusted JavaScript after it loads transcend.io · 12 points · 3 co...
HN Best 200 @best
Locking down untrusted JavaScript after it loads transcend.io · 12 points · 3 comments · HN thread
TL;DR Transcend, a consent-management vendor, argues that a Content Security Policy alone can't stop a trusted third-party script that turns malicious after load, and promotes its browser script airgap.js as a runtime layer. The article walks through a fictional Black Friday checkout skimming attack, showing four exfiltration attempts and which control stops each one. It ends by listing where Airgap's coverage stops and pitching a pilot.
- A CSP is a static host allowlist; it does not see what an approved script does after it loads, and does not govern navigations.
- Airgap is installed as one script tag that runs before other scripts and checks requests, inserted scripts, cookies and navigations at runtime.
- The Unknown Request Policy set to Block stops calls to hosts nobody classified; a CSP generated from data flows stops a background-image exfiltration.
- Navigation control, via the browser's Navigation API, cancels a redirect to a lookalike site; without that API it only covers form submissions and window.open().
- A fourth attempt sent data to an approved analytics host; only consent state and a custom override, not the host allowlist, stop it.
- The article lists its own limits: no behavioral analysis on allowed hosts, inline script and eval allowed in the generated CSP, and no direct CSS/SVG regulation without strict CSP.
Discussion The thread is short, with three comments. The top comment is from a self-identified Transcend CTO who frames the issue as assuming breach in your own script tags, citing a recent Optimizely incident and Magecart-style campaigns, and links the Airgap documentation. A reply from the creator of airgap.js welcomes browser APIs that can cancel navigations and notes a use case in Electron. The other comment is a brief remark that navigation hijacking is hard to follow for people who don't know what they are looking at. Overall the mood is promotional and mostly echoes the vendor's own position, with little independent pushback.
- Assume breach, even in your own script tags (some): The vendor's CTO argues that trusted vendor scripts can be compromised, citing a recent Optimizely injection incident that targeted card details and crypto transfers. He presents runtime control as necessary given that threat.
- Browser navigation control is a welcome advance (a few): The airgap.js creator says modern browser APIs now allow intercepting and cancelling unwanted navigations, which also helps niche Electron apps where navigations are privileged. The comment discloses the author's role in the tool.
- Navigation hijacking is hard to follow (a few): One commenter notes that navigation-based attacks are difficult to recognize unless the reader already understands what the browser is doing. No further detail or dispute is offered.
Links from the comments
- Transcend documentation overview of the security controls, linked by the CTO
- Documentation on stopping exfiltration through navigation
- Example repository for the Airgap security demo
#csp #browserSecurity #magecart #webSecurity #consentManagement