# GHSA-89J4-256R-3PCQ: Snapshot Import Symlink Traversal Arbitrary File Write

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

## Affected versions

- microsandbox (crates.io): from 0.4.4, fixed in 0.5.8
- microsandbox (npm): from 0.4.4, fixed in 0.5.10
- microsandbox (PyPI): from 0.4.4, fixed in 0.5.8
- github.com/superradcompany/microsandbox/sdk/go (Go): from 0.5.0, fixed in 0.5.8
- microsandbox-cli (crates.io): from 0.4.4, fixed in 0.5.8

## Description

### Summary
`msb snapshot import` and the SDK snapshot import APIs (Rust, Node.js, Python, Go) did not validate tar entry types when unpacking a snapshot archive. A crafted archive containing a symlink entry followed by a regular file entry whose path passes through that symlink could write attacker-controlled files outside the intended import destination, with the permissions of the user running the import.

### Impact
An attacker who can get a user or an automated pipeline to import a malicious snapshot archive can write arbitrary content to any path that user can write to. This can be used to:

- overwrite files such as `~/.ssh/authorized_keys` or shell startup files to gain persistence or code execution as that user
- corrupt application or sandbox data to cause denial of service

The write happens during extraction, before the snapshot manifest is checked, so it succeeds even when the import itself exits with an error.

Exploitation requires the victim to import an archive supplied by the attacker.

### Affected configurations
The issue affects versions 0.4.4 through 0.5.7 when a snapshot archive from an untrusted source is imported through any of:

- the `msb snapshot import` CLI command
- the snapshot import API in the Rust crate or the Node.js, Python, or Go SDKs (the Go SDK from 0.5.0, its first release)

Both plain `.tar` and `.tar.zst` archives were affected.

### Details
`unpack_archive()` in `crates/microsandbox/lib/snapshot/archive.rs` rejected entries with absolute paths or `..` components, but never inspected the entry type or link target before calling `entry.unpack()`. A symlink entry at a relative path (for example `snap/link`) pointing to a location outside the import root, followed by a regular file entry at `snap/link/<name>`, passes both path checks. When the second entry is unpacked the OS follows the symlink and the file lands outside the destination.

### Patches
Fixed in 0.5.8 by [#998](https://github.com/superradcompany/microsandbox/pull/998). Snapshot and cache archive contents are now staged in a temporary directory, entries that are not regular files or directories are rejected, and nothing is promoted to its final location until every snapshot manifest verifies.

Upgrade to 0.5.8 or later. The npm package did not ship a 0.5.8 release, so npm users should upgrade to 0.5.10 or later.

### Workarounds
On affected versions, only import snapshot archives from sources you trust. To inspect an archive first, list its entries (for example with `tar -tvf`) and do not import it if it contains symlinks, hard links, or device entries.


## Remediation

Upgrade each package to the patched version listed in the package metadata above.

## References

- https://github.com/superradcompany/microsandbox/security/advisories/GHSA-89j4-256r-3pcq

Page: https://cve.now/GHSA-89J4-256R-3PCQ

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