@orcareplay/core 0.2.3 → 0.2.5-main.g05c6ca2

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.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * fetch with the DESTINATION PINNED — a redirect is a hard failure, never a hand-off.
3
+ *
4
+ * THE ORIGIN CHECK VALIDATES THE URL WE PASS, NOT THE URL THE REQUEST REACHES (orcacode-review).
5
+ * `resolveGateway` decides whether the key may go to this host, and then `fetch` was free to follow
6
+ * a `Location` anywhere. undici strips `authorization` across origins but NOT `x-api-key`, and
7
+ * gatewayHeaders sets both to the same key — so one header from whoever answers for the gateway
8
+ * carried the replay-scoped credential to a host it was never issued for, defeating the promise the
9
+ * README makes in writing: "Never a key to a host it was not set up for."
10
+ *
11
+ * Push had a second failure on top: a 301/302/303 is re-issued as a GET with no body, so the
12
+ * target's 200 satisfied `res.ok` and the CLI printed `push.done` for a run that went nowhere. A
13
+ * 307/308 instead failed with an opaque "fetch failed", because undici cannot replay a detached
14
+ * body — so a legitimately redirecting gateway could not be talked to either.
15
+ *
16
+ * `manual` rather than `error`: Node resolves it with the real status and Location, so the refusal
17
+ * can NAME the destination. `error` rejects with a bare TypeError whose only distinguishing mark is
18
+ * an undici-internal cause string ("unexpected redirect"), which a genuine connection failure
19
+ * ("bad port") is indistinguishable from without matching on that string.
20
+ *
21
+ * Following a same-origin redirect would be safe and is deliberately not implemented: no gateway
22
+ * this CLI talks to issues one, and an unused branch that forwards credentials is the wrong thing
23
+ * to carry.
24
+ *
25
+ * IT LIVES IN core, NOT IN THE PACKAGE THAT FIRST NEEDED IT (orcacode-review, twice).
26
+ *
27
+ * The first version was local to the CLI's sync.ts, so push and pull were pinned and `probeModels`
28
+ * — the third request carrying the same header pair — was not. The second lived beside
29
+ * gatewayHeaders in the CLI's config.ts, which fixed that and left the RECORDING PROXY out: it is
30
+ * handed the very same credential as `upstreamHeaders` and attaches it to both of its live call
31
+ * sites, on the path every `orca record` / `replay --loose` / `compare` / fork takes.
32
+ *
33
+ * Both times the pin sat in the package that noticed the problem rather than in the one every
34
+ * carrier of the credential depends on. core is that package, so this is the last place it can
35
+ * move to.
36
+ */
37
+ export declare function fetchPinned(target: string, init: RequestInit): Promise<Response>;
38
+ //# sourceMappingURL=fetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAWtF"}
package/dist/fetch.js ADDED
@@ -0,0 +1,47 @@
1
+ /**
2
+ * fetch with the DESTINATION PINNED — a redirect is a hard failure, never a hand-off.
3
+ *
4
+ * THE ORIGIN CHECK VALIDATES THE URL WE PASS, NOT THE URL THE REQUEST REACHES (orcacode-review).
5
+ * `resolveGateway` decides whether the key may go to this host, and then `fetch` was free to follow
6
+ * a `Location` anywhere. undici strips `authorization` across origins but NOT `x-api-key`, and
7
+ * gatewayHeaders sets both to the same key — so one header from whoever answers for the gateway
8
+ * carried the replay-scoped credential to a host it was never issued for, defeating the promise the
9
+ * README makes in writing: "Never a key to a host it was not set up for."
10
+ *
11
+ * Push had a second failure on top: a 301/302/303 is re-issued as a GET with no body, so the
12
+ * target's 200 satisfied `res.ok` and the CLI printed `push.done` for a run that went nowhere. A
13
+ * 307/308 instead failed with an opaque "fetch failed", because undici cannot replay a detached
14
+ * body — so a legitimately redirecting gateway could not be talked to either.
15
+ *
16
+ * `manual` rather than `error`: Node resolves it with the real status and Location, so the refusal
17
+ * can NAME the destination. `error` rejects with a bare TypeError whose only distinguishing mark is
18
+ * an undici-internal cause string ("unexpected redirect"), which a genuine connection failure
19
+ * ("bad port") is indistinguishable from without matching on that string.
20
+ *
21
+ * Following a same-origin redirect would be safe and is deliberately not implemented: no gateway
22
+ * this CLI talks to issues one, and an unused branch that forwards credentials is the wrong thing
23
+ * to carry.
24
+ *
25
+ * IT LIVES IN core, NOT IN THE PACKAGE THAT FIRST NEEDED IT (orcacode-review, twice).
26
+ *
27
+ * The first version was local to the CLI's sync.ts, so push and pull were pinned and `probeModels`
28
+ * — the third request carrying the same header pair — was not. The second lived beside
29
+ * gatewayHeaders in the CLI's config.ts, which fixed that and left the RECORDING PROXY out: it is
30
+ * handed the very same credential as `upstreamHeaders` and attaches it to both of its live call
31
+ * sites, on the path every `orca record` / `replay --loose` / `compare` / fork takes.
32
+ *
33
+ * Both times the pin sat in the package that noticed the problem rather than in the one every
34
+ * carrier of the credential depends on. core is that package, so this is the last place it can
35
+ * move to.
36
+ */
37
+ export async function fetchPinned(target, init) {
38
+ const res = await fetch(target, { ...init, redirect: 'manual' });
39
+ if (res.status >= 300 && res.status < 400) {
40
+ const to = res.headers.get('location') ?? '(no Location header)';
41
+ throw new Error(`${target} answered ${res.status} redirecting to ${to}. orca does not follow it: your key is ` +
42
+ `attached to the host you named, and following would hand it to whatever answers there. ` +
43
+ `Point --gateway (or ORCA_GATEWAY_URL) at the final address instead.`);
44
+ }
45
+ return res;
46
+ }
47
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,IAAiB;IACjE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACjE,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC1C,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,sBAAsB,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,aAAa,GAAG,CAAC,MAAM,mBAAmB,EAAE,yCAAyC;YAC5F,yFAAyF;YACzF,qEAAqE,CACxE,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './blobs.js';
2
+ export * from './fetch.js';
2
3
  export * from './graph.js';
