Harden computer server launch and auth defaults - #1563
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Publishable packages changed
Add |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR addresses a command injection security vulnerability in process launching by eliminating ChangesCommand Injection Security Fix and Import Safety
Authentication and Authorization Infrastructure Overhaul
Dependency Version Updates and Network Binding
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📦 Publishable packages changed
Add |
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/cua-bench/pyproject.toml`:
- Line 74: Update the litellm version constraint in pyproject.toml by changing
the dependency entry "litellm>=1.83.7,<1.84" to require at least 1.83.10 (i.e.,
"litellm>=1.83.10,<1.84") so the project uses the patched release that fixes the
sandbox escape vulnerability; locate the dependency string in the file and
replace the version specifier accordingly.
In `@libs/python/agent/pyproject.toml`:
- Line 24: Update the litellm version constraint in pyproject.toml: replace the
dependency string "litellm>=1.83.7,<1.84" with "litellm>=1.83.10,<1.84" to
ensure the package manager will not install vulnerable 1.83.7–1.83.9 releases
(locate the dependency line in libs/python/agent/pyproject.toml that currently
sets litellm>=1.83.7,<1.84).
In `@libs/python/computer-server/computer_server/cli.py`:
- Line 33: The CLI default for the "--host" argument was changed to "127.0.0.1",
which is a breaking change for deployments expecting external access; update the
project artifacts to surface this change by (1) adding a clear migration note in
the release notes and migration guide stating the new default and instructing
users to pass "--host 0.0.0.0" for external access, (2) updating the CLI help
text for the "--host" argument in
libs/python/computer-server/computer_server/cli.py to mention the breaking
change and the explicit flag value needed for remote bindings, and (optional)
(3) consider restoring the previous default to "0.0.0.0" if preserving backward
compatibility is required.
In `@libs/python/computer-server/computer_server/handlers/generic.py`:
- Around line 28-34: The tokenization currently always uses POSIX shlex rules
which breaks Windows paths; update build_launch_argv to call shlex.split with a
platform-aware posix flag (e.g. shlex.split(app, posix=(os.name != "nt"))), add
the required import (os) at top, keep the existing empty-check/ValueError
behavior, and ensure the branch for args is unchanged so Windows quoted paths
are parsed correctly when args is None.
In `@libs/python/computer-server/computer_server/server.py`:
- Line 38: The Server constructor's host default was changed to "127.0.0.1",
which is a breaking change for callers expecting external binding; restore the
previous default by changing the host parameter default back to "0.0.0.0" in the
Server class constructor (the host: str default in Server.__init__) so existing
code that calls Server() or Server(port=...) continues to bind externally; if
the change was intentional, instead add explicit documentation and/or raise a
visible warning in Server.__init__ so callers know they must pass
host="0.0.0.0".
In `@libs/python/cua-auto/cua_auto/window.py`:
- Around line 34-40: The POSIX-only shlex.split call in _build_launch_argv
breaks Windows paths; modify _build_launch_argv to call shlex.split(app,
posix=os.name != "nt") so shlex uses non-POSIX mode on Windows, and add an
import for os if missing; this change will also make callers like launch() that
use _build_launch_argv handle Windows command strings correctly.
In `@libs/python/cua-cli/pyproject.toml`:
- Line 52: Update the litellm version constraint in pyproject.toml: replace the
dependency string "litellm>=1.83.7,<1.84" with "litellm>=1.83.10,<1.84" so the
minimum version upgrades to 1.83.10 and the sandbox escape vulnerability is
addressed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1470a7ef-29a3-4ab0-bdff-85dafb73bcaa
⛔ Files ignored due to path filters (4)
libs/cua-bench/uv.lockis excluded by!**/*.locklibs/python/cua-cli/uv.lockis excluded by!**/*.locklibs/python/cua-sandbox/uv.lockis excluded by!**/*.lockuv.lockis excluded by!**/*.lock
📒 Files selected for processing (17)
libs/cua-bench/pyproject.tomllibs/python/agent/pyproject.tomllibs/python/computer-server/computer_server/__init__.pylibs/python/computer-server/computer_server/cli.pylibs/python/computer-server/computer_server/handlers/factory.pylibs/python/computer-server/computer_server/handlers/generic.pylibs/python/computer-server/computer_server/handlers/macos.pylibs/python/computer-server/computer_server/main.pylibs/python/computer-server/computer_server/server.pylibs/python/computer-server/pyproject.tomllibs/python/computer-server/tests/test_auth_availability.pylibs/python/computer-server/tests/test_import_safety.pylibs/python/computer-server/tests/test_window_launch.pylibs/python/cua-auto/cua_auto/window.pylibs/python/cua-auto/tests/test_window_launch.pylibs/python/cua-cli/pyproject.tomlpyproject.toml
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
4 similar comments
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
📦 Publishable packages changed
Add |
📦 Publishable packages changed
|
1 similar comment
📦 Publishable packages changed
|
|
let's split in multiple PRs per area of interest |
|
Closing this combined PR after splitting it into smaller PRs by area of interest:
Keeping |
Summary
Fixes the
launchcommand injection path by removing shell execution from the computer-server and cua-auto launch helpers.Also tightens the exposed computer-server control surface:
CUA_ALLOW_UNAUTHENTICATED_LOCAL=1run_command/shell/execand PTY command creation behindCUA_ENABLE_RUN_COMMAND=1/cmd,/ws,/playwright_exec,/responses, and mounted/mcp127.0.0.1Fixes #1097.
Testing
cd libs/python/computer-server && uv run --frozen --with pytest --with pytest-asyncio pytest tests/test_auth_availability.py tests/test_import_safety.py tests/test_window_launch.pycd libs/python/cua-auto && uv run --no-project --python 3.12 --with pytest pytest tests/test_window_launch.py/responsesComputerAgent smoke test locally and on the remote hostSummary by CodeRabbit
Release Notes
New Features
CUA_ALLOW_UNAUTHENTICATED_LOCAL.CUA_ENABLE_RUN_COMMANDenvironment variable to control command execution availability.Bug Fixes
0.0.0.0to127.0.0.1for enhanced security.Chores
openai(≥2.24.0),fastmcp(≥3.2.0),litellm(≥1.83.7).