@ai-ecoverse/slicc-bios 1.74.13 → 1.74.15

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 +11 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -521,6 +521,7 @@ A browser extension's frame inside an ordinary page, such as a password manager'
521
521
  - **Checked on attach:** a new session is handed to the program only after the guard has checked its target and read the session's frame tree, and none of them is protected. An auto-attached page or frame without a URL yet is held, with its events dropped and its commands refused, until it has one, and cut if it has none after 10 s. A target that attaches paused (`waitForDebuggerOnStart`) is resumed as soon as the guard's `Fetch` arm on its own session for that target is accepted (at most 1 s), before the rest of the guard's setup, because `Page.enable` and the frame-tree read can't finish on a paused page; it stays held the same way until the guard has placed it, and a program's own `Runtime.runIfWaitingForDebugger` doesn't wait for that setup. If the guard's `Fetch.enable` is refused, the target is cut instead of resumed. A target that is already protected or held when it attaches is resumed only as the guard cuts it, and if the read that confirms it doesn't settle within 1 s, the guard cuts it then. A paused tab with no page under it after 10 s is resumed, since the program has no session on any page in it. A tab that attaches paused is resumed once the page under it is armed the same way: until the tab runs, that page can't answer the guard's frame-tree read, and the program waits for the guard before it resumes the tab. An iframe that Chrome still names with an empty URL when the guard checks it is read from a fresh frame tree of the page it attached under, used only when that tree lists the frame once at an `http:`, `https:` or `data:` address no other target claims and every recorded parent names that page, and judged again at its next target info change or navigation; otherwise it still fails closed.
522
522
  - **Cut sessions:** a session whose target becomes protected (`Target.targetInfoChanged`), whose page or any frame in it is about to navigate or navigates to a protected URL (`frameRequestedNavigation`, `frameScheduledNavigation`, `frameStartedNavigating`, `frameNavigated`, `navigatedWithinDocument`, or a `Document` request), or whose context runs on a protected origin is detached at once, without the event, and its target counts as protected from then on. Any other page event that names a protected URL or origin is dropped. Its later events and the answers to its pending commands are dropped, and its commands are refused. The guard watches each session's `Page` events itself, and passes them on only when the program asked for them.
523
523
  - **Requests from protected documents:** a request whose URL, document, frame, initiator, `Referer` or `Origin` is protected never reaches the program. The guard continues its `Fetch` pause itself, drops its `Network` events, and refuses its bodies (`Network.getResponseBody`, `getRequestPostData`, `Fetch.getResponseBody` and the like). Bodies, `replayXHR` and `Fetch` replies for a request the guard hasn't seen are refused too. Extra-info events that come before their request wait up to 2 s for it, then are dropped.
