Skip to content

[BUG] --dir=/etc/alternatives mount is not read‑only inside sandbox #10

Description

@ombagal777

Description

The isolate invocation includes --dir=/etc/alternatives=/etc/alternatives without the :ro suffix. Isolate’s --dir option supports dest=src:ro to mount directories read‑only, but the current configuration mounts /etc/alternatives as writable from inside the sandbox.

This unnecessarily exposes system alternative configuration to potential modification from sandboxed processes if they manage to bypass other protections.

Impact

  • Sandbox processes may be able to write to /etc/alternatives inside the container/host namespace, depending on user and isolation settings.
  • Could allow tampering with alternative symlinks or binaries, increasing the blast radius of a sandbox escape.

Expected Behavior

  • /etc/alternatives should be mounted read‑only using :ro so sandboxed processes cannot make changes.

Actual Behavior

  • /etc/alternatives is mounted without :ro, allowing potential writes from within the sandbox.

Possible Solution

  • Update the isolate command in core/sandbox.ts to:
    • --dir=/etc/alternatives=/etc/alternatives:ro
  • Re‑run tests to ensure no language runtime relies on write access to /etc/alternatives.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions