Files
pbakaus_impeccable/extension
xiaolaiandGitHub 04709eadf0 security: use JSON.stringify for selector escaping in devtools panel (#93)
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.
2026-04-28 18:09:54 -07:00
..