GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(sandbox): undefine the raw fetch host bridge before user code runs by waleedlatif1 · Pull Request #6761 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • executeCode installed the __fetchRef host bridge as an isolate global but omitted it from the bootstrap's undefined_globals, so user code ran with a live raw ivm.Reference in scope
  • Capture the bridge in the fetch closure and add __fetchRef to the hardening list, matching the pattern sim/executeTask already use
  • Add a regression test asserting every ivm.Reference bridge set as an isolate global is undefined before user code runs

Type of Change

  • Bug fix

Testing

Drove the real worker over its IPC protocol before/after: typeof __fetchRef goes "object" -> "undefined", while fetch(), console, and sim.* keep working. Not exploitable on the pinned isolated-vm 6.1.2 (Reference#get does not traverse prototypes) - this is defense-in-depth so a version bump cannot turn it into worker-process code execution.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@waleedlatif1
fix(sandbox): undefine the raw fetch host bridge before user code runs
4c4b208
@vercel

vercel Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 16, 2026 1:47am

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview August 16, 2026 01:38 Inactive
@cursor

cursor Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes sandbox bootstrap and global hardening on the user-code execution path; behavior of fetch must stay correct while removing a host bridge from the isolate global scope.

Overview
Defense-in-depth for the executeCode isolated-vm path: user code could still see a live __fetchRef ivm.Reference global because the bootstrap never removed it after wiring fetch.

The bootstrap now captures __fetchRef in an IIFE closure, installs fetch via Object.defineProperty, and adds __fetchRef to the same undefined_globals hardening list used for __brokerRef and isolated-vm escape globals—aligned with how sim and executeTask already treat host bridges.

A new static regression test (isolated-vm-worker-hardening.test.ts) parses each execution path in the worker and asserts every jail.set('__*Ref', …) bridge is listed in that path’s undefined_globals, plus the standard escape globals.

Reviewed by Cursor Bugbot for commit 99e4a61. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR prevents user code from accessing the raw fetch host reference while preserving the sandboxed fetch API.

  • Captures __fetchRef inside the fetch closure before hardening globals.
  • Adds __fetchRef to the executeCode hardening list.
  • Adds per-execution-path regression coverage for exposed ivm.Reference bridges.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/lib/execution/isolated-vm-worker.cjs Captures the fetch bridge in a closure and removes its raw global binding before user code executes.
apps/sim/lib/execution/isolated-vm-worker-hardening.test.ts Verifies each execution path independently hardens all currently installed raw-reference bridges, resolving the previous global-list matching issue.

Reviews (3): Last reviewed commit: "fix(sandbox): preserve the fetch global'..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot]
greptile-apps Bot reviewed Aug 16, 2026
View reviewed changes
Comment thread apps/sim/lib/execution/isolated-vm-worker-hardening.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
test(sandbox): scope the hardening assertions to each execution path
b763250
@vercel
vercel Bot temporarily deployed to Preview August 16, 2026 01:41 Inactive
@waleedlatif1

waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b763250. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
fix(sandbox): preserve the fetch global's property attributes
99e4a61
@vercel
vercel Bot temporarily deployed to Preview August 16, 2026 01:47 Inactive
@waleedlatif1

waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Aug 16, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 99e4a61. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 merged commit 6e5c337 into staging Aug 16, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the fix/sandbox-fetchref-hardening branch August 16, 2026 01:54
@waleedlatif1 waleedlatif1 mentioned this pull request Aug 16, 2026
v0.8.3: sim cli, new tools, credential groups, splunk, finder-like files refactor, security hardening #6765
Merged

This branch was previously deployed

1 inactive deployment
Preview — 99e4a616 Deployed Aug 16, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@greptile-apps greptile-apps[bot] greptile-apps[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.