# GHSA-4VQ3-CJPP-V7FG: Guest-controlled symlinks in msb copy allow arbitrary file write on the host

- Database: GitHub
- Severity: CVSS 7.1 (High)
- Published: 2026-09-09
- Modified: 2026-11-14

## Affected versions

- microsandbox-cli (crates.io): from 0.5.3, fixed in 0.6.7
- microsandbox (npm): from 0.5.3, fixed in 0.6.7
- microsandbox (PyPI): from 0.5.3, fixed in 0.6.7

## Description

### Summary
`msb copy` from a sandbox to the host recreated symlinks reported by the guest without validating their targets, and wrote file contents through symlinks that already existed at the destination. Code running inside a sandbox could arrange its filesystem so that copying a directory out of the sandbox wrote attacker-controlled content to a host path outside the copy destination, with the permissions of the user running `msb copy`.

### Impact
An attacker who can execute code inside a sandbox can overwrite arbitrary files on the host that the invoking user can write to, once that user or an automated job copies data out of the sandbox. Targets such as shell startup files, SSH `authorized_keys`, or git hooks can turn the file write into code execution on the host. If `msb copy` runs under a privileged account, the impact extends to whatever that account can write.

No special sandbox configuration is required. In the reported scenario the write happens when a guest-controlled directory is copied to the same host destination more than once.

### Affected configurations
The issue affects versions 0.5.3 through 0.6.6 when `msb copy` is used to copy files from a sandbox that ran untrusted code to the host.

This covers the `msb` CLI however it was installed, including the standalone installer, the `microsandbox-cli` crate, and the npm and pip packages, which ship the CLI.

### Details
During copy-out, the symlink target string returned by the guest was passed directly to the host `symlink` call, with no check for absolute paths or `..` components. Only the location of the link was confined to the destination. File contents were then written with a create-and-truncate open that follows symlinks, so a later copy of a regular file with the same name was written to the link's target instead.

### Patches
Fixed in 0.6.7. Copy-out now pins the destination root, re-anchors absolute guest symlink targets inside the copy tree, rejects targets that would leave it, and no longer follows symlinks beneath the destination when writing files.

### Workarounds
Before upgrading, avoid running `msb copy` out of sandboxes that ran untrusted code. If you must, copy into a new empty directory each time and check the result for symlinks before using it.


## Remediation

Upgrade the affected packages to 0.6.7 or later.

## References

- https://github.com/superradcompany/microsandbox/security/advisories/GHSA-4vq3-cjpp-v7fg

Page: https://cve.now/GHSA-4VQ3-CJPP-V7FG

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
