@ai-ecoverse/slicc-browsers 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/fixture-server.mjs +7 -0
- package/guard-runner.mjs +609 -122
- package/guard-vectors.json +1716 -9
- package/package.json +5 -4
- package/protected-worker.mjs +511 -0
- package/schema/guard-vectors.schema.json +79 -0
package/README.md
CHANGED
|
@@ -183,9 +183,9 @@ It also offers `storageKey(key)` and `unparseable(text)`. A Go or Rust implement
|
|
|
183
183
|
|
|
184
184
|
## Guard vectors
|
|
185
185
|
|
|
186
|
-
A guard sits between a CDP client
|
|
186
|
+
A guard sits between a CDP client and the browser and keeps the client away from protected origins. `guard-vectors.json` holds the attacks every guard must pass: navigation, redirects, popups, frames, interception, cookies, storage, privileged and error pages, foreign worlds, debugger tricks and session overrides.
|
|
187
187
|
|
|
188
|
-
Each vector runs twice. The **control** runs
|
|
188
|
+
Each vector runs twice. The **control** runs against an ordinary origin and must work. The **guarded** leg runs through the guard against a protected target and must be refused or have no effect. A **liveness** check outside the guard proves the target was really there. All three must pass.
|
|
189
189
|
|
|
190
190
|
A guard may refuse every client navigation to an `about:` URL that inherits an origin, such as `about:blank`. Refusing an ordinary navigation away from a protected page still fails.
|
|
191
191
|
|
|
@@ -195,7 +195,7 @@ For stock Playwright, Puppeteer and raw CDP clients, a guard that declares `stoc
|
|
|
195
195
|
- `Page.addScriptToEvaluateOnNewDocument` whose `source` matches `^(?:[ \t\n]|//[^\n\r\u2028\u2029]*)*$` on the whole string without the multiline flag (no code), with any `worldName` or `runImmediately`, and its removal;
|
|
196
196
|
- exactly `Emulation.setFocusEmulationEnabled`, `setEmulatedMedia`, `setDeviceMetricsOverride` and `setTouchEmulationEnabled`;
|
|
197
197
|
- `Page.createIsolatedWorld` on a frame the guard already classifies as ordinary: strip `grantUniveralAccess` and `contentSecurityPolicy`, return no `executionContextId` for any other frame; `Runtime.addBinding` scoped to such a world by a non-empty `executionContextName` or its `executionContextId`, with `Runtime.bindingCalled` only from those worlds;
|
|
198
|
-
- `Target.setAutoAttach`:
|
|
198
|
+
- `Target.setAutoAttach`: either narrow the filter to tab targets or hide per target; no protected-origin page, iframe or worker (dedicated, shared or service) may reach the client; pages under the tab are held like pages (same URL redaction in `targetInfo`); a transport that synthesizes it declares `syntheticAutoAttach`.
|
|
199
199
|
|
|
200
200
|
The strip holds whether or not a given Chrome lets that world reach another origin. Code init scripts, main-world bindings and other overrides stay refused or harmless. Admitted display overrides and no-code init scripts must not remain in effect on a protected document — refuse that navigation, or clear them before it runs. Undeclared, they skip, never pass.
|
|
201
201
|
|
package/fixture-server.mjs
CHANGED
|
@@ -105,6 +105,13 @@ function route(req, url, send, html, redirects) {
|
|
|
105
105
|
'/csp': () => document(url, html),
|
|
106
106
|
'/sw.js': () =>
|
|
107
107
|
send(200, "self.addEventListener('install',()=>self.skipWaiting())", 'text/javascript'),
|
|
108
|
+
'/worker.js': () => send(200, 'onmessage=e=>postMessage(e.data)', 'text/javascript'),
|
|
109
|
+
'/shared-worker.js': () =>
|
|
110
|
+
send(
|
|
111
|
+
200,
|
|
112
|
+
'onconnect=e=>{e.ports[0].onmessage=m=>e.ports[0].postMessage(m.data)}',
|
|
113
|
+
'text/javascript'
|
|
114
|
+
),
|
|
108
115
|
};
|
|
109
116
|
if (req.method === 'OPTIONS') return send(204, '');
|
|
110
117
|
if (url.pathname.startsWith('/auth')) {
|