fix(computer-server): close Android VM escape vectors in command routing - #1193
fix(computer-server): close Android VM escape vectors in command routing#1193ddupont808 wants to merge 11 commits into
Conversation
Rewrote both custom agent doc pages to accurately reflect the codebase: - Correct perform_task signature (includes tracer param) - Show @register_agent decorator pattern - Add --with flag for dev without rebuilding Docker image - Complete action types and AgentResult reference Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ocker runtimes - New cua-sandbox package: declarative Image API, layered disk caching, multi-runtime support - QEMU WSL2 runtime: runs QEMU inside WSL2 with KVM hardware acceleration on Windows - Hyper-V runtime: builds Windows images from ISO with native Hyper-V Gen2 VMs - Shared Windows unattended install (builder/windows_unattend.py): Autounattend.xml, ISO creation - OCI registry push/pull for QEMU disk images - Computer-server setup script installs cua-computer-server only (no PyTorch/agent) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cloud sandboxes are now the default path — sandbox() connects to the CUA platform API, provisions VMs, and delegates control via HTTPTransport. Ephemeral inference: image= creates+destroys, name= connects only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ple sandboxes Adds AndroidEmulatorRuntime with headless toggle, ADB/VNC/SSH/QMP transports, cloud transport timeout increase (10min), and example sandbox scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… VM creation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and hardware keys Adds sb.mobile.* methods (tap, swipe, scroll, pinch, home, back, etc.) backed by ADB shell commands, and an ephemeral Android example. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…se VM escape vectors - android.py: remove host-bypass heuristic in run_command that allowed any command containing "uv", "python", or "/home/androidusr" to execute on the container host instead of inside the emulator; all commands now route through adb shell unconditionally - main.py: PTY endpoint now enforces adb shell on Android regardless of any caller-supplied command parameter, closing the bypass where an explicit command could get a host PTY - linux/macos/windows run_command: route through adb shell when IS_CUA_ANDROID is set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Publishable packages changed
Add |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (79)
📝 WalkthroughWalkthroughThis pull request introduces a new Changes
Sequence DiagramsequenceDiagram
participant User
participant Sandbox
participant Runtime
participant Transport
participant Image as Image/Registry
participant Guest as Guest (VM/Container)
User->>Sandbox: sandbox(image=..., local=True)
Sandbox->>Image: resolve image kind (if needed)
Sandbox->>Sandbox: auto-select runtime<br/>(Docker/QEMU/etc.)
Sandbox->>Runtime: Runtime.start(image, name)
Runtime->>Guest: Launch VM/container<br/>(via Docker/QEMU/etc.)
Guest-->>Runtime: RuntimeInfo<br/>(host, api_port, vnc_port)
Sandbox->>Transport: Select transport type<br/>(HTTP/VNC/SSH/etc.)
Transport->>Transport: connect()
Transport-->>Sandbox: Connected
Sandbox-->>User: Sandbox instance<br/>(with interfaces)
User->>Sandbox: screenshot()/click()/type()
Sandbox->>Transport: send(action, params)
Transport->>Guest: HTTP POST /cmd<br/>or VNC/SSH/ADB command
Guest-->>Transport: Response (image/result/status)
Transport-->>Sandbox: Parsed result
Sandbox-->>User: Return value
User->>Sandbox: close()
Sandbox->>Transport: disconnect()
Sandbox->>Runtime: stop()
Runtime->>Guest: Terminate VM/container
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
android.pyrun_commandhad a host-bypass via substring matching on"uv","python","/home/androidusr"— trivially bypassable by any authenticated caller. Removed; all commands now route throughadb shellunconditionally./ptyendpoint enforcedadb shellonly when nocommandparam was supplied. Explicitcommandparam bypassed this and gave a host PTY. Nowadb shellis enforced unconditionally on Android.linux/macos/windowsrun_commandnow route throughadb shellwhenIS_CUA_ANDROIDis set as defense-in-depth.Test plan
run_commandon Android routes all commands throughadb shellwith no host execution pathadb shell, even when acommandbody param is passedSummary by CodeRabbit
New Features
cua-sandboxPython SDK for controlling sandboxed VMs and containers across multiple platforms (Docker, QEMU, Hyper-V, Lume, Android emulator, Tart) with a unified async API.Documentation
Tests