Summary
A path traversal flaw in Boxlite's OCI image handling allows tar entries that are symlinks to absolute paths on the host to be written without proper restriction.
If a user pulls and runs a malicious OCI image inside Boxlite, the attacker can write arbitrary data to host filesystem paths and potentially achieve remote code execution on the host.
Affected context
This vulnerability affects environments where Boxlite is used to run untrusted or third-party OCI images inside lightweight virtual machines.
The issue arises during unpacking and processing of OCI image tar archives when file entries can resolve to absolute paths on the host via symlinks.
It is most relevant when users are free to specify arbitrary images from public registries and the Boxlite host filesystem is not isolated from the unpacking process.
Exploit preconditions
- Attack surface: OCI image import and unpacking in Boxlite.
- Required access: Ability to get a victim to pull and run a crafted OCI image (e.g., via a public registry such as DockerHub).
- Trigger point: Boxlite processes tar entries in the image, following symlinks that resolve to absolute host paths and writing file contents there.
- Why exploitation is possible: The tar extraction logic does not validate or constrain the final resolved path of symlinked entries to remain within an intended sandbox directory, allowing writes to arbitrary locations on the host filesystem.
Why this happens
The root cause is improper path validation when extracting tar entries from OCI images, particularly when handling symlinks that point to absolute paths.
Instead of normalizing and enforcing that resolved paths stay within a designated sandbox or extraction directory, the implementation trusts the paths embedded in the archive.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path components are allowed to escape their intended directory and impact broader host resources.
Potential impact
- Malicious images may write arbitrary files to sensitive locations on the host filesystem.
- Attackers could plant or overwrite executables, configuration files, or service units that run with elevated privileges.
- The host environment can potentially be fully compromised, leading to remote code execution.
- Persistence mechanisms may be established on the host by modifying startup scripts or system services.
- Integrity and availability of other workloads on the same host may be impacted.
General mitigation guidance
Effective mitigation focuses on constraining file system effects of image extraction and treating image contents as untrusted data.
Common defensive patterns include:
- Normalizing and resolving all paths (including symlink targets) before writing, and enforcing that they stay within a predefined extraction root.
- Rejecting or strictly limiting absolute paths and symlink entries in tar archives used for sandboxed execution.
- Performing extraction inside a dedicated, isolated filesystem namespace or chroot that has no write access to the host root.
- Running the extraction and container-launch components with least-privilege accounts and minimal host filesystem permissions.
- Applying defense-in-depth controls such as mandatory access control policies (e.g., SELinux/AppArmor) to limit damage from unexpected writes.
How teams detect issues like this
Detection typically relies on both code-centric and operational approaches:
- Static analysis and secure code review rules that flag tar extraction logic lacking normalization, path joining with a fixed root, and checks for absolute or parent-directory components.
- Automated tests that attempt to unpack tar archives containing absolute paths,
..segments, or symlink chains and verify they are rejected or contained. - Host-level monitoring for unexpected file modifications in system directories originating from Boxlite processes (e.g., via audit logs or eBPF-based tracing).
- Policy enforcement in CI/CD pipelines to scan container tooling and sandbox services for known path traversal antipatterns and to disallow unvetted images from external registries.

