Skip to content

Correct SES sandbox lockdown initialization - #818

Closed
xdCloudy wants to merge 2 commits into
mindcraft-bots:developfrom
xdCloudy:fix/ses-lockdown
Closed

Correct SES sandbox lockdown initialization#818
xdCloudy wants to merge 2 commits into
mindcraft-bots:developfrom
xdCloudy:fix/ses-lockdown

Conversation

@xdCloudy

Copy link
Copy Markdown

Summary

Fix SES sandbox initialization so Mindcraft actually invokes SES lockdown() instead of recursively calling its own wrapper.

Problem

The current sandbox initialization helper shadows the global SES lockdown function with a local function of the same name. When the helper attempts to initialize SES, it calls itself recursively. The guard flag prevents an infinite loop, but the real SES lockdown configuration is never applied.

This means generated-code execution can continue without the hardening that the surrounding code expects to have enabled.

Changes

  • Rename the local initialization wrapper so it no longer shadows SES lockdown
  • Explicitly invoke globalThis.lockdown(...)
  • Preserve the existing one-time initialization guard
  • Keep the existing sandbox configuration and Compartment usage unchanged

Why

The generated-code path relies on SES as a security boundary. Failing to initialize lockdown correctly weakens that boundary and makes the runtime behavior differ from what the code intends.

Compatibility

No profile, command, model, or generated-code API changes are introduced. This only fixes sandbox initialization.

Validation

Validated on the fork CI matrix with Node 20 and Node 22, including dependency installation and JavaScript syntax checks.

@Sweaterdog

Copy link
Copy Markdown
Contributor

quit spamming our repo with slop

@Sweaterdog Sweaterdog closed this Aug 18, 2026
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.

2 participants