@botiverse/porthole 0.14.18 → 0.15.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/CHANGELOG.md CHANGED
@@ -4,6 +4,88 @@
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.15.1
8
+
9
+ After Ferryman's audit of 0.15.0 (P145, amends P143 and P144): no P0, no escape, no new egress,
10
+ and no way found for an embed session's `frame-ancestors *` to reach another session. Four fixes:
11
+
12
+ - **"Byte for byte", said as it holds.** 0.15.0 said the default path (no `framedBy`, no embed) was
13
+ 0.14.16's again, byte for byte. Every header was (every CSP, `frame-ancestors` and `script-src`
14
+ hash, every cookie and cache header), and so were the status, entry and door pages' scripts and
15
+ the nested page's shell. The shell runtime that a served shell, an artifact page, a file set's
16
+ pages and the MCP Apps proxy inline was not: it carries P142's changes (0.14.18) and P143's
17
+ `hostless` branches, inert wherever a plan names a host. Nothing a browser does changed, and no
18
+ hash covers that runtime; the claim did. DECISIONS, THREAT_MODEL and 0.15.0's lines above now say
19
+ what holds, and a test pins the runtime's bytes, so a change to them is said in this file.
20
+ - **The host kit never mints an embed session from `access`.** 0.15.0's `embeds` doc said "whether
21
+ `access` may answer an embed grant", but `access` answers your readers (the issue endpoint, a
22
+ clean address), which must never mint one. Now an `access` answer with `embed` is refused: 409
23
+ `refused` from the issue endpoint and a clean address's resolve, and the kit's 409 page at a clean
24
+ address's tab, with `embeds` or without. **If you answered `embed` from `access`**, mint it from a
25
+ route of your own instead: `host.server.issue(instance, { anonymous: true, embed: true })`.
26
+ - **What an embed page learns of where it is, documented** (THREAT_MODEL S4, ADOPTING `embeds`):
27
+ its request's `Referer` and `document.referrer` name your outer page, and
28
+ `location.ancestorOrigins` names every ancestor, the embedding site included (measured in
29
+ Chromium, Firefox and WebKit), so a page with any egress can report where it is shown.
30
+ - **Ports and hosts as a browser serializes them.** A host origin's or `framedBy`'s port is 1 to
31
+ 65535, without a leading zero, and an `http`/`https` host is as the URL parser gives it: `:0`,
32
+ `:99999`, `:0443` and `https://0x7f.0.0.1` now throw in `createServer`, the host kit and every
33
+ helper that takes them (each matched nothing before). A default port (`:443`) is still taken.
34
+ - **Tests:** the `embed-origins` control could fail `[embed.unheard]` before its verdict on a loaded
35
+ box (a weakened shell drew the hostile document before its own); the probe now waits for either
36
+ and judges at its verdict, and its document arrives in two parts so the early words are covered
37
+ on every run.
38
+ - **Security (P145):** a narrowing: the kit refuses what it used to pass on, and malformed origins
39
+ throw. No CSP, sandbox, egress or gate changes.
40
+
41
+ ## 0.15.0
42
+
43
+ - **Embedded documents (P143): `Grant.embed`.** A public artifact page any site may frame, with no
44
+ host: the host's own outer page (no host itself) frames it, and any site frames that page.
45
+ `createServer({ embeds: true })` and `createContentHost({ embeds: true })` opt in (default off);
46
+ then `issue` takes `{ anonymous: true, embed: true }`, for an artifact's page that isn't nested,
47
+ with no `level` or `user` (anything else throws, as do `enterBy` and `doorAnswer` with it). The
48
+ flag is signed into the session (and the sealed files' address), its cookie has a name of its own
49
+ (`__Host-porthole-e-<key>`), and `authorize.check` is told `embed: true`. Every answer of such a
50
+ session says `frame-ancestors *`; its plan names no host, so the shell asks no host, ends its
51
+ handshake at once (`data-porthole-host="none"`), says nothing to any parent and hears no one; no
52
+ door is minted and `issue` says `reports: false`. `statusPage` and `doorStatusResponse` take
53
+ `embed: true` for a content Worker's own answers before such a session exists. With `embeds` off,
54
+ an embed ticket, cookie or address opens nothing.
55
+ - **Security (P143):** a loosening, bounded: `*` for an embed session's answers alone, a session
56
+ the host minted on purpose, with no viewer, no level, no host function and no channel to any
57
+ parent. Every other session's answers are, byte for byte, what the same server without `embeds`
58
+ answers, while an embed session of the same artifact exists (not 0.14.18's: the shell runtime
59
+ they inline carries P143's inert `hostless` branches; said so in 0.15.1, P145); cookies stay
60
+ host-only (`__Host-`, never `Domain=`).
61
+ Negative controls `embed-ancestors`, `embed-handshake`, `embed-origins`.
62
+ - **`framedBy` after Ferryman's audit of 0.14.17 and 0.14.18 (P144, amends P141).** No P0 and no
63
+ new egress; four fixes:
64
+ - *Without `framedBy`, 0.14.16's scripts again, byte for byte.* 0.14.17 kept every
65
+ `frame-ancestors` and behaviour without `framedBy`, but the status, entry and door pages'
66
+ scripts and the nested page's shell carried its strict check on every path, so their bytes and
67
+ `script-src` hashes changed, against 0.14.17's "every response is as before". Now without
68
+ `framedBy` (and without an embed) they are 0.14.16's, and a test pins their hashes to 0.14.16's.
69
+ A page whose parent may be an outer page loads `/__porthole/status-strict.js` or
70
+ `/__porthole/enter-strict.js` (0.14.17's scripts); a door and a nested shell carry the strict
71
+ script inline as before.
72
+ - *The nesting `framedBy` is for, documented.* With the outer page above your app's page above
73
+ content, content can `postMessage` the outer page and every frame in its tree and learn the
74
+ outer page's origin (Chromium, Firefox). **If an outer page frames your app**, its authors must
75
+ check `event.source` and `event.origin` in every message listener, on the outer page and in
76
+ its frames; THREAT_MODEL's S7 egress rule (a page's egress is the union of its frames') now
77
+ covers the outer page's frames too.
78
+ - *Origins compared as browsers serialize them.* A host origin given again as `framedBy` with
79
+ or without its default port (`https://app.example.com:443`) now throws ("a host origin
80
+ already"), in `createServer`, the host kit and every helper that takes `framedBy`; an outer page
81
+ named twice so is named once.
82
+ - *ADOPTING's nested-page rows* (the page, its files, an ended token) name `<framedBy>` in
83
+ `frame-ancestors`: a content Worker copied from them showed a blank frame below the outer page.
84
+ - **Security (P144):** nothing is loosened. On the default path every header and the four scripts
85
+ are 0.14.16's again (the shell runtime that served documents inline is not: P142's and P143's
86
+ changes, inert there; said so in 0.15.1, P145); with `framedBy`, the scripts and rules are
87
+ 0.14.17's, and a host origin is now refused as `framedBy` under a second spelling.
88
+
7
89
  ## 0.14.18
8
90
 
9
91
  - **A set's pages without the Navigation API, and links within a page (P142).** In Safari before 26