Problem or use case
Forward and reverse membrane wrapper caches are currently module-scoped. When two sandbox instances receive the same mutable host object identity through permitted capability graphs, they can reuse one wrapper. The prototype therefore does not guarantee independent wrapper ownership in this shared-object scenario.
Proposed change
Move forward and reverse membrane cache ownership to the sandbox or Arena created by buildSandbox(). Ensure sandbox disposal releases the associated state.
Alternatives considered
Keeping module-scoped caches preserves broad reuse but couples independent QuickJS contexts. A globally keyed cache would retain the same ownership ambiguity. Per-sandbox caches match the documented one-context-per-library isolation model.
Security and compatibility impact
The change strengthens boundary independence for shared mutable host objects. It must preserve expected identity reuse within one sandbox and not expose new host capabilities.
Primary scope
QuickJS runtime, membrane, or marshalling.
Acceptance criteria
Would you like to contribute an implementation?
Implementation contributions are welcome. Please include a narrow reproducer before changing cache ownership or lifecycle behavior.
Problem or use case
Forward and reverse membrane wrapper caches are currently module-scoped. When two sandbox instances receive the same mutable host object identity through permitted capability graphs, they can reuse one wrapper. The prototype therefore does not guarantee independent wrapper ownership in this shared-object scenario.
Proposed change
Move forward and reverse membrane cache ownership to the sandbox or Arena created by
buildSandbox(). Ensure sandbox disposal releases the associated state.Alternatives considered
Keeping module-scoped caches preserves broad reuse but couples independent QuickJS contexts. A globally keyed cache would retain the same ownership ambiguity. Per-sandbox caches match the documented one-context-per-library isolation model.
Security and compatibility impact
The change strengthens boundary independence for shared mutable host objects. It must preserve expected identity reuse within one sandbox and not expose new host capabilities.
Primary scope
QuickJS runtime, membrane, or marshalling.
Acceptance criteria
Would you like to contribute an implementation?
Implementation contributions are welcome. Please include a narrow reproducer before changing cache ownership or lifecycle behavior.