DOM Invader and the case of direct eval vs indirect eval
Summary: PortSwigger Research explains that DOM Invader, a browser extension for finding DOM-based XSS by instrumenting JavaScript functions, can cause sites to throw exceptions from eval when enabled but not when disabled. The cause is that instrumenting eval turns a direct call into an indirect one, so locally scoped variables the eval call depends on become unavailable and an exception is thrown; disabling instrumentation of eval restores its previous state but gives up finding vulnerabilities in eval calls.
Key Takeaway: A security tool that instruments eval can break the very application it is testing, because the change silently shifts direct eval to indirect eval and strips access to local scope - so a scanner finding or a site failure may reflect the instrumentation rather than the code.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026