524
+ - **Interception goes through `Fetch`:** the deprecated `Network` interception commands (`Network.setRequestInterception`, `continueInterceptedRequest`, `getResponseBodyForInterception`, `takeResponseBodyForInterceptionAsStream`) are refused before Chrome, with a text that says to use `Fetch` instead. A `Network.requestIntercepted` for a protected request never reaches the program; the guard continues it itself, the way it continues a protected `Fetch` pause.
524
525
  - **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. Not covered yet: a `Domain` that covers one of the credential hosts seven signs in with, until [#1606](https://github.com/ai-ecoverse/slicc-bios/pull/1606) adds them to the same check ([#1632](https://github.com/ai-ecoverse/slicc-bios/issues/1632)).
525
526
  - **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.
526
527
  - **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.
@@ -540,19 +541,24 @@ A browser extension's frame inside an ordinary page, such as a password manager'
540
541
  - **Known limit:** extensions that refuse `Target.setAutoAttach` leave an ordinary page with a cross-site iframe locked for paint, DOM, CSS, accessibility and input. The guard fails closed when it cannot place the child.
541
542
 
542
543
  **Sign-in tabs are held for life (#754).** A sign-in popup shows its token or code in its URL and on the IdP's pages, and the guard cannot scrub a page's own content. The owner holds it before sign-in starts. A held tab and its descendants are not listed, attached, auto-attached or reported to a program on any origin until they close.
543
- - **Seven's own sign-in:** the popup opens on `about:blank#slicc-sign-in-<nonce>`. bios asks the owner over the `slicc-held` BroadcastChannel to hold it. The owner finds that target by its marker URL on each browser host (slicc-extension, a DevTools port, and a `seven: true` browser from a CLI linked on this computer), holds it, and only then is the popup sent to the IdP. slicc-cli's link guard shows seven's own popup to bios as plain `about:blank`, without the marker, so on a linked browser the owner holds every page on `about:blank` that one of seven's or the vault's pages opened. The sweep, the watcher and the guard then treat a held tab on a linked browser as on the other hosts: it isn't listed, attached or read on any later page until it closes. The owner answers `held` once it has held the tab on every listed host, `none` when no host is listed, and `unheld` otherwise, including when a listed host can't be opened. On `unheld`, on `none` while bios sees a host, or on no answer within 6 s while a host is connected, the sign-in stops before the IdP and says so; it never goes on unheld. On `none`, the sign-in goes on, and the owner keeps it as in flight for 11 minutes (in `localStorage`, `slicc-os.sign-in-flight`, so a reload keeps it). Before any program gets a browser connection, the owner sweeps every host: it holds sign-in tabs still on `about:blank`, and while a sign-in is in flight, every page a protected page opened. So a host that connects in the middle of a sign-in never sees its tab.
544
- - **Sign-in pages by their URL:** a page whose URL names seven's callback (`www.sliccy.ai/auth/callback`) or a client id seven signs in with is protected, also when the URL is percent-encoded up to five times or nested in another URL. On the link route, slicc-cli's link guard has already cut a protected URL inside another URL down to its origin, so `redirect_uri=https%3A%2F%2Fwww.sliccy.ai%2Fauth%2Fcallback` reaches bios as `redirect_uri=https://www.sliccy.ai`. On that route only, `https://www.sliccy.ai` or `www.sliccy.ai` on its own inside a URL (followed by `?`, `&`, `#`, `;`, a space or the end) counts as seven's callback too, so such a sign-in page stays hidden without the hold. A page there that only links to seven's home page is hidden too, and other `sliccy.ai` addresses aren't affected.
544
+ - **Seven's own sign-in:** the popup opens on `about:blank#slicc-sign-in-<nonce>`. bios asks the owner over the `slicc-held` BroadcastChannel to hold it. The owner finds that target by its marker URL on each browser host (slicc-extension, a DevTools port, and a `seven: true` browser from a CLI linked on this computer), holds it, and only then is the popup sent to the IdP. slicc-cli's link guard shows seven's own popup to bios as plain `about:blank`, without the marker, so on a linked browser the owner goes by a baseline instead. Before it opens the popup, the sign-in asks the owner for a baseline (`{ type: 'base', marker }`). The owner lists every linked browser and keeps the ids it saw for that marker. Only then does it answer `based`, and only then does the sign-in open the popup. Its hold ask then says `based: true` and `expect: 1`, the number of popups the sign-in opened. On each linked browser, the owner holds, as soon as it sees them, every page on `about:blank` that one of seven's or the vault's pages opened and that wasn't in the baseline. Every listing it takes starts after `window.open` has returned. It answers `held` only when two listings in a row show the same new pages, the number of new pages it has seen in all equals `expect`, and all of them are held. If it sees more new pages than that, such as a blank another seven page opened at the same moment, it can't tell which one is the sign-in. It keeps them all held and answers `unheld`, so the sign-in stops before the IdP, and trying again works. If it sees fewer by the end of the hold's 5 s, it answers `unheld` too. `held` means the owner holds as many new pages as the sign-in opened, not that the popup is one of them: a blank another seven page opened, listed alone in two listings in a row while the popup isn't listed yet, gets `held` too. So when a linked browser took part in the ask, a `held` answer also puts the sign-in in flight, as a linked flight. The flight rule for it applies only on linked browsers: while a linked flight is on, the watcher and the sweep on a linked browser, and a program's guard on the link route, hold for life every page that one of seven's or the vault's pages opened, cross-origin pages included, as soon as they see it. A program's guard on slicc-extension and a DevTools port honours a `none` flight, as the watcher and sweep there do, but a linked flight changes nothing on those hosts, so a tab seven opens there, noopener included, stays listed and drivable as before, and their sign-in tabs are held by the marker. So the popup is held on whatever page it is first seen on: the authorize URL, a landing page IMS redirected to before anything listed it, or the login page. That doesn't depend on its URL naming seven's client id or callback, and its later pages (login, MFA, consent) stay held. The other page's blank that got the answer stays held as well: a hold is never released (#754), and the opener rules hold a protected `about:blank` anyway. A protected `about:blank` page that was already open, such as a leftover vault, MCP or sprinkle popup, is no longer taken for the sign-in, and the sign-in's hold doesn't take it. The owner takes one baseline at a time: the next sign-in's baseline waits until the previous sign-in's hold is answered, or 5 s after its baseline when no hold came, so an overlapping sign-in's baseline already lists the earlier popup. The sign-in fails closed in each of these cases: no `based` answer within 6 s while bios sees a host; a linked browser the owner couldn't list at the baseline, or one that wasn't there then; a baseline that was lost or expired; no new protected `about:blank` within the 5 s. Each says it couldn't keep the window out of reach. The marker hosts (slicc-extension, a DevTools port) still go by the marker, as before, and ignore the baseline. A hold ask without `based`, such as the agent's MCP OAuth and device-code popups, still holds every protected `about:blank` page on a linked browser, as before. The sweep, the watcher and the guard then treat a held tab on a linked browser as on the other hosts: it isn't listed, attached or read on any later page until it closes. The owner answers `held` once it has held the tab on every listed host, `none` when no host is listed, and `unheld` otherwise, including when a listed host can't be opened. On `unheld`, on `none` while bios sees a host, or on no answer within 6 s while a host is connected, the sign-in stops before the IdP and says so; it never goes on unheld. On `none`, the sign-in goes on in flight too, as before: that flight counts on every host, for the watcher and the sweep. A flight is kept per marker in `localStorage` (`slicc-os.sign-in-flight`, so a reload keeps it) for at most 11 minutes, with whether it is linked. An older bios's plain number still counts on every host; an entry that doesn't say whether it is linked counts as linked. The reverse doesn't hold: an older bios still running in another seven tab can't read the new entries and sees no flight, which only matters while tabs of both versions are open during an update. Seven's sign-in ends its own flight when it ends (its token, an error, Cancel or the timeout), so one sign-in ending doesn't end another's, in this tab or another. Before any program gets a browser connection, the owner sweeps every host: it holds sign-in tabs still on `about:blank`, and while a sign-in is in flight, every page a protected page opened. So a host that connects in the middle of a sign-in never sees its tab.
545
+ - **Sign-in pages by their URL:** a page whose URL names seven's callback (`www.sliccy.ai/auth/callback`) or a client id seven signs in with is protected, also when the URL is percent-encoded up to five times or nested in another URL. On the link route, slicc-cli's link guard has already cut a protected URL inside another URL down to its origin, so `redirect_uri=https%3A%2F%2Fwww.sliccy.ai%2Fauth%2Fcallback` reaches bios as `redirect_uri=https://www.sliccy.ai`. On that route only, `https://www.sliccy.ai` or `www.sliccy.ai` on its own inside a URL (followed by `?`, `&`, `#`, `;`, a space or the end) counts as seven's callback too, so such a sign-in page stays hidden without the hold. A page there that only links to seven's home page is hidden too, and other `sliccy.ai` addresses aren't affected. Such a URL only hides a page while the page is on it, also one that seven or the vault opened: once it leaves, it is listed again, unless a flight rule above held it.
545
546
  - **Puppeteer and a held tab:** over the DevTools port and the link, Chrome attaches a held tab's `tab` target before the guard knows which page it holds. When the guard cuts that tab's session on the browser session (its page is held or protected, on the tab's first command or later, or the tab's own address is protected at its attach), it reports `Target.detachedFromTarget` if the client saw it attach and `Target.targetDestroyed` in every case, once, so Puppeteer's connect, which waits for every tab it saw attach to get a page or go away, finishes while a sign-in is held.
546
- - **The guard decides by itself, too:** every child of a held opener stays held, whatever its origin, including the frames and workers of a held tab (`parentId`). The cross-origin exception applies only to an opener that is itself an unheld HTTP(S) page on seven's or the vault's protected origin, including seven's runtime origin. A settled ordinary HTTP(S) child of that page can remain drivable when fresh, consistent child and opener metadata proves their origins differ and the opener has no held ancestry after applying the opener rules to each fresh ancestor in its opener and parent chains. Same-origin and inherited `about:blank` or `about:srcdoc` children stay held. An initial empty target explicitly reporting no opener access is not made permanently held merely by that empty metadata; its eventual document is checked before use. Empty targets with opener access remain held.
547
+ - **The guard decides by itself, too:** every child of a held opener stays held, whatever its origin, including the frames and workers of a held tab (`parentId`). The cross-origin exception applies only to an opener that is itself an unheld HTTP(S) page on seven's or the vault's protected origin, including seven's runtime origin. Outside a linked flight on the link route, a settled ordinary HTTP(S) child of that page can remain drivable when fresh, consistent child and opener metadata proves their origins differ and the opener has no held ancestry after applying the opener rules to each fresh ancestor in its opener and parent chains. Same-origin and inherited `about:blank` or `about:srcdoc` children stay held. An initial empty target explicitly reporting no opener access is not made permanently held merely by that empty metadata; its eventual document is checked before use. Empty targets with opener access remain held.
547
548
  - **Other sign-in tabs:** the owner watcher holds children of held tabs on every origin. For unheld protected-origin openers, outside sign-in flight it holds children with opener access and inherited about:blank or about:srcdoc children, while skipping other children without opener access; the guard still checks them at attach time. It retains earlier target observations to establish holds, including standalone blank-child events. Its cross-origin exception requires both targets in the same fresh batch; a retained opener URL cannot waive a hold. While sign-in is in flight, the sweep still holds cross-origin children of a protected opener. The watcher connects through slicc-extension and polls every 250 ms once a program or sign-in needs the browser. Only marked popups are held reliably there: an unmarked popup that leaves its initial inherited document before it is observed can be missed (a known gap). Seven's Adobe sign-in and the agent's MCP OAuth and device-code popups carry the hold marker before navigating; without a required holder's answer, sign-in fails.
548
549
  - **Kept:** held tab ids are kept in `localStorage` (`slicc-os.held-targets`, the 32 most recently held or seen again), so a reload of the owner keeps them.
549
550
  - **The watcher's connections:** it connects to slicc-extension only once a program or a sign-in needs the browser. Before any program gets a browser connection, the owner sweeps every host; if that listing fails, the program gets no connection, and no host connection is opened for it.
550
551
  - **Ordinary cross-origin HTTPS children** of seven's or the vault's own unheld pages are no longer held merely by the opener rules when fresh settled metadata proves the difference. A blank-first or inherited empty child, such as `window.open('')` followed by a location assignment, stays held for the tab's life after navigating or losing its opener. An existing hold, including a bare target id stored by an older version, is never released merely because opener metadata disappears or no sign-in is in flight.
551
552
  - **Fresh session checks:** before a command on a page session is forwarded, fresh target metadata and opener ancestry are checked, including CSS, session Fetch and Runtime or DOM metadata commands, except Page.handleJavaScriptDialog when the existing dialog prelude admits it without reading the page. A page reporting opener access without an opener id is refused as unknown.
552
553
  - **Cross-origin opener handles** can still send messages, navigate where browser rules permit, focus or blur the window, close a script-closable window, inspect `closed` and `length`, and expose `frames` or indexed window references. They do not permit cross-origin DOM reads.
553
- - **Limits (all fail closed).**
554
+ - **Limits.** The first two items and the baseline's round trip fail closed. The others don't: each leaves a page or a read open to a program with the browser grant.
554
555
  - The link-route callback match can wrongly hide an ordinary page whose URL carries `https://www.sliccy.ai` or `www.sliccy.ai` standing alone, for example `?from=https://www.sliccy.ai` or `utm_source=www.sliccy.ai`. The pattern also matches seven's own home page (`https://www.sliccy.ai/`, `https://www.sliccy.ai/?x`). That changes nothing, because `www.sliccy.ai` is a protected origin on every route: its root, `/docs` and `/blog` were already out of reach, and stay so.
555
- - An `about:blank` page that a protected page opened on a linked browser, while a hold is being asked, stays held for that tab's life, even if it wasn't the sign-in.
556
+ - While a linked flight is on, every page seven or the vault opens on a linked browser, such as a help link or a sprinkle popup, is held for life once it is seen there, even one that has nothing to do with the sign-in. The flight rule is linked-only; slicc-extension and a DevTools port don't read linked flights.
557
+ - On a linked browser, a hold ask without `based` (the agent's MCP OAuth and device-code popups) answers `held` on the owner's first listing that shows any `about:blank` page a protected page opened, and holds those for life, even one that wasn't the sign-in. The agent's own popup may not be among them. The owner puts that ask in a linked flight too, so the popup is held by the flight rule once it is seen on its next page. But the agent doesn't tell bios when its sign-in ends, so only the 11 minutes end that flight: for that long, every page seven or the vault opens on a linked browser is held for life. An agent popup that no watcher, sweep or guard has seen within those 11 minutes is not held after them, and a program with the browser grant can then list, attach and read its IdP pages. The fix is for slicc-agent to ask for a baseline and to say when its sign-in ends.
558
+ - Seven's Adobe sign-in on a linked browser is bound to its popup by the count and by the flight, not by the popup's id or URL. The flight needs `localStorage`: if seven can't write it, there is no flight and the count is all there is, which can take another page's blank for the popup. A popup that outlives its own flight, which ends when the sign-in ends or after 11 minutes, is judged by the opener rules again if it wasn't seen before. Seven closes the popup on an error, Cancel and the timeout, and the callback page closes itself.
559
+ - The `slicc-held` channel is same-origin. A seven-origin document can post `{ type: 'held', marker }` itself, and the sign-in then sends an unheld popup to the IdP. That is older than the baseline: a program with the browser grant can't run script on seven's origin, because the guard refuses it.
560
+ - The baseline is a round trip to the owner, and over the link a listing, before `window.open`. If that takes longer than the browser's user-activation window, Chrome blocks the popup, and the sign-in says so.
561
+ - **Cookies and storage are filtered by origin, not by the hold.** On all three routes (DevTools port, link, slicc-extension), bios's guard applies the same filters, and none of them depend on the route. Cookie answers (`Network.getCookies`, `Network.getAllCookies`, `Storage.getCookies`, `Page.getCookies`) drop a cookie whose domain, URL or partition top-level site is a catalog-protected origin (`sliccy.ai` and its subdomains, the vault, seven's origin). `DOMStorage.*`, `IndexedDB.*`, `CacheStorage.*` and `Storage.*` commands are refused when a param (`securityOrigin`, `origin`, `storageKey`, `cacheId`, `ownerOrigin`, `domain`, nested in `storageId` or `storageBucket` too) names a protected origin. Their events are dropped the same way. Network and Fetch events and bodies are dropped per request when the request, its document, initiator, `Referer`/`Origin` or its frame is protected. `Network.getCookies` is refused when every URL in `urls` is protected, and on its own when a URL is a sign-in URL by the rule above. The link route adds slicc-cli's link guard and slicc-extension adds its shield; both use the same catalog. A held tab is not listed, attached or read, but the hold doesn't touch browser-wide reads. An IdP origin seven signs in with (`ims-na1.adobelogin.com`, `ims-na1-stg1.adobelogin.com`) isn't in the catalog. So during and after a held Adobe sign-in, a program with the browser grant can still read that origin's cookies and storage without attaching to the held tab, on every route: `Network.getAllCookies`, `Network.getCookies` with the IdP's URL, `Storage.getCookies`, `Page.getCookies` on an ordinary page's session, `DOMStorage.getDOMStorageItems` by `securityOrigin` or `storageKey`, `IndexedDB.requestDatabaseNames`/`requestDatabase`/`requestData`, and `CacheStorage.requestCacheNames`/`requestEntries`/`requestCachedResponse`. `Storage.getStorageKeyForFrame` answers for an ordinary page's frame, and storage keys aren't secret: a program can write the IdP's (`https://ims-na1.adobelogin.com/`) itself. It can also see the IdP's `Cookie` and `Set-Cookie` headers in an ordinary page's own requests to the IdP (`Network.requestWillBeSentExtraInfo`, `Network.responseReceivedExtraInfo`, `Fetch.requestPaused`) and read those response bodies. Treating the IdP origins as protected for export is planned separately. The hosts the Adobe login UI uses after `/ims/authorize` are not in the catalog. Pages on them are drivable, and their cookies and storage are exportable, until they are added. Federated corporate SSO, MFA and consent hosts can't be enumerated.
556
562
  - The callback match still misses a cut callback wrapped in JSON quotes or in `<>` or `()`, an incomplete `…/auth`, and IdP pages with no callback in their URL. Those rely on the hold.
557
563
 
558
564
  A tab a program creates through the guard opens in the background, behind seven, unless it passes `background: false`. A program that needs seven to keep rendering should open tabs, the default, and not `newWindow`: even unfocused, a new window can cover seven's window, and Chrome then throttles seven ([slicc-extension#105](https://github.com/ai-ecoverse/slicc-extension/issues/105)).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-bios",
3
- "version": "1.74.13",
3
+ "version": "1.74.15",
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",