@ai-ecoverse/slicc-browsers 1.8.0 → 1.8.2
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 +13 -7
- package/catalog.json +8 -1
- package/guard-runner.mjs +22 -10
- package/guard-vectors.json +85 -1
- package/package.json +2 -2
- package/protected.json +28 -0
- package/schema/guard-vectors.schema.json +2 -0
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ Every feature builds for `wasm32-wasip1`.
|
|
|
94
94
|
- `discardExceptions`: where the site pattern and the extra origins' hosts go, as a `list` of strings or as a `chrome-time-map`, a map from site to the time it was added (microseconds since 1601-01-01 UTC, as a decimal string);
|
|
95
95
|
- `cleanExit`: values that mark the last exit clean;
|
|
96
96
|
- `form` says where a key comes from: `six` (SLICC six's keys) or `chrome-154` (what Chrome 154 reads).
|
|
97
|
-
- `protectedOrigins`: what browser control must never reach, see [Protected origins](#protected-origins). `domains` (`sliccy.ai`), `hosts` (`vault.sliccy.ai`), `schemes` (`https`, `http`), `innerSchemes` (`blob`, `filesystem`, `view-source`), `anySchemes` (`devtools`), `protectedSchemes` (`chrome`, `chrome-untrusted`, `chrome-extension`, `devtools`, `edge`, `brave`, `opera`, `vivaldi`, `arc`, `file`) with `schemeExceptions` (`chrome://newtab`, `edge://newtab`, `brave://newtab`, `opera://startpage`), `aboutScheme` (`chrome`), `targetTypes` (`browser_ui`), `inheriting` (`about:blank`, `about:srcdoc`), and `refusal`, the text of a refusal.
|
|
97
|
+
- `protectedOrigins`: what browser control must never reach, see [Protected origins](#protected-origins). `domains` (`sliccy.ai`), `hosts` (`vault.sliccy.ai`), `schemes` (`https`, `http`), `innerSchemes` (`blob`, `filesystem`, `view-source`), `anySchemes` (`devtools`), `protectedSchemes` (`chrome`, `chrome-untrusted`, `chrome-extension`, `devtools`, `edge`, `brave`, `opera`, `vivaldi`, `arc`, `file`) with `schemeExceptions` (`chrome://newtab`, `chrome://new-tab-page`, `chrome-untrusted://new-tab-page`, `edge://newtab`, `brave://newtab`, `opera://startpage`), `aboutScheme` (`chrome`), `targetTypes` (`browser_ui`), `inheriting` (`about:blank`, `about:srcdoc`), and `refusal`, the text of a refusal.
|
|
98
98
|
- `profiles`: SLICC profiles live in `<config dir>/<root>/<name>`, and a snap's in `~/snap/<snap>/common/<snapRoot>/<name>`. `legacyRoot` is the old root, never scanned; on macOS's case-insensitive volume it is SLICC six's root too. `sixProfilePattern` matches six's profile names, case-insensitively. `namePattern` is a valid profile name. `six` describes SLICC six's Chrome profiles (see [SLICC six's profiles](#slicc-sixs-profiles)):
|
|
99
99
|
- `roots`: six's profile root per OS (`macos`, `linux`, `windows`), a `base` location followed by the `path` segments. The base is its `env` when that is set and not empty (any value, as six takes it), else `home` under the home dir.
|
|
100
100
|
- `defaultName` (`browser-coding-agent-chrome`), `defaultPort` (5710) and `portSuffix` (`-{port}`): six's profile for its serve port `<port>` is `<root>/<defaultName>`, with `portSuffix` added for any port other than `defaultPort`.
|
|
@@ -109,7 +109,7 @@ Browser control must never navigate to, open or attach to a target on seven's ow
|
|
|
109
109
|
**URLs.** A URL is parsed the way the WHATWG URL Standard (and so the browser) parses it, so `https:\\seven.sliccy.ai`, a tab or newline inside the URL, `%2E`, `。` and full-width letters all reach seven. In Go and Rust that takes a WHATWG parser, not `net/url`. A URL that doesn't parse isn't protected; the browser doesn't load it either. Then:
|
|
110
110
|
1. While its scheme is one of `innerSchemes`, the rest of the URL after `<scheme>:` takes its place, at most 8 times: `blob:https://seven.sliccy.ai/<uuid>` is `https://seven.sliccy.ai/<uuid>`.
|
|
111
111
|
2. A scheme in `anySchemes` is protected whatever follows: a DevTools front end (`devtools://`) can be inspecting seven.
|
|
112
|
-
3. A scheme in `protectedSchemes` is protected like seven, whatever follows, except the `scheme://host` pairs in `schemeExceptions` (the new tab pages), on any path:
|
|
112
|
+
3. A scheme in `protectedSchemes` is protected like seven, whatever follows, except the `scheme://host` pairs in `schemeExceptions` (the new tab pages), on any path. Match the parsed scheme and exact host, never a raw URL prefix: `chrome-untrusted://new-tab-page/one-google-bar?paramsencoded=` is excepted, but `chrome-untrusted://new-tab-page.evil/` and `chrome-untrusted://other/` remain protected. Chrome's new tab embeds the excepted untrusted host, and `chrome://new-tab-page/` can commit as itself when opened directly:
|
|
113
113
|
- Chrome's privileged UI (`chrome://settings`, `chrome://password-manager`, `chrome-untrusted://…`, `devtools://`) and the same UI in the catalog's other Chromium browsers (`edge://settings/passwords`, `edge://wallet`, `brave://`, `opera://`, `vivaldi://`, `arc://`), since a client attaches to whatever browser answers;
|
|
114
114
|
- `chrome-extension://`, every page, frame and extension target of every type: password-manager and wallet extensions keep secrets there. There are no default exceptions. Seven's own extension origin is already covered as a seven origin. If a guard ever needs an exception, it is a catalog entry by extension id with a reason, never a default;
|
|
115
115
|
- `file://`: otherwise a tool could open `~/.ssh` or `~/.aws/credentials` in the real browser, around slicc's file-system fence. Adopters whose tests open local HTML through the guarded client move those fixtures to a local http server.
|
|
@@ -120,6 +120,8 @@ Browser control must never navigate to, open or attach to a target on seven's ow
|
|
|
120
120
|
|
|
121
121
|
This is wider than the rule for finding seven (`seven.originHostPattern`, which leaves out the `excludedLabels` and `excludedLabelPrefixes`—`www`, `vault`, `vault-preview`, `get`, `mcpcat`, `echo`, and any `vault-*` prefix). Every `sliccy.ai` host shares the `sliccy.ai` cookies, and cookies ignore the port and, without `Secure`, the scheme. SLICC six lives on `www.sliccy.ai` and the apex, and its cookies matter. `*.kernel.localhost` is not protected: each port is its own origin, and the agent's own servers live there. An extra origin is matched exactly, so `http://127.0.0.1:5710` doesn't protect `http://127.0.0.1:5711`.
|
|
122
122
|
|
|
123
|
+
**New-tab checks (1.8.2).** In fresh default profiles on macOS, Chrome for Testing 156.0.8078.4 (Playwright build 1248) and Chrome 155.0.8059.82 commit `chrome://newtab/` to `chrome://new-tab-page/` and embed `chrome-untrusted://new-tab-page/one-google-bar?paramsencoded=` as an out-of-process frame. Direct `chrome://new-tab-page/` also commits as itself. Edge 155.0.4283.60 commits `edge://newtab/` to `https://ntp.msn.com/edge/ntp` with an `about:blank` child and no internal-scheme child observed; directly opening `edge://ntp/` returns `ERR_INVALID_URL`. These observations are for fresh default profiles, not every browser configuration. Brave, Opera and Vivaldi were not installed locally, and this repository's CI installs only Chromium, so their redirects and internal frames were not verified and no additional exceptions are inferred. Incognito Chrome and Edge new tabs omit the ordinary new tab's frame tree; the reachability vector therefore uses the default context.
|
|
124
|
+
|
|
123
125
|
**The vault.** `vault.sliccy.ai` is in `hosts` by name, and vault branch previews (`vault-preview.sliccy.ai`, `vault-*.sliccy.ai`) are covered by the `sliccy.ai` domain rule. `sliccy.ai` already covers them all, but vault must stay protected even if `domains` ever changes: the vault must never be a CDP target for agent tools. The one exception is slicc-cli's own pairing attach for the vault, which is the CLI's own connection and not browser control handed to the agent.
|
|
124
126
|
|
|
125
127
|
**Targets.** A target whose `TargetInfo.type` is one of `targetTypes` (`browser_ui`, Chrome's own UI such as `chrome://omnibox-popup.top-chrome/`) is always protected, whatever its URL. Otherwise a target's effective origin is its URL's (`TargetInfo.url`), except when the URL inherits the origin of whoever made the document: the empty URL, and `inheriting` with any query or fragment. Such a target is protected when it was protected before this URL (a seven tab that went to `about:blank` keeps seven's origin), or when its opener (`openerId`, else `openerFrameId`) is protected or unknown, for an opener closed before the program saw it. The URL, `openerFrameId` and `browserContextId` alone can't tell: a blank popup that seven opens has seven's origin and the URL `about:blank`. A program that holds a session to the target also has the document's real origin: the main frame's `securityOrigin` in `Page.frameNavigated`, and the default context's `origin` in `Runtime.executionContextCreated`. When one of those is protected, the target is protected too, until a URL with an origin of its own replaces it.
|
|
@@ -143,10 +145,12 @@ Every CDP guard runs the vectors in `guard-vectors.json` (schema `schema/guard-v
|
|
|
143
145
|
- `C5.continue-request` and `C5.continue-response`, added next to `C5.document`;
|
|
144
146
|
- the `C8` rows for privileged pages: `C8.navigate` (a page navigates to `chrome://settings`, `chrome://password-manager`, an extension page or `file:///`; refused), `C8.view-source` (the same through `view-source:`; refused), `C8.create` (`Target.createTarget` straight on those pages; refused), `C8.browser-ui-listed` (`Target.getTargets` lists no `browser_ui` target) and `C8.browser-ui-attach` (`Target.attachToTarget` by a `browser_ui` target's id; refused). All four have an unguarded control, since the guard refuses them only on the privileged target. Two cases aren't rows, because Chrome itself blocks them, so an unguarded client can't tell a guard from none: a page's `window.open('chrome://settings')`, and an `about:` alias such as `about:settings`, which `Page.navigate` and `Target.createTarget` both turn into `about:blank#blocked`. The `about:` aliases are in `protected.json` instead.
|
|
145
147
|
|
|
148
|
+
The `C8.newtab` reachability control attaches through the guard to a settled ordinary new tab, including its internal frames, then navigates that same tab to an ordinary document. Both legs must succeed, including without a guard. It uses the default browser context, since an incognito new tab omits the ordinary new tab's internal frames. It covers `chrome://newtab/` and directly opened `chrome://new-tab-page/`.
|
|
149
|
+
|
|
146
150
|
**Top level.**
|
|
147
151
|
- `schemaVersion` (1): guards pin it.
|
|
148
152
|
- `setVersion`: the package version. The release flow stamps it into the npm package and the crate (`scripts/set-crate-version.mjs`). In git, and so in the Go module, it reads `0.0.0`; Go code gets the version from the module.
|
|
149
|
-
- `targets`: the names a runner maps to a scheme, host and port: `seven`, `vault`, `vault-x` (a vault branch preview), `apex`, `own` (the client page's origin, `{client}`), `ordinary`, `ordinary-same-site`, `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root`. Each has a `description` and, for the protected ones, a default `host`. `chrome-settings` (`chrome://settings/`), `chrome-passwords` (`chrome://password-manager/`), `chrome-extension-page` (a page of Chrome's built-in PDF viewer extension) and `file-root` (`file:///`) carry a `url`, which the runner uses unless `targets` maps the name to something else. No other URL in the file is one a runner must use.
|
|
153
|
+
- `targets`: the names a runner maps to a scheme, host and port: `seven`, `vault`, `vault-x` (a vault branch preview), `apex`, `own` (the client page's origin, `{client}`), `ordinary`, `ordinary-same-site`, `chrome-newtab`, `chrome-new-tab-page`, `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root`. Each has a `description` and, for the protected ones, a default `host`. `chrome-newtab` (`chrome://newtab/`), `chrome-new-tab-page` (`chrome://new-tab-page/`), `chrome-settings` (`chrome://settings/`), `chrome-passwords` (`chrome://password-manager/`), `chrome-extension-page` (a page of Chrome's built-in PDF viewer extension) and `file-root` (`file:///`) carry a `url`, which the runner uses unless `targets` maps the name to something else. No other URL in the file is one a runner must use.
|
|
150
154
|
- `variants`: the detach variants in ms. `prompt` and `lagging` are documented; a runner may add others, such as `lagging-8s`, and reports the name it ran.
|
|
151
155
|
- `capabilities`: what a transport may lack. `autoAttach` covers `Target.setAutoAttach`, `children` steps and child sessions; `browserSession` covers calls on the browser session; `browserContexts` covers `Target.createBrowserContext` and `Target.disposeBrowserContext`.
|
|
152
156
|
- `placeholders`: every `{name}` used in the vectors, with what it stands for. `{client}` is the client page's origin, which the runner maps.
|
|
@@ -279,7 +283,7 @@ otherwise they run serially. `capabilities` is an object of booleans or an array
|
|
|
279
283
|
of supported names. `capabilities.scope` selects owner-specific rows.
|
|
280
284
|
|
|
281
285
|
Map `ordinary`, `ordinary-same-site`, `seven`, `vault`, `vault-x`, `apex`, `own`
|
|
282
|
-
and `client` to origins. `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root` default to their `url`.
|
|
286
|
+
and `client` to origins. `chrome-newtab`, `chrome-new-tab-page`, `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root` default to their `url`.
|
|
283
287
|
`{browserUi}` is the id of one of Chrome's own `browser_ui` targets, which the runner looks up through
|
|
284
288
|
its unguarded observer (or the client) before the row; a row that uses it fails when there is none.
|
|
285
289
|
A vector with `"defaultContext": true` runs in the browser's default context even with the
|
|
@@ -300,7 +304,9 @@ every alternative of an `any`, or a required (`all`, `not` or plain) check, need
|
|
|
300
304
|
selects one variant or an array; omission selects all. `parallel` defaults to 1.
|
|
301
305
|
With the `browserContexts` capability each leg runs in its own browser context. A `Target.createBrowserContext` that fails with a timeout is retried once, and the row's `notes` records it; any other failure fails the row.
|
|
302
306
|
|
|
303
|
-
`settleScale` (default 1) multiplies
|
|
307
|
+
`settleScale` (default 1) multiplies the bounds of waits for events the leg expects to happen: settles (beacon, served, title and load) on the control leg and `required` settles on either leg, `paused` on the control leg, page and child loads, the wait for a background step's `as` result (`<as> did not complete within <ms>ms`), and the wait for an observation the leg expects to be `true`. Adopters on slow hosts can set 3 or 4. Every wait polls and returns as soon as its event arrives, so a larger bound only costs time when something is really missing, and each timeout error names the bound it used. An observation read from the fixture (`observer: "fixture"`, such as a beacon or a served request) that the leg expects to be `true` is polled for up to 5000 ms (scaled) instead of read once. One that the leg expects to be `false` is still read once.
|
|
308
|
+
|
|
309
|
+
`refusalScale` (default 1) multiplies the bounds of waits for what the guarded leg expects to be absent, the beacon, request, title or navigation that the guard should block: settles that are not `required`, and `paused`, on the guarded leg. Such a wait runs to its full bound whenever the guard works, so `settleScale` leaves it alone. The trade-off: a larger `refusalScale` gives more sensitivity to a leak that arrives late on a slow host, because the observations after the wait see it, at the cost of that much more time per guarded row. Adopters should keep `refusalScale` at 1 or higher, never below 1; the runner refuses a `refusalScale` below 1 with `refusalScale must be a number of at least 1`.
|
|
304
310
|
|
|
305
311
|
`onStart(row)` receives each row's `id`, `target`, `variant`, `transport` and `via` as the row starts. `run()` returns a promise that also has `inFlight()`, and its result has `inFlight` too. `inFlight()` lists the rows that are running now, each as `{ id, target, variant, leg, phase, step, clients }`, where `step` is the index of the current step in its `phase` (`setup`, `trigger` or `child`), and `clients` lists each client's pending CDP calls as `{ method, session, ageMs }` (`client`, plus `unguarded` when it is a separate client). With `rowTimeoutMs`, a row still running after that many milliseconds fails on its own. Its `errors` hold `row timed out after <ms>ms: <the in-flight view>`, `inFlight` holds the view, and the clients that `clientFactory` made for it are closed. The run then goes on to the next row. It is off by default, and a client passed as `client` is never closed.
|
|
306
312
|
|
|
@@ -391,7 +397,7 @@ Without `tls`, the server and logged URLs remain HTTP. It returns
|
|
|
391
397
|
The server serves document, frame, redirect, CSP, authentication, data, image,
|
|
392
398
|
canary and beacon paths. Configure host resolution in your test browser, not in
|
|
393
399
|
the runner. `npm run test:guard` exercises Chromium twice with no guard, one target per
|
|
394
|
-
invocation: controls must pass and guarded expectations must fail. For a single
|
|
400
|
+
invocation: controls must pass and guarded protection expectations must fail; the `C8.newtab` reachability control must instead pass both legs. For a single
|
|
395
401
|
target use `GUARD_TARGET=seven npm run test:guard-target`. The fixture also serves
|
|
396
402
|
`/live` image requests from stand-in documents, independently of injected code.
|
|
397
403
|
|
|
@@ -528,7 +534,7 @@ for case in corpus().cases {
|
|
|
528
534
|
Go 1.26, Rust stable with `wasm32-wasip1`, Node ≥ 24.
|
|
529
535
|
- `npm run corpus` regenerates `corpus.json` from `corpus/`; the pre-commit hook and CI fail when it's stale.
|
|
530
536
|
- `npm run validate` checks `catalog.json`, `corpus.json`, `protected.json` and `guard-vectors.json` against the schemas, runs the protected-origin vectors through `protected.mjs`, and checks what a schema can't say: unique ids, bundle ids and names, known Windows roots, rising tiers, compiling patterns, known tokens, tier order, `sevenOpen`, `tabs` (which holds no entry of `sevenTabs`), `six` and `auto` in each `expected.json`, and no port from 9222 to 9229.
|
|
531
|
-
- Every gate prints one verdict line when it passes: `validate: PASS …`, `corpus: PASS <n> cases` (`node scripts/corpus.mjs --check`), `major-guard: PASS v<version> fits <module>`, and `guard-sweep: PASS
|
|
537
|
+
- Every gate prints one verdict line when it passes: `validate: PASS …`, `corpus: PASS <n> cases` (`node scripts/corpus.mjs --check`), `major-guard: PASS v<version> fits <module>`, and `guard-sweep: PASS 11 targets` (`npm run test:guard-sweep`). CI runs each through `scripts/gate.mjs --expect <regex> -- <command>`, which fails when the command exits non-zero or prints no matching line, so a silent or early exit never reads as a pass. `gate.mjs --expect <regex> --in <file>` checks a log instead; the release job uses it on semantic-release's log for the major-guard line. `npm run test:gates` tests the gates, including runs through a symlinked checkout and a symlinked script.
|
|
532
538
|
- `npm run lint`: the slicc lint tools (Biome, no comments, no unit tests in git, `AGENTS.md`), `gofmt`, `go mod tidy -diff`, `go vet`, golangci-lint, `cargo fmt --check` and clippy.
|
|
533
539
|
- `npm test`: `validate`, the Go tests in `test/integration/`, and `cargo test --all-features`.
|
|
534
540
|
- `npm run build`: the Go module, the crate (also for `wasm32-wasip1`), and `npm pack --dry-run`.
|
package/catalog.json
CHANGED
|
@@ -720,7 +720,14 @@
|
|
|
720
720
|
"arc",
|
|
721
721
|
"file"
|
|
722
722
|
],
|
|
723
|
-
"schemeExceptions": [
|
|
723
|
+
"schemeExceptions": [
|
|
724
|
+
"chrome://newtab",
|
|
725
|
+
"chrome://new-tab-page",
|
|
726
|
+
"chrome-untrusted://new-tab-page",
|
|
727
|
+
"edge://newtab",
|
|
728
|
+
"brave://newtab",
|
|
729
|
+
"opera://startpage"
|
|
730
|
+
],
|
|
724
731
|
"aboutScheme": "chrome",
|
|
725
732
|
"targetTypes": ["browser_ui"],
|
|
726
733
|
"inheriting": ["about:blank", "about:srcdoc"],
|
package/guard-runner.mjs
CHANGED
|
@@ -117,6 +117,7 @@ class Execution {
|
|
|
117
117
|
(step) => step.children && step.where
|
|
118
118
|
);
|
|
119
119
|
this.scale = options.settleScale ?? 1;
|
|
120
|
+
this.refusalScale = options.refusalScale ?? 1;
|
|
120
121
|
this.childRuns = new Map();
|
|
121
122
|
this.named = new Map();
|
|
122
123
|
this.processed = new Set();
|
|
@@ -169,12 +170,12 @@ class Execution {
|
|
|
169
170
|
return out;
|
|
170
171
|
}
|
|
171
172
|
|
|
172
|
-
bound(ms) {
|
|
173
|
-
return Math.round(ms * this.scale);
|
|
173
|
+
bound(ms, absent = false) {
|
|
174
|
+
return Math.round(ms * (absent ? this.refusalScale : this.scale));
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
async poll(predicate, ms = 1500) {
|
|
177
|
-
const deadline = Date.now() + this.bound(ms);
|
|
177
|
+
async poll(predicate, ms = 1500, absent = false) {
|
|
178
|
+
const deadline = Date.now() + this.bound(ms, absent);
|
|
178
179
|
do {
|
|
179
180
|
if (await predicate()) return true;
|
|
180
181
|
await sleep(25);
|
|
@@ -524,7 +525,7 @@ class Execution {
|
|
|
524
525
|
event.params?.request?.url === url &&
|
|
525
526
|
this.rule(event)?.url === url
|
|
526
527
|
);
|
|
527
|
-
if (!(await this.poll(seen, ms)) && this.side === 'control')
|
|
528
|
+
if (!(await this.poll(seen, ms, this.side === 'guarded')) && this.side === 'control')
|
|
528
529
|
this.errors.push(`paused: no pause for ${url} within ${this.bound(ms)}ms`);
|
|
529
530
|
}
|
|
530
531
|
|
|
@@ -660,13 +661,14 @@ class Execution {
|
|
|
660
661
|
);
|
|
661
662
|
};
|
|
662
663
|
const alt = settle.or;
|
|
664
|
+
const absent = this.side === 'guarded' && !settle.required;
|
|
663
665
|
if (refused() && !alt) return skipped();
|
|
664
666
|
if (settle.variant) await sleep(this.delay);
|
|
665
667
|
if (settle.title && !this.reader) {
|
|
666
|
-
await sleep(this.bound(settle.ms ?? 1500));
|
|
668
|
+
await sleep(this.bound(settle.ms ?? 1500, absent));
|
|
667
669
|
return;
|
|
668
670
|
}
|
|
669
|
-
const
|
|
671
|
+
const arrived = async () => {
|
|
670
672
|
if (refused()) return !alt || (await this.check(alt));
|
|
671
673
|
if (settle.served) return this.requestCheck({ served: settle.served, tagged: false });
|
|
672
674
|
if (settle.beacon)
|
|
@@ -685,7 +687,8 @@ class Execution {
|
|
|
685
687
|
.slice(index + 1)
|
|
686
688
|
.some((e) => e.method === 'Page.loadEventFired' && e.sessionId === event.sessionId)
|
|
687
689
|
);
|
|
688
|
-
}
|
|
690
|
+
};
|
|
691
|
+
const met = await this.poll(arrived, settle.ms ?? 1500, absent);
|
|
689
692
|
if (refused() && !alt) return skipped();
|
|
690
693
|
if (settle.required && !met)
|
|
691
694
|
this.errors.push(
|
|
@@ -1419,13 +1422,22 @@ function validateBlocked(vectors) {
|
|
|
1419
1422
|
throw new TypeError(`${vector.id}: blocked needs exactly one url or nonempty anyOf`);
|
|
1420
1423
|
}
|
|
1421
1424
|
|
|
1422
|
-
function
|
|
1423
|
-
if (!opts.fixture?.log) throw new TypeError('fixture.log is required');
|
|
1425
|
+
function validateScales(opts) {
|
|
1424
1426
|
if (
|
|
1425
1427
|
opts.settleScale !== undefined &&
|
|
1426
1428
|
!(Number.isFinite(opts.settleScale) && opts.settleScale > 0)
|
|
1427
1429
|
)
|
|
1428
1430
|
throw new TypeError('settleScale must be a positive number');
|
|
1431
|
+
if (
|
|
1432
|
+
opts.refusalScale !== undefined &&
|
|
1433
|
+
!(Number.isFinite(opts.refusalScale) && opts.refusalScale >= 1)
|
|
1434
|
+
)
|
|
1435
|
+
throw new TypeError('refusalScale must be a number of at least 1');
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
function validate(set, opts) {
|
|
1439
|
+
if (!opts.fixture?.log) throw new TypeError('fixture.log is required');
|
|
1440
|
+
validateScales(opts);
|
|
1429
1441
|
for (const vector of set.vectors)
|
|
1430
1442
|
for (const [name, observation] of Object.entries(vector.observe ?? {}))
|
|
1431
1443
|
if (!observation.check) throw new TypeError(`${vector.id}: ${name} lacks a check`);
|
package/guard-vectors.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"setVersion": "1.8.
|
|
3
|
+
"setVersion": "1.8.2",
|
|
4
4
|
"sources": [
|
|
5
5
|
{
|
|
6
6
|
"repo": "ai-ecoverse/slicc-cli",
|
|
@@ -49,6 +49,14 @@
|
|
|
49
49
|
"ordinary-same-site": {
|
|
50
50
|
"description": "an unprotected origin same-site with the target"
|
|
51
51
|
},
|
|
52
|
+
"chrome-newtab": {
|
|
53
|
+
"url": "chrome://newtab/",
|
|
54
|
+
"description": "Chrome's ordinary new tab page, including its internal frames"
|
|
55
|
+
},
|
|
56
|
+
"chrome-new-tab-page": {
|
|
57
|
+
"url": "chrome://new-tab-page/",
|
|
58
|
+
"description": "Chrome's directly opened new tab page"
|
|
59
|
+
},
|
|
52
60
|
"chrome-settings": {
|
|
53
61
|
"url": "chrome://settings/",
|
|
54
62
|
"description": "Chrome's settings page, a privileged chrome: page"
|
|
@@ -12357,6 +12365,82 @@
|
|
|
12357
12365
|
},
|
|
12358
12366
|
"expected": "as each vector"
|
|
12359
12367
|
},
|
|
12368
|
+
{
|
|
12369
|
+
"id": "C8.newtab",
|
|
12370
|
+
"defaultContext": true,
|
|
12371
|
+
"family": "C",
|
|
12372
|
+
"kind": "cdp",
|
|
12373
|
+
"scope": "any",
|
|
12374
|
+
"setup": [
|
|
12375
|
+
{
|
|
12376
|
+
"page": "tab",
|
|
12377
|
+
"url": "{target}"
|
|
12378
|
+
}
|
|
12379
|
+
],
|
|
12380
|
+
"trigger": [
|
|
12381
|
+
{
|
|
12382
|
+
"cdp": "Target.attachToTarget",
|
|
12383
|
+
"params": {
|
|
12384
|
+
"targetId": "{pageTarget}",
|
|
12385
|
+
"flatten": true
|
|
12386
|
+
},
|
|
12387
|
+
"session": "browser",
|
|
12388
|
+
"as": "attach",
|
|
12389
|
+
"requires": ["browserSession"]
|
|
12390
|
+
},
|
|
12391
|
+
{
|
|
12392
|
+
"page": "navigate",
|
|
12393
|
+
"url": "{ordinary}/doc?tag={tag}",
|
|
12394
|
+
"as": "navigate"
|
|
12395
|
+
},
|
|
12396
|
+
{
|
|
12397
|
+
"settle": {
|
|
12398
|
+
"title": "doc",
|
|
12399
|
+
"ms": 5000,
|
|
12400
|
+
"required": true
|
|
12401
|
+
}
|
|
12402
|
+
}
|
|
12403
|
+
],
|
|
12404
|
+
"targets": ["chrome-newtab", "chrome-new-tab-page"],
|
|
12405
|
+
"requires": ["browserSession"],
|
|
12406
|
+
"observe": {
|
|
12407
|
+
"attached": {
|
|
12408
|
+
"means": "the guard attached to the settled new tab page",
|
|
12409
|
+
"check": {
|
|
12410
|
+
"result": "attach",
|
|
12411
|
+
"path": "ok",
|
|
12412
|
+
"equals": true,
|
|
12413
|
+
"observer": "client"
|
|
12414
|
+
}
|
|
12415
|
+
},
|
|
12416
|
+
"navigated": {
|
|
12417
|
+
"means": "the same tab reached an ordinary document through the guard",
|
|
12418
|
+
"check": {
|
|
12419
|
+
"title": "doc",
|
|
12420
|
+
"via": "unguarded",
|
|
12421
|
+
"observer": "unguarded"
|
|
12422
|
+
}
|
|
12423
|
+
}
|
|
12424
|
+
},
|
|
12425
|
+
"live": "the runner sees the ordinary document in the same tab",
|
|
12426
|
+
"control": {
|
|
12427
|
+
"origin": "ordinary",
|
|
12428
|
+
"via": "guard",
|
|
12429
|
+
"expected": {
|
|
12430
|
+
"attached": true,
|
|
12431
|
+
"navigated": true
|
|
12432
|
+
}
|
|
12433
|
+
},
|
|
12434
|
+
"expected": {
|
|
12435
|
+
"attached": true,
|
|
12436
|
+
"navigated": true
|
|
12437
|
+
},
|
|
12438
|
+
"liveCheck": {
|
|
12439
|
+
"title": "doc",
|
|
12440
|
+
"via": "unguarded",
|
|
12441
|
+
"observer": "unguarded"
|
|
12442
|
+
}
|
|
12443
|
+
},
|
|
12360
12444
|
{
|
|
12361
12445
|
"id": "C8.navigate",
|
|
12362
12446
|
"family": "C",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-browsers",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
|
|
66
66
|
"release": "semantic-release",
|
|
67
67
|
"test:guard": "npm run test:guard-integration && npm run test:guard-sweep",
|
|
68
|
-
"test:guard-integration": "node --test test/integration/guard-fit.test.mjs test/integration/guard-chain.test.mjs test/integration/guard-validation.test.mjs test/integration/guard-liveness.test.mjs test/integration/guard-observations.test.mjs test/integration/guard-child-latency.test.mjs test/integration/guard-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.test.mjs test/integration/guard-legs.test.mjs test/integration/guard-diagnostics.test.mjs test/integration/guard-chrome.test.mjs",
|
|
68
|
+
"test:guard-integration": "node --test test/integration/guard-fit.test.mjs test/integration/guard-chain.test.mjs test/integration/guard-validation.test.mjs test/integration/guard-liveness.test.mjs test/integration/guard-observations.test.mjs test/integration/guard-child-latency.test.mjs test/integration/guard-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.test.mjs test/integration/guard-legs.test.mjs test/integration/guard-diagnostics.test.mjs test/integration/guard-chrome.test.mjs test/integration/guard-scales.test.mjs",
|
|
69
69
|
"test:guard-sweep": "node scripts/test-guards.mjs",
|
|
70
70
|
"test:gates": "node --test test/integration/gates.test.mjs",
|
|
71
71
|
"test:guard-target": "node --test test/integration/guard-runner.test.mjs",
|
package/protected.json
CHANGED
|
@@ -358,6 +358,34 @@
|
|
|
358
358
|
"url": "chrome://newtab",
|
|
359
359
|
"protected": false
|
|
360
360
|
},
|
|
361
|
+
{
|
|
362
|
+
"url": "chrome://new-tab-page/",
|
|
363
|
+
"protected": false
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"url": "chrome://new-tab-page",
|
|
367
|
+
"protected": false
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"url": "chrome-untrusted://new-tab-page/one-google-bar?paramsencoded=",
|
|
371
|
+
"protected": false
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"url": "chrome-untrusted://new-tab-page",
|
|
375
|
+
"protected": false
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"url": "chrome://new-tab-page.evil/",
|
|
379
|
+
"protected": true
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"url": "chrome-untrusted://new-tab-page.evil/",
|
|
383
|
+
"protected": true
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"url": "chrome-untrusted://other/",
|
|
387
|
+
"protected": true
|
|
388
|
+
},
|
|
361
389
|
{
|
|
362
390
|
"url": "chrome://newtab-x/",
|
|
363
391
|
"protected": true
|