Skip to content

Restrict bubblewrap /proc and /dev exposure - #35

Open
mrjf with Copilot wants to merge 10 commits into
mainfrom
copilot/fix-bubblewrap-proc-dev-mounts
Open

Restrict bubblewrap /proc and /dev exposure#35
mrjf with Copilot wants to merge 10 commits into
mainfrom
copilot/fix-bubblewrap-proc-dev-mounts

Conversation

Copilot AI commented May 16, 2026

Copy link
Copy Markdown
Contributor

The bubblewrap sandbox was mounting full /proc and /dev, exposing process metadata and device nodes to sandboxed scripts. This narrows the sandbox surface to only the device files needed by typical execution.

  • Sandbox mounts

    • Removed full /proc mount.
    • Replaced full /dev mount with explicit device binds:
      "--dev-bind", "/dev/null", "/dev/null",
      "--dev-bind", "/dev/zero", "/dev/zero",
      "--dev-bind", "/dev/urandom", "/dev/urandom",
  • Shared bwrap helper

    • Aligned buildBwrapCommand() with the runtime server’s restricted device policy.
  • Tests

    • Updated bwrap unit coverage to assert full /proc and /dev are not mounted, while required minimal devices remain available.

Copilot AI linked an issue May 16, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix full mounts of /proc and /dev in bubblewrap sandbox Restrict bubblewrap /proc and /dev exposure May 16, 2026
Copilot AI requested a review from mrjf May 16, 2026 14:18
Copilot finished work on behalf of mrjf May 16, 2026 14:18
@mrjf
mrjf marked this pull request as ready for review May 16, 2026 16:43
@mrjf

mrjf commented May 16, 2026

Copy link
Copy Markdown
Owner

@copilot fix ci tests

Copilot AI commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix ci tests

Fixed in 0311cb0 by creating /dev inside the sandbox before binding the minimal device nodes. I reproduced the /dev/null permission failure locally and verified the fix with focused bwrap tests, typecheck, the full test suite, and validation.

Copilot finished work on behalf of mrjf May 16, 2026 16:48
@mrjf

mrjf commented May 17, 2026

Copy link
Copy Markdown
Owner

@copilot fix ci

Copilot AI commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix ci

Fixed in 3c272d7. I addressed the failing skill-test paths by retrying GitHub’s eventual-consistency issue visibility check and the transient Base branch was modified PR merge failure. Local bun run typecheck, bun run test, shell syntax validation, secret scanning, and CodeQL validation passed. The latest GitHub CI runs are currently action_required with no jobs, which appears to require maintainer approval before CI can execute.

Copilot finished work on behalf of mrjf May 17, 2026 00:49
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.

/proc and /dev fully mounted in bubblewrap sandbox

2 participants