Skip to main content
Menu
Advisories

Relative bind mount paths are re-resolved against the current directory when a sandbox restarts

GHSA-MCW9-9RF6-P4RMPublished Updated GitHub

Description

Relative host paths given for bind mounts, for example --mount-dir ./:/workspace, were saved as written instead of being resolved to absolute paths when the sandbox was created. Each time the sandbox started, the path was resolved against the working directory of the process starting it. Restarting a sandbox from a different directory therefore mounted a different host directory than the one originally intended.

Impact

A user who restarts an existing sandbox from another directory, such as their home directory, can unintentionally expose that directory to the sandbox. Code running inside the sandbox can then read its contents, and modify them if the mount is writable. This can expose credentials, keys, or other files the user never meant to share with the sandbox.

Exploitation requires a user to restart the sandbox from a different working directory. Code inside the sandbox cannot change the mount on its own. Access remains subject to the host user's file permissions, and read-only mounts limit the impact to disclosure. This is not a kernel or hypervisor escape.

Affected configurations

The issue affects versions 0.3.0 through 0.7.5 when both of the following are true:

  • a sandbox is created with a relative host path for a bind mount, through the CLI or an SDK
  • the sandbox is later started from a different working directory

Sandboxes created with absolute host paths are not affected. Versions before 0.3.0 have not been assessed.

Patches

Fixed in 0.7.6. Host paths are now resolved to absolute paths when a sandbox is created, so later restarts use the original directory regardless of the working directory.

Upgrading does not change existing sandboxes. A sandbox created on an affected version with a relative path keeps its saved relative path and its previous behavior. Recreate those sandboxes after upgrading, or recreate them with absolute paths.

Workarounds

Use absolute host paths when creating sandboxes. For an existing sandbox with saved relative paths, restart it only from its original working directory and check which host directories are mounted before running untrusted code.

References

Remediation

Upgrade the affected packages to 0.7.6 or later.

Affected versions

References

GitHub · superradcompany/microsandbox