@botiverse/porthole 0.14.3 → 0.14.5

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 (45) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/check/page-source.js +1 -1
  3. package/dist/conformance/harness-source.js +1 -1
  4. package/dist/host/create-host.js +2 -0
  5. package/dist/host/locate.d.ts +1 -1
  6. package/dist/host/locate.js +2 -2
  7. package/dist/host/outcome.d.ts +4 -0
  8. package/dist/host/outcome.js +43 -0
  9. package/dist/host/types.d.ts +12 -4
  10. package/dist/isolation/served.d.ts +17 -1
  11. package/dist/isolation/served.js +24 -1
  12. package/dist/isolation/types.d.ts +5 -0
  13. package/dist/isolation/types.js +5 -0
  14. package/dist/platform/focus-guard.d.ts +40 -0
  15. package/dist/platform/focus-guard.js +176 -32
  16. package/dist/platform/web.js +24 -9
  17. package/dist/react/frame.d.ts +2 -1
  18. package/dist/server/files.js +7 -7
  19. package/dist/server/index.d.ts +1 -1
  20. package/dist/server/index.js +1 -1
  21. package/dist/server/nested.d.ts +13 -7
  22. package/dist/server/nested.js +31 -9
  23. package/dist/server/server.js +5 -2
  24. package/dist/shell/frame.d.ts +5 -2
  25. package/dist/shell/frame.js +41 -18
  26. package/docs/ADOPTING.md +37 -14
  27. package/docs/ARCHITECTURE.md +5 -1
  28. package/docs/DECISIONS.md +404 -2
  29. package/docs/DESIGN.md +11 -4
  30. package/docs/THREAT_MODEL.md +116 -32
  31. package/package.json +1 -1
  32. package/src/host/create-host.ts +2 -0
  33. package/src/host/locate.ts +2 -2
  34. package/src/host/outcome.ts +49 -0
  35. package/src/host/types.ts +12 -4
  36. package/src/isolation/served.ts +29 -0
  37. package/src/isolation/types.ts +6 -0
  38. package/src/platform/focus-guard.ts +218 -34
  39. package/src/platform/web.ts +29 -12
  40. package/src/react/frame.tsx +2 -1
  41. package/src/server/files.ts +5 -6
  42. package/src/server/index.ts +1 -0
  43. package/src/server/nested.ts +44 -12
  44. package/src/server/server.ts +5 -4
  45. package/src/shell/frame.ts +43 -18
package/CHANGELOG.md CHANGED
@@ -4,6 +4,83 @@
4
4
  section); the reasons for every change are in [docs/DECISIONS.md](docs/DECISIONS.md), by the
5
5
  P-numbers below.
6
6
 
