title: Agent Workspace Boundary Escape via Host-Root Mount and Unprivileged Namespace Escalation (CVE-2026-46331)
id: ATR-2026-02407
rule_version: 1
status: experimental
description: |
  Detects an agent runtime crossing the boundary of the workspace it was granted and reaching the host it is supposed to be isolated from. Anchored on the "SharedRoot" sandbox escape disclosed 2026-07-23 against a macOS agent desktop app that runs the agent inside a Linux VM: the entire host root filesystem was bind-published read-write into the guest at /mnt/.virtiofs-root, visible only to guest-root, so any in-guest privilege escalation converted directly into full host read/write. The reported escalation primitive was CVE-2026-46331 ("pedit COW", net/sched tcf_pedit_act miscomputed copy-on-write range leading to page-cache corruption), reachable from an unprivileged user namespace that grants CAP_NET_ADMIN and permits autoloading the act_pedit traffic-control action module. Detection targets the agent-observable payload surface, not incident prose: (a) file commands or paths that operate under a host-root bridge mount (/mnt/.virtiofs-root, /proc/1/root, /host_mnt, /run/host and siblings), (b) an unshare invocation chained into traffic-control or kernel-module setup, (c) configuration of the vulnerable pedit action or an explicit act_pedit module load, (d) agent file-tool arguments that leave the workspace for host credential or launch-persistence locations, (e) tool arguments that roll back the sandbox hardening controls (unprivileged-userns sysctls, seccomp unconfined, SYS_MODULE/SYS_ADMIN capability grants), and (f) instruction text that directs the agent to perform one of these steps. CWE-1188 (Insecure Default Initialization of Resource), CWE-269 (Improper Privilege Management), CWE-282 (Improper Ownership Management).
author: ATR Community
date: 2026/07/28
schema_version: '0.1'
detection_tier: pattern
maturity: test
severity: critical
references:
  owasp_llm:
    - LLM06:2025
    - LLM02:2025
  owasp_agentic:
    - ASI06:2026
    - ASI04:2026
  mitre_atlas:
    - AML.T0050 - Command and Scripting Interpreter
    - AML.T0053 - AI Agent Tool Invocation
    - AML.T0048 - External Harms
  mitre_attack:
    - T1611 - Escape to Host
    - T1068 - Exploitation for Privilege Escalation
    - T1548 - Abuse Elevation Control Mechanism
    - T1083 - File and Directory Discovery
  cve:
    - CVE-2026-46331
metadata_provenance:
  mitre_atlas: auto-generated
  owasp_llm: auto-generated
  owasp_agentic: auto-generated
compliance:
  eu_ai_act:
    - article: '15'
      context: Article 15 requires high-risk AI systems to be resilient against attempts to alter their use or performance by exploiting system vulnerabilities. An agent runtime whose isolation boundary can be crossed — because the host filesystem is published read-write into the agent VM and an in-guest kernel primitive (CVE-2026-46331) yields guest-root — fails that resilience requirement; this rule provides the detection control for the boundary crossing itself.
      strength: primary
    - article: '14'
      context: Article 14 human oversight is defeated when host-wide file read and write occur with no permission prompt shown to the operator. This rule restores an oversight signal by surfacing the exact tool call that reaches outside the granted workspace, so a human can intervene at the moment the boundary is crossed rather than after the fact.
      strength: primary
    - article: '9'
      context: Article 9 risk management must record 'agent sandbox is only as strong as the guest kernel' as a residual risk whenever a local execution mode mounts host storage into the agent VM, and must document the compensating control (scoped mounts, read-only mounts, or detection such as this rule) chosen for it.
      strength: secondary
  nist_ai_rmf:
    - function: Manage
      subcategory: MG.2.3
      context: MANAGE 2.3 requires mechanisms to sustain the value of deployed AI when a risk materialises. Blocking the tool call that touches a host-root bridge mount, or that configures the traffic-control action behind CVE-2026-46331, is the runtime treatment for this escape path when the vendor ships no dedicated fix.
      strength: primary
    - function: Map
      subcategory: MP.5.1
      context: MAP 5.1 requires the likelihood and magnitude of each identified impact to be characterised. Local execution modes that mount the whole host root into the agent VM must be mapped as host-wide read/write impact, not workspace-scoped impact, because guest-root is the only barrier.
      strength: primary
    - function: Measure
      subcategory: MS.2.7
      context: MEASURE 2.7 requires AI system security and resilience to be evaluated and documented. The true-positive and true-negative corpora attached to this rule are the measurement artefact for workspace-boundary-escape coverage in the agent runtime lane.
      strength: secondary
    - function: Govern
      subcategory: GV.6.1
      context: 'GV.6.1 supplier risk management applies to the agent execution environment itself: before adopting a local execution mode, an organisation must obtain from the supplier the scope of host storage shared into the agent VM and the guest hardening posture (unprivileged user namespaces, module autoload, seccomp scope).'
      strength: secondary
  iso_42001:
    - clause: '8.1'
      context: 'Clause 8.1 operational control requires the agent execution environment to enforce the workspace scope it advertises. Where the platform cannot, this rule supplies the compensating operational control: detect and block agent tool calls whose paths or commands resolve outside the granted workspace.'
      strength: primary
    - clause: '8.3'
      context: Clause 8.3 AI risk treatment is implemented here as a detection treatment for a supplier-accepted residual risk — the vendor closed the report as informative and mitigated only by changing the default execution mode, so operators who keep local execution retain the risk and need this control.
      strength: primary
    - clause: 6.1.2
      context: Clause 6.1.2 risk assessment must treat 'guest kernel compromise equals host compromise' as a single point of failure for any agent sandbox that shares host storage, and must record the assessment for both the default and the non-default execution mode.
      strength: secondary
