Skip to content

docs(ses): document Compartment availability and OOM limits (#2742)#3275

Open
kriskowal wants to merge 1 commit into
masterfrom
kriskowal-compartment-oom-docs-2742
Open

docs(ses): document Compartment availability and OOM limits (#2742)#3275
kriskowal wants to merge 1 commit into
masterfrom
kriskowal-compartment-oom-docs-2742

Conversation

@kriskowal

Copy link
Copy Markdown
Member

Closes: #2742

Description

Adds a Limitations section to docs/lockdown.md covering three classes of threat a Compartment cannot mitigate, all intrinsic to running multiple compartments inside a single JavaScript agent: availability (one compartment can deny synchronous progress to all siblings), memory exhaustion (an OOM in one compartment can surface as a partial-update integrity failure inside an unrelated synchronous call), and timing side-channels (any asynchronous boundary the guest can drive recovers wall-clock duration, regardless of the deliberate omission of Date, performance.now, and host timers from the default Compartment).

Each subsection states what the threat is, why a Compartment cannot address it, and what host-level remedies exist (chiefly, running the suspect guest in a separate worker or process, plus rate-throttling and timing-padding for the side-channel case). The timing section cites Agoric's Taxonomy of Security Issues for the broader catalog this section samples.

The new section is cross-linked from packages/ses/README.md's Compartment section so readers reach it from the place Compartment is introduced.

Security Considerations

The change is documentation only; it introduces no new code, authority, or API surface. Its purpose is to make existing security properties of Compartment legible to integrators, so hosts can make informed choices about when a single-agent compartment is sufficient and when a coarser boundary (separate worker or process) is required. The doc is careful to mark the timing-side-channel discussion as a sample of a broader threat space rather than a complete catalog.

Scaling Considerations

None.

Documentation Considerations

The text lives in the existing docs/lockdown.md so downstream documentation toolchains pick it up without configuration changes. The README cross-link is a relative path within the same monorepo (../../docs/lockdown.md#limitations). No deployed-data migration.

Testing Considerations

No code under test.

Compatibility Considerations

None; documentation only.

Upgrade Considerations

None.

@changeset-bot

changeset-bot Bot commented May 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: debd645

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

kriskowal added a commit to kriskowal/garden that referenced this pull request May 21, 2026
…partment OOM docs, 4-of-5 squash with AGENTS.md exclusion)
@kriskowal kriskowal requested a review from erights May 21, 2026 12:06
@kriscendobot

Copy link
Copy Markdown

Mirror of endojs/endo-but-for-bots#68 (head 4d8ed6b).

@kriskowal kriskowal force-pushed the kriskowal-compartment-oom-docs-2742 branch from 4d8ed6b to 8a90ca3 Compare May 29, 2026 20:02
Adds a Limitations section to docs/lockdown.md describing three classes
of threat that a Compartment cannot mitigate, all intrinsic to running
multiple compartments inside a single JavaScript agent.

Availability: every compartment shares the agent's single thread, so a
guest that enters a non-terminating synchronous computation (an infinite
loop, runaway recursion, or any other unresponsive synchronous call,
including via a property accessor, proxy trap, or synchronously-resolved
`then` callback) denies progress to every sibling and to the start
compartment until the engine intervenes. Host code that wants to remain
available must interact with guest objects across an asynchronous
boundary, or run the guest in a separate worker or process where it can
be terminated.

Memory exhaustion: the ECMAScript specification does not require an
engine to abort the agent on OOM (see the TC39 OOM-fails-fast proposal),
so a malicious compartment can intentionally exhaust memory and surface
a `RangeError` or other allocation failure inside an unrelated
synchronous call, including one into an object exported from another
compartment. The victim is then left in a partially updated state,
turning the availability concern into an integrity concern on otherwise
trusted exports.

Timing side-channels: the default Compartment deliberately excludes
`Date`, `performance.now`, `setTimeout`, `setImmediate`, and every other
host scheduling primitive, but any asynchronous boundary the guest can
drive (another worker, another process, a network peer, a host-supplied
promise resolved on a host-driven schedule) recovers wall-clock duration
from the round-trip. Defeating timing side-channels therefore requires
auditing every reachable async boundary, not just enumerating timer-like
APIs; the host's mitigation menu includes running the suspect guest in a
separate worker or process, throttling outbound message rate, and
padding guest-visible message delivery so the round-trip distribution
conveys less about host-internal events. For the broader threat
catalog, the section cites Agoric's Taxonomy of Security Issues paper.

The new section is cross-linked from packages/ses/README.md's
Compartment section so readers reach it from the place Compartment is
introduced.

Fixes #2742
@kriskowal kriskowal force-pushed the kriskowal-compartment-oom-docs-2742 branch from 8a90ca3 to debd645 Compare June 3, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Compartment availability and OOM limitations

2 participants