mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
The inspectElement function previously used manual replace() chains to escape backslashes and single quotes in CSS selectors before passing them to chrome.devtools.inspectedWindow.eval(). This escaping was incomplete: selectors containing crafted sequences of special characters (backticks, newlines, Unicode escapes) could break out of the string literal and inject arbitrary JS into the inspected page context. JSON.stringify produces a properly escaped JS string literal that handles all special characters, eliminating the injection surface entirely.