3
4
  export * from './paths.js';
4
5
  export * from './reader.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './blobs.js';
2
+ export * from './fetch.js';
2
3
  export * from './graph.js';
3
4
  export * from './paths.js';
4
5
  export * from './reader.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { RedactionRecord } from '@orcareplay/schema';
2
2
  /** Bump when a rule is added or changed, so old traces stay interpretable. */
3
- export declare const REDACTION_POLICY_VERSION = 3;
3
+ export declare const REDACTION_POLICY_VERSION = 4;
4
4
  /** Environment capture is allowlist-only (spec §5). Everything else is denied. */
5
5
  export declare const DEFAULT_ENV_ALLOWLIST: string[];
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"redaction.d.ts","sourceRoot":"","sources":["../src/redaction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,8EAA8E;AAK9E,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,UAUjC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,UAQhC,CAAC;AAEF,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,UAAiB,CAAC;AAEpD,2EAA2E;AAC3E,eAAO,MAAM,YAAY,UAAsD,CAAC;AAOhF;;;GAGG;AACH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAiGjD,MAAM,WAAW,gBAAgB;IAC/B,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,eAAe,EAAE,CAAC;CACzB;AAED;;;;;;;GAOG;AAC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;;;;;;;GAOG;AACH,qBAAa,QAAQ;;gBAKP,IAAI,GAAE,gBAAqB;IAKvC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC;IAOlE,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAcvF,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAY1E,uFAAuF;IACvF,OAAO,IAAI,eAAe,EAAE;IAI5B,UAAU,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAsFrC"}
package/dist/redaction.js CHANGED
@@ -1,10 +1,14 @@
1
1
  import { createHash, randomBytes } from 'node:crypto';
2
+ import { inflateSync } from 'node:zlib';
2
3
  /** Bump when a rule is added or changed, so old traces stay interpretable. */
3
4
  // Bumped when a rule's *name* or pattern changes, because both reach the trace: the placeholder is
4
5
  // `<secret:<kind>:<hash>>`, and a reader comparing two traces needs to know the policy differed
5
6
  // rather than the content. v2 renamed `openai_key` to `sk_api_key`; v3 stopped the entropy sweep
