You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restrict read-only CDP guard to an exact-method allowlist
The previous guard allowlisted whole domains (Page/Runtime/DOM/
Accessibility) plus a verb-regex blocklist, so executable Runtime
methods whose names carry no write verb — Runtime.callFunctionOn,
Runtime.runScript, Runtime.compileScript — passed isReadonlyCdpMethod
and could execute arbitrary page JavaScript while counting as
read-only.
Replace the domain+heuristic scheme with READONLY_CDP_METHODS, an
exact-method allowlist enumerating only the primitives the bridge
itself sends (Page.enable/navigate, Runtime.enable/evaluate,
DOM.enable, Accessibility.enable/getFullAXTree/getRootAXNode). No
domain or verb fallback remains; anything unenumerated is refused.
Runtime.evaluate stays enumerated because the bridge sends it with
bridge-owned constant snapshot expressions only — documented that the
guard does not validate expressions, so no path may forward external
expressions relying on this check alone.
READONLY_CDP_DOMAINS is retained as documentation; FORBIDDEN_CDP_METHODS
is retained as a test tripwire list. Adds regression tests: executable
Runtime methods and unenumerated read-y methods are refused, near-miss
spellings are refused, and every enumerated method is allowed.
0 commit comments