@ai-ecoverse/slicc-bios 2.11.2 → 2.11.3

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.
Files changed (2) hide show
  1. package/README.md +9 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -660,6 +660,15 @@ A browser extension's frame inside an ordinary page, such as a password manager'
660
660
  - **Cookies a `Fetch` reply sets:** `Fetch.fulfillRequest` and `Fetch.continueResponse` are refused when a `Set-Cookie` or `Set-Cookie2` line (any case, in `responseHeaders` as a list or a map, in base64 `binaryResponseHeaders`, with values split at line breaks) has a `Domain`, quoted or not, that covers a protected host, and when the guard can't read those headers: another shape, a value that isn't a string, a header name that isn't a token, a line break in another header, base64 it can't decode or a `Domain` that isn't a host name. A `responsePhrase` with a CR, LF or NUL, or one that isn't a string, and a `responseCode` that isn't an integer are refused too, and a phrase with a colon has its `Domain` attributes checked the same way. The whole command is refused, never a stripped copy, and the pause can still be answered. A cookie without `Domain` is host-only, so it reaches a protected host only on a protected request, whose replies are already refused. The same check covers the credential origins below ([#1632](https://github.com/ai-ecoverse/slicc-bios/issues/1632)): a `Domain` that covers one of their hosts is refused, and so is any `Set-Cookie` line in a reply to a request on one of their hosts, or to a request whose URL the guard didn't see, because a host-only cookie there is theirs.
661
661
  - **Shared checks:** commands on one session are checked in order, and a command can use the opener and surface check another command started after it arrived, provided no browser event arrived and no command other than a plain read (`DOM.describeNode`, `Runtime.getProperties`, `Page.getFrameTree`, `Target.getTargetInfo` and the like) was forwarded since that check started, and the check started at most 100 ms ago. A program that sends its reads together, such as a snapshot describing its refs, pays for about one check, not one per command. A failed check is never shared.
662
662
  - **Flat sessions only:** `Target.attachToTarget` and `Target.setAutoAttach` need `flatten: true`. `Target.sendMessageToTarget`, `Target.attachToBrowserTarget` and `Target.exposeDevToolsProtocol` are refused, so no command can be tunnelled past the guard.