6
- // eating protocol identifiers (`id`, `tool_use_id`, `tool_call_id`).
7
- export const REDACTION_POLICY_VERSION = 3;
7
+ // eating protocol identifiers (`id`, `tool_use_id`, `tool_call_id`); v4 stopped it eating whole
8
+ // PNGs, which is a change in what reaches the trace for exactly the same reason — the same body
9
+ // recorded under v3 and v4 differs, and a reader has to be able to tell that from the content
10
+ // differing.
11
+ export const REDACTION_POLICY_VERSION = 4;
8
12
  /** Environment capture is allowlist-only (spec §5). Everything else is denied. */
9
13
  export const DEFAULT_ENV_ALLOWLIST = [
10
14
  'TERM',
@@ -68,6 +72,358 @@ const RULES = [
68
72
  { kind: 'slack_token', pattern: /xox[baprs]-[A-Za-z0-9-]{10,}/g },
69
73
  { kind: 'google_api_key', pattern: /AIza[0-9A-Za-z_-]{35}/g },
70
74
  ];
75
+ /**
76
+ * A base64 run that decodes to a whole PNG, wherever it sits in the value.
77
+ *
78
+ * The exemption is granted on the payload, not on the syntax around it or the label in front of
79
+ * it, because every argument for it is an argument about *pixels* — and every draft that granted
80
+ * it on something a caller writes was a hole:
81
+ *
82
+ * - the media type, so `data:image/png;base64,<credential>` bought one
83
+ * - the signature, so `iVBORw0KGgo<credential>` bought one
84
+ * - the framing, so `signature + IHDR + IDAT{<credential>} + IEND` with self-consistent lengths
85
+ * bought one
86
+ * - a *valid* container, so a 1×1 image with the credential in a `tEXt` chunk bought one, and a
87
+ * real screenshot with the credential appended inside `IDAT` past the end of the zlib stream
88
+ * bought one, and flipping IHDR's interlace byte skipped the size check altogether
89
+ *
90
+ * So the rule is now the narrowest one that still serves the case this exists for: **every chunk
91
+ * has to be a chunk whose bytes the exemption can account for.** Structure (`IHDR`, `IEND`), the
92
+ * pixel stream (`IDAT`), and a short list of fixed-size ancillary chunks each held to its spec
93
+ * length, with every chunk's CRC checked so its four CRC bytes are not four more of the caller's.
94
+ * Anything else — `tEXt`, `iTXt`, `zTXt`, `iCCP`, `cHRM`, `PLTE`, an unknown type — is a place a
95
+ * caller can put bytes of their choosing, so its presence costs the whole run its exemption and the
96
+ * sweep runs as it always did. Indexed PNGs therefore have no exemption at all, since they cannot
97
+ * be valid without a palette.
98
+ *
99
+ * The pixel stream is checked, not assumed: the concatenated `IDAT` has to inflate, to consume
100
+ * every byte of itself doing so (`inflateSync` stops at the end of the zlib stream and ignores
101
+ * whatever follows, which is where a credential went), and to yield exactly the byte count `IHDR`
102
+ * describes — including the seven-pass sum when the image is interlaced.
103
+ *
104
+ * Measured, on a 1 MB PNG: the chunk walk costs 0.2 ms and the inflate 1.2 ms, against the 55 ms
105
+ * the base64 decode already costs.
106
+ *
107
+ * **PNG only.** JPEG was here and is gone. Its ancillary segments (`COM`, `APPn`) carry arbitrary
108
+ * bytes, its `DQT`/`DHT` payloads are arbitrary within a shape, and its entropy-coded scan cannot
109
+ * be told from a credential without a full Huffman decode — so a JPEG exemption can only ever mean
110
+ * "a marker chain that closes", which is framing, which is what this file kept getting wrong. GIF,
111
+ * BMP, WebP and AVIF went earlier for the same reason. A format with no validator does not get an
112
+ * exemption; it gets the sweep, as it did before any of this. The cost is real and is the right way
113
+ * round: an agent that sends JPEG screenshots still gets them shredded.
114
+ *
115
+ * What this still does not claim: a secret written into the pixels themselves is not detectable
116
+ * here, and no content rule could be — a stored-mode deflate block whose "pixels" are a credential
117
+ * inflates to the declared size like any other. The line is that the payload has to be a picture;
118
+ * a picture cannot be proved innocent.
119
+ */
120
+ /**
121
+ * Whether `code` is a base64 alphabet character.
122
+ *
123
+ * A run used to be found with `/(?:[A-Za-z0-9+/]|\\[/\\])+={0,2}/g`, and a backtracking `+` over a
124
+ * multi-megabyte run overflows V8's regexp stack: measured, `redactString` threw
125
+ * `RangeError: Maximum call stack size exceeded` from `RegExpStringIterator.next` at 8 MB of
126
+ * contiguous base64 — a ~6 MB screenshot, which is the thing this exemption exists to protect. The
127
+ * entropy sweep's own `TOKEN` never had the problem because `+` and `/` are not in its class, so
128
+ * real base64 reaches it as thousands of short matches; this prefilter was the first pattern to run
129
+ * a quantifier across a whole payload, and the same input that the pre-change code walked without
130
+ * complaint at 16 MB threw here. So runs are found by hand, in one left-to-right pass.
131
+ */
132
+ function isBase64Char(code) {
133
+ return ((code >= 0x41 && code <= 0x5a) || // A-Z
134
+ (code >= 0x61 && code <= 0x7a) || // a-z
135
+ (code >= 0x30 && code <= 0x39) || // 0-9
136
+ code === 0x2b || // +
137
+ code === 0x2f // /
138
+ );
139
+ }
140
+ /** Shortest run worth decoding: below this it cannot hold a header and any pixels. */
141
+ const MIN_RASTER_CHARS = 40;
142
+ /**
143
+ * The largest pixel stream worth inflating, as a matter of policy rather than of format.
144
+ *
145
+ * An 8K screenshot at four channels is about 127 MiB of raw pixels, so 256 MiB is roughly double the
146
+ * largest thing anyone is plausibly recording. An IHDR that declares more than this is refused
147
+ * before any memory is committed — otherwise the header itself, which is the caller's to write,
148
+ * would set how much the redactor allocates.
149
+ */
150
+ const MAX_RASTER_RAW_BYTES = 1 << 28;
151
+ const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
152
+ /**
153
+ * Ancillary chunks whose length the spec fixes, mapped to that length.
154
+ *
155
+ * A caller cannot choose how many bytes these hold, and every one of them is shorter than
156
+ * `MIN_ENTROPY_LENGTH`, so none can carry a run the sweep would have redacted. That is the whole
157
+ * admission criterion — not that the chunk is harmless, but that exempting it cannot hide anything
158
+ * the sweep was protecting. Every variable-length chunk is therefore absent, and so is `cHRM`:
159
+ * fixed at 32 bytes, but 32 bytes is long enough to matter.
160
+ *
161
+ * The lengths here are what the caller gets, because the CRCs are checked: four more bytes per
162
+ * chunk that would otherwise be theirs to fill. The largest of these is `pHYs` at nine, so the
163
+ * longest run of chosen bytes any admitted chunk can contribute is twelve base64 characters,
164
+ * against the sweep's threshold of twenty.
165
+ */
166
+ const PNG_FIXED_ANCILLARY = {
167
+ gAMA: 4,
168
+ sRGB: 1,
169
+ pHYs: 9,
170
+ tIME: 7,
171
+ sBIT: 4,
172
+ bKGD: 6,
173
+ };
174
+ /**
175
+ * Bytes per pixel for each PNG colour type; an unlisted type is not one this exemption accepts.
176
+ *
177
+ * Indexed (3) is absent, which means indexed PNGs are swept like any other unvalidated payload. It
178
+ * was here, on the argument that an indexed image's palette *is* its pixels — but that argument
179
+ * does not survive: `PLTE` is up to 768 uncompressed caller-chosen bytes sitting verbatim in the
180
+ * trace, its entries need not be referenced by any pixel, and nothing about it is checked beyond a
181
+ * length that the bit depth alone bounds. `IDAT` is not analogous, because it has to inflate to
182
+ * exactly the size the header declares. Admitting 768 free bytes while rejecting `cHRM` at 32 as
183
+ * "long enough to matter" was the file contradicting its own admission criterion.
184
+ */
185
+ const PNG_CHANNELS = { 0: 1, 2: 3, 4: 2, 6: 4 };
186
+ /** The bit depths each colour type allows. A pairing outside this is not an image a decoder reads. */
187
+ const PNG_DEPTHS = {
188
+ 0: [1, 2, 4, 8, 16],
189
+ 2: [8, 16],
190
+ 4: [8, 16],
191
+ 6: [8, 16],
192
+ };
193
+ /** Adam7: `[xOffset, yOffset, xStep, yStep]` for each of the seven passes. */
194
+ const ADAM7 = [
195
+ [0, 0, 8, 8],
196
+ [4, 0, 8, 8],
197
+ [0, 4, 4, 8],
198
+ [2, 0, 4, 4],
199
+ [0, 2, 2, 4],
200
+ [1, 0, 2, 2],
201
+ [0, 1, 1, 2],
202
+ ];
203
+ /**
204
+ * The exact length of the inflated pixel stream for these image parameters.
205
+ *
206
+ * Each scanline is a filter byte plus its packed samples, and an interlaced image is seven smaller
207
+ * images by the same rule — a pass with no rows or no columns contributes nothing at all, which is
208
+ * what the guard is for rather than tidiness. Skipping this for interlaced images was a hole: it
209
+ * let one IHDR byte buy the exemption for an IDAT holding no pixels.
210
+ */
211
+ function pngRawLength(width, height, channels, depth, interlaced) {
212
+ const rows = (w, h) => w <= 0 || h <= 0 ? 0 : h * (1 + Math.ceil((w * channels * depth) / 8));
213
+ if (!interlaced)
214
+ return rows(width, height);
215
+ let total = 0;
216
+ for (const [x0, y0, dx, dy] of ADAM7) {
217
+ total += rows(Math.ceil((width - x0) / dx), Math.ceil((height - y0) / dy));
218
+ }
219
+ return total;
220
+ }
221
+ /** The CRC-32 lookup table, built once: `0xedb88320` is the reversed polynomial PNG uses. */
222
+ const CRC_TABLE = (() => {
223
+ const table = new Uint32Array(256);
224
+ for (let n = 0; n < 256; n += 1) {
225
+ let c = n;
226
+ for (let k = 0; k < 8; k += 1)
227
+ c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
228
+ table[n] = c >>> 0;
229
+ }
230
+ return table;
231
+ })();
232
+ /**
233
+ * CRC-32 of `data`.
234
+ *
235
+ * Not `zlib.crc32`, which arrived after the oldest runtime this repo supports: `packages/cli`
236
+ * declares `>=20.0.0` and `doctor` enforces major 20, while `zlib.crc32` is newer than that. A
237
+ * named import of it would be `undefined` on such a runtime, and the first screenshot would take
238
+ * the recording down with it — `intercept.ts` looks `zstdDecompressSync` up dynamically for
239
+ * exactly this reason, and `tls-intercept.test.ts` records what the named import did instead.
240
+ *
241
+ * Computing it here rather than looking it up dynamically leaves one implementation, always
242
+ * exercised, instead of a fallback branch that only some runtimes ever run. It costs 0.75 ms on a
243
+ * 381 KB PNG against `zlib.crc32`'s 0.10 ms, which is nothing beside the 55 ms that PNG's base64
244
+ * decode already costs. Every "a real PNG stays exempt" case in the tests builds its CRCs with
245
+ * `zlib.crc32`, so those tests pass only while this agrees with Node's.
246
+ */
247
+ function crc32Of(data) {
248
+ let c = 0xffffffff;
249
+ for (let i = 0; i < data.length; i += 1)
250
+ c = (c >>> 8) ^ CRC_TABLE[(c ^ data[i]) & 0xff];
251
+ return (c ^ 0xffffffff) >>> 0;
252
+ }
253
+ /**
254
+ * Whether the chunk beginning at `at` carries the CRC its own bytes imply.
255
+ *
256
+ * A caller who can set a length can set a CRC too, so this proves nothing about intent. What it
257
+ * does is stop the four CRC bytes of every admitted chunk being four bytes of the caller's
258
+ * choosing — which is the difference between "`pHYs` contributes nine chosen bytes" and "thirteen",
259
+ * and the whole fixed-length argument is a counting argument.
260
+ *
261
+ * The CRC covers the type and the data, not the length field.
262
+ */
263
+ function hasValidCrc(b, at, len) {
264
+ return crc32Of(b.subarray(at + 4, at + 8 + len)) === b.readUInt32BE(at + 8 + len);
265
+ }
266
+ /**
267
+ * Whether these bytes are a PNG this exemption can account for, byte for byte.
268
+ *
269
+ * IHDR is read before the walk rather than during it. The spec puts it first, at a fixed size, and
270
+ * every later decision depends on its fields — so reading it up front is the difference between
271
+ * checking those fields and checking them after something has already used them.
272
+ *
273
+ * The walk then rejects on the first chunk it cannot account for, so an unknown type never reaches
274
+ * the part that grants anything.
275
+ */
276
+ function isWholePng(b) {
277
+ if (!b.subarray(0, 8).equals(PNG_SIGNATURE))
278
+ return false;
279
+ // Signature, then IHDR's length and type: 13 bytes of data at a known offset.
280
+ if (b.length < 33)
281
+ return false;
282
+ if (b.readUInt32BE(8) !== 13 || b.subarray(12, 16).toString('latin1') !== 'IHDR')
283
+ return false;
284
+ if (!hasValidCrc(b, 8, 13))
285
+ return false;
286
+ const width = b.readUInt32BE(16);
287
+ const height = b.readUInt32BE(20);
288
+ const depth = b[24];
289
+ const colour = b[25];
290
+ const interlace = b[28];
291
+ const channels = PNG_CHANNELS[colour];
292
+ if (width === 0 || height === 0 || channels === undefined)
293
+ return false;
294
+ if (!PNG_DEPTHS[colour].includes(depth))
295
+ return false;
296
+ // Compression and filter: the spec defines one value each, and two interlace methods.
297
+ if (b[26] !== 0 || b[27] !== 0 || interlace > 1)
298
+ return false;
299
+ let at = 33; // 8 signature + 4 length + 4 type + 13 data + 4 CRC
300
+ let sawEnd = false;
301
+ const idat = [];
302
+ while (!sawEnd) {
303
+ if (at + 12 > b.length)
304
+ return false;
305
+ const len = b.readUInt32BE(at);
306
+ const type = b.subarray(at + 4, at + 8).toString('latin1');
307
+ const next = at + 12 + len; // length + type + data + CRC
308
+ if (next > b.length)
309
+ return false;
310
+ if (!hasValidCrc(b, at, len))
311
+ return false;
312
+ if (type === 'IDAT') {
313
+ idat.push(Buffer.from(b.subarray(at + 8, at + 8 + len)));
314
+ }
315
+ else if (type === 'IEND') {
316
+ if (len !== 0 || next !== b.length || idat.length === 0)
317
+ return false;
318
+ sawEnd = true;
319
+ }
320
+ else if (type === 'IHDR') {
321
+ return false; // exactly one, already read
322
+ }
323
+ else {
324
+ const fixed = PNG_FIXED_ANCILLARY[type];
325
+ // A chunk whose size the caller picks is a chunk the caller can fill.
326
+ if (fixed === undefined || len > fixed)
327
+ return false;
328
+ }
329
+ at = next;
330
+ }
331
+ // The size is known before the inflate, not after it, so the inflate is bounded by it. Deciding
332
+ // afterwards meant a 400 KB IDAT declaring 1×1 could expand to whatever it liked: measured, one
333
+ // 531 KB base64 payload took RSS up by 821 MB, and `--max-old-space-size` does not bound it
334
+ // because zlib writes outside the JS heap. This is the one place in the write path that runs
335
+ // over bytes an agent's tools, an MCP server, or (for `orca scrub`) somebody else's trace file
336
+ // chose.
337
+ const expected = pngRawLength(width, height, channels, depth, interlace === 1);
338
+ if (expected > MAX_RASTER_RAW_BYTES)
339
+ return false;
340
+ const stream = Buffer.concat(idat);
341
+ let raw;
342
+ try {
343
+ // `info: true` for `bytesWritten`, which is the input the stream actually consumed. Without it
344
+ // anything past the end of the zlib stream is never looked at, and `IDAT{<pixels><credential>}`
345
+ // inflates to the declared size with the credential still in the trace. `@types/node` models
346
+ // only the plain-Buffer overload, so the shape is spelled out here; only `bytesWritten` and
347
+ // `buffer` are read from it.
348
+ const result = inflateSync(stream, { info: true, maxOutputLength: expected });
349
+ if (result.engine.bytesWritten !== stream.length)
350
+ return false;
351
+ raw = result.buffer;
352
+ }
353
+ catch {
354
+ // Not a zlib stream, or a stream that wanted more room than the header asked for — which is
355
+ // what a decompression bomb is. Either way: not an image, so the sweep runs as it always did.
356
+ return false;
357
+ }
358
+ return raw.length === expected;
359
+ }
360
+ /** Whether these bytes are one complete image this exemption can account for. */
361
+ function isWholeRasterImage(b) {
362
+ if (b.length < 16)
363
+ return false;
364
+ return isWholePng(b);
365
+ }
366
+ /**
367
+ * The spans of `value` that are whole raster images.
368
+ *
369
+ * The signature is checked before anything is decoded, so a long run that is not an image costs
370
+ * six characters rather than a decode — which matters because this runs over every string a trace
371
+ * writes.
372
+ */
373
+ function rasterSpans(value) {
374
+ const spans = [];
375
+ let at = 0;
376
+ while (at < value.length) {
377
+ const start = at;
378
+ // One maximal run of the base64 alphabet, `\/` and `\\` counting as the character they stand
379
+ // for. Advancing to the run's end rather than past its first character is what keeps this
380
+ // linear: a signature *inside* a run does not start one, so there is nothing to come back for.
381
+ while (at < value.length) {
382
+ const code = value.charCodeAt(at);
383
+ if (isBase64Char(code)) {
384
+ at += 1;
385
+ continue;
386
+ }
387
+ if (code === 0x5c) {
388
+ const next = value.charCodeAt(at + 1);
389
+ if (next === 0x2f || next === 0x5c) {
390
+ at += 2;
391
+ continue;
392
+ }
393
+ }
394
+ break;
395
+ }
396
+ if (at === start) {
397
+ at += 1;
398
+ continue;
399
+ }
400
+ // Padding only where padding belongs. `Buffer.from(x, 'base64')` stops at the first `=` and
401
+ // ignores the rest, so a run of `<image>==<credential>` decoded to a valid image and the span
402
+ // covered the credential with it. Ending the run at the padding splits the two, and an interior
403
+ // `=` ends a run for the same reason.
404
+ let end = at;
405
+ for (let pad = 0; pad < 2 && value.charCodeAt(end) === 0x3d; pad += 1)
406
+ end += 1;
407
+ at = end;
408
+ // `iVBORw` is what a PNG signature looks like once base64-encoded.
409
+ if (end - start < MIN_RASTER_CHARS || !value.startsWith('iVBORw', start))
410
+ continue;
411
+ // `\/` and `\\` stand for payload characters; they are stripped before decoding and the span
412
+ // still covers them, or the sweep would resume inside the image.
413
+ const payload = value.slice(start, end).replace(/\\(.)/g, '$1');
414
+ let bytes;
415
+ try {
416
+ bytes = Buffer.from(payload, 'base64');
417
+ }
418
+ catch {
419
+ continue;
420
+ }
421
+ if (!isWholeRasterImage(bytes))
422
+ continue;
423
+ spans.push([start, end]);
424
+ }
425
+ return spans;
426
+ }
71
427
  const TOKEN = /[A-Za-z0-9_-]{20,}/g;
72
428
  const PLACEHOLDER = /<secret:[a-z_]+:[0-9a-f]{8}>/g;
73
429
  const MIN_ENTROPY_LENGTH = 20;
@@ -129,7 +485,19 @@ const PROTOCOL_ID_VALUE = /(\\*")(?:id|tool_use_id|tool_call_id)\1\s*:\s*\1[A-Za
129
485
  * keeping it costs no secrecy that was not already spent.
130
486
  */
131
487
  const PROTOCOL_SIGNATURE_VALUE = /(\\*")signature\1\s*:\s*\1[A-Za-z0-9+/=_-]*\1/g;
132
- /** Regions the entropy sweep must not touch: what it already replaced, and what is not a secret. */
488
+ /**
489
+ * Regions the entropy sweep must not touch: what it already replaced, and what is not a secret.
490
+ *
491
+ * Returned sorted by start, which is what {@link Redactor.redactString}'s sweep relies on to test
492
+ * containment in one pass rather than one scan of the whole list per token.
493
+ *
494
+ * The rasters are appended one at a time, not spread. `push(...spans)` passes one argument per
495
+ * element and V8 stops at about 125k of them — and a string can hold one span per image, so ~130k
496
+ * of the smallest PNG this file accepts (a 1×1 greyscale, 92 base64 characters: about 12 MB of
497
+ * payload, which any tool result or MCP frame can carry) raised
498
+ * `RangeError: Maximum call stack size exceeded` from here, out through `redactString`, with
499
+ * nothing on the write path to catch it.
500
+ */
133
501
  function spansOf(value) {
134
502
  const spans = [];
135
503
  for (const m of value.matchAll(PLACEHOLDER))
@@ -139,7 +507,9 @@ function spansOf(value) {
139
507
  for (const m of value.matchAll(PROTOCOL_SIGNATURE_VALUE)) {
140
508
  spans.push([m.index, m.index + m[0].length]);
141
509
  }
142
- return spans;
510
+ for (const span of rasterSpans(value))
511
+ spans.push(span);
512
+ return spans.sort((a, b) => a[0] - b[0]);
143
513
  }
144
514
  /**
145
515
  * Write-path redactor (spec §5).
@@ -220,10 +590,27 @@ export class Redactor {
220
590
  const spans = spansOf(value);
221
591
  let out = '';
222
592
  let cut = 0;
593
+ // `spans.some(...)` per token walked the whole list every time, which is quadratic once a value
594
+ // holds many images — measured, 40k small PNGs cost 2.7 s against 0.14 s before the exemption
595
+ // existed. Spans arrive sorted by start and `matchAll` yields tokens the same way, so one
596
+ // cursor carrying the furthest end seen so far answers the same question in a single pass:
597
+ // `reach` is max(b) over every span with a <= start, and a token is inside one of them exactly
598
+ // when it ends at or before that.
599
+ let cursor = 0;
600
+ let reach = -1;
223
601
  for (const m of value.matchAll(TOKEN)) {
224
602
  const token = m[0];
225
603
  const start = m.index;
226
- if (spans.some(([a, b]) => start >= a && start < b))
604
+ while (cursor < spans.length && spans[cursor][0] <= start) {
605
+ if (spans[cursor][1] > reach)
606
+ reach = spans[cursor][1];
607
+ cursor += 1;
608
+ }
609
+ // Wholly inside, not merely starting inside. A TOKEN is `[A-Za-z0-9_-]+`, which runs on
610
+ // past an image payload through a `_` or `-` that base64 has no use for — so a token that
611
+ // began in the image and ended in a credential was skipped entire, and the credential with
612
+ // it. Overlap would be wrong the other way: it would exempt text outside the image.
613
+ if (start + token.length <= reach)
227
614
  continue;
228
615
  if (token.length < MIN_ENTROPY_LENGTH || !looksRandom(token))
229
616
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"redaction.js","sourceRoot":"","sources":["../src/redaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGtD,8EAA8E;AAC9E,mGAAmG;AACnG,gGAAgG;AAChG,iGAAiG;AACjG,qEAAqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,kFAAkF;AAClF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,MAAM;IACN,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,IAAI;IACJ,MAAM;IACN,KAAK;CACN,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,eAAe;IACf,WAAW;IACX,2EAA2E;IAC3E,SAAS;IACT,gBAAgB;IAChB,QAAQ;IACR,qBAAqB;CACtB,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,CAAC,CAAC;AAEpD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,GAAG,oBAAoB,EAAE,GAAG,qBAAqB,CAAC,CAAC;AAOhF;;;GAGG;AACH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEjD,MAAM,KAAK,GAAW;IACpB;QACE,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,mFAAmF;KAC7F;IACD,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,gEAAg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BAC7B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orcareplay/core",
3
- "version": "0.2.3",
3
+ "version": "0.2.5-main.g05c6ca2",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "dist"
18
18
  ],
19
19
  "dependencies": {
20
- "@orcareplay/plugin-api": "0.2.3",
21
- "@orcareplay/schema": "0.2.3"
20
+ "@orcareplay/plugin-api": "0.2.5-main.g05c6ca2",
21
+ "@orcareplay/schema": "0.2.5-main.g05c6ca2"
22
22
  }
23
23
  }