7
+ ## 0.14.5
8
+
9
+ - **Security (P124, after the audit raft-security-audit#16):** any frame could say
10
+ `porthole/notifications/frame-status` (an opaque widget, a served page, an MCP Apps view, a
11
+ nested page through its shell), and the host took it as Porthole's server's word: its `outcome`
12
+ became `blocked` with the content's reason and code, and a host drew its fallback in Porthole's
13
+ wording ("Open this in a new tab to sign in") with a link out. Now an opaque frame's frame status
14
+ is never taken, and a frame that speaks is heard only before anything else it says in the run
15
+ (its first document, a page of Porthole's; content always runs after Porthole's own first word).
16
+ One not taken is no outcome and no code: the host hears a `hostError` of the new kind
17
+ `frame-status`, once a run. A url-mode app's word is taken as before (THREAT_MODEL S6). Changed:
18
+ a frame that speaks no longer tells a later block itself; a display without files starts again
19
+ and its next run says it, and in one with files a page answered by a status page (access revoked)
20
+ shows the server's page in the frame without a `blocked` outcome.
21
+ - **Tests (P124):** `test/outcome.test.ts` ("who may say how loading went"); four forgers in
22
+ `leak/served/outcome.spec.ts` (a served shell's content, an artifact page, an opaque widget, a
23
+ nested page), negative control `frame-status`.
24
+
25
+ ## 0.14.4
26
+
27
+ - **Docs (P123):** a display taking the keyboard is an accepted risk (THREAT_MODEL §5): the guard
28
+ stays best effort, and no new rule covers slower typists. P122's entry says what its reading of
29
+ the typing before an activation loosens (porthole#81).
30
+ - **Security (P122, after 0.14.4's CI):** full Chromium let a nested page that took the keyboard
31
+ while the person typed keep it (its first key reached the page before the shell answered the
32
+ host's ask, and passed for a press). No press of the person's comes within 250 ms of a key they
33
+ typed on the host's page: a move into a nested page's frame, or its shell's activation turning
34
+ on, that soon is taken back as the page's, on every engine. And P120's pointer rule now reads the
35
+ person's typing before the activation, never after (a key typed after a real press, before the
36
+ shell's word came, made it look like a key). Cost: a real press into a nested page within 250 ms
37
+ of typing on the host's page is taken back (no person's hand is that fast).
38
+ - **Tests (P122):** `leak/served/nested-key.spec.ts` (negative control `key-press`); the honest
39
+ cases that type and then press the page pause 400 ms between, as a hand does; the in-set link
40
+ cases (`navigate-guard`'s probes) fail by their verdict when the display restarts under it.
41
+
42
+ - **Changed (P121, after the audit of 0.14.2):** a nested page's shell runs on a `porthole-` label
43
+ of its own alone, outside `/server` too: `createHost` refuses a nested page located on any other
44
+ label (a host error, `locate`; no frame is made), the shell frames nothing and says nothing on
45
+ another origin, and `nestedShellResponse` and `frameShellScript` throw for one. A content Worker
46
+ of a host's own that served the shell on its scope's label (0.14.0's layout) now fails closed.
47
+ - **New (P121):** `nestedFileCsp(role, directives)` from `/server`: a nested page's CSP
48
+ (`sandbox allow-scripts`), a script's (`sandbox`), any other file's (inert), as `/server` sends
49
+ them, for a content Worker of a host's own (ADOPTING "Nested pages").
50
+ - **Docs (P121):** `annotations.clearSelection()` tells the page when the person was done with its
51
+ selection (it sees the clear); ADOPTING now clears on every close of the composer, never only
52
+ when a draft is added (which told the page a draft exists). THREAT_MODEL §6's guard names
53
+ `tracked`, and ADOPTING's React example arms the card again as it moves.
54
+ - **Tests (P121):** `leak/served/nested-siblings.spec.ts` `[nested-label]` (negative control
55
+ `nested-host-label`); `shell-label` now runs with `nested-host-label` and `nested-shell-origin`;
56
+ `test/nested.test.ts` (the helpers' refusals, the shell on another origin, `nestedFileCsp`).
57
+
58
+ - **Security (P120, porthole#56, the audit's NG-1):** on Firefox a nested page that focused its
59
+ field as it loaded, and again whenever it lost focus, got everything the person typed in the
60
+ host's composer and was never stopped: the guard waited for the shell's word on the page's move,
61
+ and the person's next key, landing in the page, turned the shell's activation on as a press
62
+ would. Now a nested frame that takes focus again while the guard is taking it back is judged as
63
+ any frame is (a Tab, the host's own move, a press the engine shows), taken back at once and
64
+ counted toward the stop, and an activation it reports then is no gesture (`comments.open`
65
+ included); a wait never ends with the frame let be; the host asks the shell to look as it hears
66
+ a move (`porthole/shell/look`), so a key typed a frame later can't pass for a press; and where
67
+ the host's page sees the pointer over its frames (Firefox, and frames in the host's process), an
68
+ activation with the pointer elsewhere, within a second of typing on the host's page, is no press.
69
+ Measured: Firefox, at most 2 keys of a sentence to the page, stopped. Cost: a press back into
70
+ the page within 300 ms of focus going back to the host's field is taken back on full Chromium.
71
+ Residual on full Chromium (neither the host nor the shell sees the pointer there): a key typed
72
+ before the shell answers the ask passes for a press, the page keeping the keyboard and getting
73
+ `comments.open`; and so, more often, on Chromium with the page's frames in the host's process
74
+ (Chrome on Android, the headless shell) until the host has seen the pointer over one of its
75
+ frames (THREAT_MODEL §7). After its review, whether a key passes for a press is judged when the
76
+ activation turns on, not a second later.
77
+ - **Tests (P120):** `leak/served/nested.spec.ts`: a page that holds the keyboard from its load and
78
+ takes it back on its own blur (negative control `nested-fight`); `leak/served/nested-keyboard.spec.ts`:
79
+ one that starts while the person types (its `comments.open` on a key it got reaches no handler; a
80
+ race, no control's probe); the guard driven directly: an activation that came as the person typed,
81
+ the pointer elsewhere, is no gesture (negative control `pointer-rule`). `test/nested.test.ts`:
82
+ the pointer rule, and the shell's answer to the host's ask.
83
+
7
84
  ## 0.14.3
8
85
 
9
86
  - **Changed (P119, part of porthole#42):** on touch, an annotation marker takes a tap anywhere in a