Cyber Risks · PortSwigger Research

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