tags:
  category: privilege-escalation
  subcategory: sandbox-boundary-escape
  scan_target: both
  confidence: high
agent_source:
  type: tool_call
  framework:
    - any
  provider:
    - any
detection:
  condition: any
  method: pattern
  false_positives:
    - 'RESIDUAL, NARROWED: container and VM diagnostic agents inspecting /proc/1/root or /run/host. Configuration reads under those bridges (/run/host/etc/os-release, /run/host/etc/resolv.conf, /proc/1/root/etc/apt/..., readlink /proc/1/root) were verified NOT to fire after the Layer 1 dual-use split. What still fires is a read of host CREDENTIALS (/etc/shadow, /etc/sudoers, /etc/ssh/, keychains) or a descent into a host user home through those bridges — which is the boundary crossing itself, so it is reported deliberately.'
    - 'RESIDUAL, NARROWED: Flatpak, toolbox and distrobox tooling reading configuration under /run/host no longer fires. The remaining exposure is toolbox/distrobox home passthrough — /run/host/home/<user>/... is a legitimate mount for those tools but is indistinguishable, in the tool argument alone, from an agent reading the host user''s home. Kept as a detection because host home access from inside the guest is the reconnaissance step of this escape.'
    - Network-engineering agents in a lab that legitimately configure tc pedit actions for packet header rewriting.
    - Kernel or distribution CI that intentionally loads act_pedit to regression-test the CVE-2026-46331 fix.
    - Backup, migration or provisioning agents writing to ~/Library/LaunchAgents or /Library/LaunchDaemons because the operator explicitly asked for a launch item to be installed.
    - Rootless container builds that run unshare followed by ip link add or modprobe for legitimate CNI setup.
    - Incident-response runbooks quoted verbatim into a tool argument, where an example command and the /mnt/.virtiofs-root path appear on the same line.
  conditions:
    - field: tool_args
      operator: regex
      value: (?i)(?:\b(?:cat|less|more|head|tail|ls|cp|mv|rm|dd|tar|rsync|scp|zip|chmod|chown|grep|find|sed|awk|xxd|strings|base64|open|stat|du)\b[^\n"]{0,80}(?:/mnt/\.virtiofs-root|/mnt/hostfs|/mnt/host-root|/host_mnt|/hostfs)\b|(?:/mnt/\.virtiofs-root|/mnt/hostfs|/mnt/host-root|/host_mnt|/hostfs)/(?:Users|home|root|etc|private|System|Library|var/root)\b|(?:/run/host|/proc/1/root)/(?:Users/|home/|var/root\b|root/\.|Library/Keychains|(?:private/)?etc/(?:shadow|sudoers|passwd|gshadow|master\.passwd)\b|(?:private/)?etc/ssh/))
      description: Agent tool argument operates on a host-root bridge mount published into the agent VM — the host-filesystem reach step of the SharedRoot escape
    - field: tool_args
      operator: regex
      value: (?i)\bunshare\b[^\n]{0,160}(?:\btc\s+(?:qdisc|filter|action)\s+(?:add|replace|change)\b|\bmodprobe\s+(?:act|sch|cls)_[a-z_]{2,16}\b|\binsmod\s+[^\n]{0,60}(?:act|sch|cls)_[a-z_]{2,16}\.ko\b)
      description: Unprivileged user namespace creation chained into traffic-control or kernel-module configuration inside the agent sandbox
    - field: tool_args
      operator: regex
      value: (?i)(?:\btc\s+(?:-\S{1,10}\s+){0,3}(?:filter|action)\s+(?:add|replace|change)\b[^\n]{0,200}\baction\s+pedit\b|\bpedit\s+ex\s+munge\b|\bmodprobe\s+act_pedit\b|\binsmod\s+[^\n]{0,60}act_pedit\.ko\b)
      description: Traffic-control pedit action configured or act_pedit module explicitly loaded from an agent session — the CVE-2026-46331 escalation primitive being armed
    - field: tool_args
      operator: regex
      value: (?i)"(?:file_?path|filepath|path|filename|file|target|destination|dest|output_?path|src|source)"\s*:\s*"[^"]{0,120}(?:(?:\.\./){2,}(?:Users|home|etc|root|private|System|Library|var)/|/(?:private/)?etc/(?:sudoers|passwd|shadow|ssh/)|/Users/[^"/]{1,40}/(?:\.ssh/|\.aws/|\.gnupg/|Library/Keychains/|Library/LaunchAgents/)|/home/[^"/]{1,40}/\.(?:ssh|aws|gnupg)/|/Library/LaunchDaemons/)
      description: Agent file-tool path argument resolves outside the granted workspace into host credential stores or launch-persistence locations
    - field: tool_args
      operator: regex
      value: (?i)(?:kernel\.unprivileged_userns_clone\s*=\s*1\b|kernel\.apparmor_restrict_unprivileged_userns\s*=\s*0\b|echo\s+1\s*>\s*/proc/sys/kernel/unprivileged_userns_clone\b|echo\s+0\s*>\s*/proc/sys/kernel/apparmor_restrict_unprivileged_userns\b|\b(?:docker|podman|nerdctl|ctr)\b[^\n]{0,200}(?:--security-opt[= ]seccomp[=:]unconfined\b|--cap-add[= ]"?(?:SYS_MODULE|SYS_ADMIN)\b|--privileged\b[^\n]{0,120}--cap-add[= ]"?NET_ADMIN\b|--cap-add[= ]"?NET_ADMIN\b[^\n]{0,120}(?:--privileged\b|seccomp[=:]unconfined\b)))
      description: Agent tool argument disables the guest hardening controls (unprivileged user namespaces, seccomp scope, module-load capability) that gate the escape chain
    - field: content
      operator: regex
      value: (?i)(?:you\s+(?:must|should|will|need\s+to|are\s+required\s+to)|please\s+run|first,?\s+run|then\s+run|step\s+\d{1,2}\s*[:.)]|before\s+(?:you\s+)?(?:continue|proceed|answer))[^\n]{0,200}(?:/mnt/\.virtiofs-root/|/proc/1/root/|\bmodprobe\s+act_pedit\b|\bunshare\s+(?:--map-root-user\b|--user\b|-r\b|-[A-Za-z]{0,4}U[A-Za-z]{0,4}\b))
      description: Instruction content directs the agent to reach the host-root mount or arm the namespace/module escalation — weaponised guidance, not advisory prose
response:
  actions:
    - block_tool
    - alert
    - snapshot
    - escalate
  auto_response_threshold: critical
  message_template: |
    [ATR-2026-02407] CRITICAL: agent workspace boundary escape detected. The tool call reaches a host-root bridge mount, arms the CVE-2026-46331 traffic-control escalation primitive, rolls back guest hardening controls, or writes outside the granted workspace into host credential or launch-persistence locations. Block the tool call, snapshot the session and escalate. Remediation for operators: prefer cloud execution, or scope the shared mount to the connected folders only and mount read-only; disable unprivileged user namespaces in the guest; block autoloading of unused net/sched action modules; run the host file-sharing daemon in its own mount namespace with a strict system-protection profile; patch the guest kernel to a build containing the CVE-2026-46331 fix.
confidence: 85
