Skip to main content
Menu
Advisories

Sandbox catalog database is created world-readable, exposing persisted secret and environment values to other local users

GHSA-CVR8-2329-J4XWPublished Updated GitHub

Description

On affected local Unix installations, Microsandbox created its local catalog with permissions inherited from the process umask. The catalog database and SQLite journal files could therefore be readable by other local accounts.

The catalog stores each sandbox's configuration, including inline secret values and environment variables. Removing a sandbox deletes its catalog row but can leave the values in SQLite WAL pages, so the exposure can outlast the sandbox itself.

Impact

Any local account that can traverse to $MSB_HOME could read persisted sandbox configuration with sqlite3, strings, or another file reader. Exposed data can include API keys, tokens, environment values, source configuration, and other sandbox settings.

The issue is most significant on shared hosts, CI runners, service accounts with a shared storage root, or systems where other untrusted local processes can read the catalog. Host-environment secret references are not affected because the raw value is not stored in the sandbox configuration.

This advisory covers the local catalog on Linux and macOS. It does not describe remote/cloud backends.

Affected Versions

The local catalog permission issue affects Microsandbox releases through 0.7.11, including the CLI and Rust SDK/database packages that use the local backend. Versions before 0.3.0 have not been assessed.

Patched Behavior

Version 0.7.12 and later create the catalog directory with owner-only permissions and create catalog files, SQLite journals, downgrade backups, and preflight copies with mode 0600. Existing catalog files and recognized backups are repaired before use. The runtime also rejects foreign-owned or unsafe linked storage instead of redirecting permission changes, and protects macOS catalog storage from untrusted ACL grants.

Sharing one catalog between different OS accounts remains unsupported; use one owning account or a separate storage root for each account.

Workarounds

Before upgrading, run the local backend under a single OS account and keep $MSB_HOME on storage that other local accounts cannot traverse. Do not treat chmod-based group sharing as a supported workaround. Rotate credentials that may have been stored by an affected installation, including credentials from sandboxes that have already been removed.

Remediation

Upgrade the local CLI and SDK components to 0.7.12 or later. After upgrading, review existing catalog and backup permissions and rotate credentials that may have been exposed before the upgrade.

Technical Details

  • The catalog directory was created as 0777 & ~umask and SQLite catalog, -wal, and -shm files inherited 0644 & ~umask under a typical umask 022.
  • Inline secret values were persisted verbatim in sandbox configuration, while host-environment references stored only the reference.
  • SQLite WAL pages could retain sensitive values after a sandbox row was removed.
  • The exposure does not require code execution inside a sandbox; local read access to the catalog path is sufficient.

Proof of Concept

A proof of concept demonstrated the issue by creating a sandbox with an inline environment secret, reading the value from msb.db, removing the sandbox, and finding the value still present in msb.db-wal. The original report includes the complete command transcript.

Credit

Reported by ya-luotao.

Affected versions

References

GitHub · superradcompany/microsandbox