663
+ - **Dialog answers (#1888):** `Page.handleJavaScriptDialog` names no dialog, so a client checks a dialog and then answers whichever one Chrome shows when the answer arrives. Another client's reload, or the user's, can swap the first for a new document's own dialog in between. The guard closes that race as far as it can see:
664
+ - **What the guard's own session saw.** The guard's own armed session on the tab, which shares the client's connection and so sees Chrome's events in the same order, tracks the tab's dialogs. Chrome doesn't repeat `Page.javascriptDialogOpening` to a session that attaches later, so until that session sees a dialog open or close, or the main frame navigate, a dialog may predate it: an answer then goes through as it always did, unless another guarded answer or move is in flight on the tab, or Chrome accepted one that started after the guard's session attached and landed in the last 10 s, which gets `slicc: refused: the dialog this answer was meant for may be gone: …`. Once the session has seen one of those events:
665
+ - A tab that is protected, loading a protected page, held for a sign-in or showing the error page for a refused document, or a dialog whose URL is protected or not `http(s)`, `data:`, `blob:`, `about:blank` or `about:srcdoc`, gets the "out of reach" refusal before any dialog state is looked at. So the dialog refusals below never tell a protected tab from an ordinary one. Tabs that move onto or load seven or the vault are refused earlier still, by the checks every command passes. A tab whose own session the guard couldn't set up is hidden from the client, and an answer on it gets the "out of reach" refusal too. An answer is an action on whatever dialog shows, so before forwarding one the guard reads the tab afresh (`Target.getTargetInfo`, 1 s at most). A read that errors, times out or finds a protected or held tab gets the "out of reach" refusal.
666
+ - An answer goes through when exactly one dialog is open and the answer arrived after the guard heard it open. One that arrived earlier was meant for another dialog and gets the "may be gone" refusal.
667
+ - With none open, or with two, it gets `slicc: refused: this session wasn’t shown a dialog that is still open in this tab, so the guard doesn’t answer one`.
668
+ - A main-frame cross-document start discards the open dialog. Answers then get the "may be gone" refusal until another dialog opens or one is answered, and a dialog that opens before the new document commits, the main frame stops loading or a `beforeunload` prompt is dismissed (10 s at most) gets it too. A `beforeunload` prompt stays: it belongs to that navigation.
669
+ - **One turn per tab, across connections.** Every guard in seven's page shares one registry per target (`tabTurn` in `guard.js`): kernel programs, linked devices and previews alike. An answer, `Page.navigate`, `Page.reload` or `Page.navigateToHistoryEntry` waits up to 5 s for the others in flight on that tab to be answered by Chrome, and is then forwarded; one with nothing in flight is forwarded at once. An answer gets the "may be gone" refusal when another guarded answer or move that Chrome accepted started after the dialog opened, or when one was in flight as it opened. A `beforeunload` dialog doesn't wait for the move that raised it.
670
+ - **Documents wait for the answer.** While a guarded answer is in flight, the guard holds every document request its own `Fetch` arm pauses on that tab, so a navigation from anywhere, the user's or a client's outside the guard included, can't commit a new document, or open its dialog, before Chrome has answered. A discarded dialog then answers `No dialog is showing`. The hold ends with Chrome's answer, the connection's close, or after 5 s.
671
+ - **What remains.** The browser can change a tab's document without any event reaching the guard before an answer does, while the fresh read still says the tab is ordinary. The answer then reaches a dialog of a document the browser itself calls ordinary. A document that loads without a paused request isn't held either: a back/forward-cache restore or prerender activation started by the user or a client outside the guard. An answer meant for an alert can reach a `beforeunload` prompt that the same ordinary document raises when a leave starts. It never reaches another document's dialog or a protected one's. Answers from clients that don't go through bios's guard (slicc-extension's own traffic, a second seven tab with its own registry) aren't checked, though the document hold still covers navigations they cause. Stock Playwright and Puppeteer `page.on('dialog')` keep working on ordinary pages (`stock-clients.test.mjs`). `guard-dialog-race.test.mjs` holds an answer in the client's transport until the reload's dialog opens, or 3 s pass, and races it against a reload by another guarded client and by one outside the guard, in both orders. Without these measures the held answer closes the new dialog. The file also answers a dialog from a session that never enabled `Page`, so it was never shown the opening. A guard that attaches while a dialog is already open can't finish arming in Chrome (measured on #1891). It refuses the tab as unguarded after 10 s, as before this change. `guard-dialog-turns.test.mjs` runs without a browser, against a fake Chrome that several guards share. It covers the two-client race, the "wasn't shown" and "may be gone" refusals (after a navigation and after a guarded move into the vault), the 5 s bound, the turn's release on reply, timer, close and destroy, and the eviction cap. It checks that protected tabs only ever get the "out of reach" refusal, and which check gives it. It also covers the fresh read: for a vault dialog the guard heard nothing about, for a read that errors or times out, and for an ordinary tab. Mutants of `guard.js` show that each of these rows depends on the code it covers.
663
672
  - **Stock clients' setup (group 1):** stock Playwright (`chromium.connectOverCDP`) and Puppeteer (`puppeteer.connect`) open, drive and read ordinary pages through the guard, as the shared vectors' `stockSetup` rows require. On a page session the guard admits:
664
673
  - `Page.addScriptToEvaluateOnNewDocument` whose `source` holds no code: it matches `^(?:[ \t\n]|//[^\n\r\u2028\u2029]*)*$` as a whole, with or without `worldName` and `runImmediately` (Playwright sends `''`, Puppeteer `//# sourceURL=pptr:internal`). `Page.removeScriptToEvaluateOnNewDocument` is admitted for an identifier that session got from it.
665
674
  - `Page.createIsolatedWorld` on a frame the guard places as ordinary, always forwarded without `grantUniveralAccess` and `contentSecurityPolicy`, whatever the client asks. A frame that shows Chrome's error page for a refused document, or the guard's own blank, gets the "out of reach" refusal and no context.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "2.11.2",
3
+ "version": "2.11.3",
4
4
  "description": "Slim loader that boots SLICC into OPFS and serves the UI from there",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",