Skip to content

Commit fffb8f4

Browse files
sirtimidclaude
andcommitted
fix(ocap-kernel): harden makeAllowedGlobals output in VatSupervisor
Defense-in-depth restoration of the harden() call the pre-snaps constructor used to apply to `allowedGlobals`. `createDefaultEndowments` already hardens its output, but `makeAllowedGlobals` is a public seam (see the exported `VatEndowments` type) — a custom factory returning unhardened globals would hand a vat mutable references to its own endowments, defeating attenuation. `harden` is idempotent and deep, so this is a no-op on the default path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1620287 commit fffb8f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/ocap-kernel/src/vats/VatSupervisor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ export class VatSupervisor {
155155
this.#platformOptions = platformOptions ?? {};
156156
this.#makePlatform = makePlatform;
157157
const { globals, teardown } = makeAllowedGlobals();
158-
this.#allowedGlobals = globals;
158+
// Defense in depth: custom `makeAllowedGlobals` factories may skip hardening.
159+
this.#allowedGlobals = harden(globals);
159160
this.#endowmentsTeardown = teardown;
160161

161162
this.#rpcClient = new RpcClient(

0 commit comments

Comments
 (0)