Skip to content

fix(computer-server): default to localhost binding - #1845

Merged
f-trycua merged 4 commits into
security/python-import-sort-baselinefrom
security/computer-server-localhost-default
Jun 18, 2026
Merged

fix(computer-server): default to localhost binding#1845
f-trycua merged 4 commits into
security/python-import-sort-baselinefrom
security/computer-server-localhost-default

Conversation

@0xjohnnydev

@0xjohnnydev 0xjohnnydev commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Recreates #1571 from current main.

Security:

  • Defaults computer-server host binding to 127.0.0.1.
  • Preserves explicit --host 0.0.0.0 opt-in.

Validation:

  • parse_args([]).host == 127.0.0.1
  • Server().host == 127.0.0.1
  • parse_args([--host, 0.0.0.0]).host == 0.0.0.0
  • Live server without --host listened on TCP 127.0.0.1 only.

Summary by CodeRabbit

  • Bug Fixes

    • Server now binds to localhost by default instead of all network interfaces, improving default security posture.
    • External connections now require explicitly passing the --host configuration flag.
  • Documentation

    • Updated documentation with instructions for configuring external access.

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jun 4, 2026 6:39pm

Request Review

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📦 Publishable packages changed

  • pypi/computer-server

Add release:<service> labels to auto-release on merge (+ optional bump:minor or bump:major, default is patch).
Or add no-release to skip.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 648bf42e-1065-471c-86c1-34c662a8a2e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request changes the default network binding for computer_server from 0.0.0.0 (all interfaces) to 127.0.0.1 (localhost only). The Server class constructor, CLI argument parser, README, and changelog are all updated to reflect this constraint and document how to enable external access.

Changes

Localhost-only default binding

Layer / File(s) Summary
Server and CLI default binding
libs/python/computer-server/computer_server/server.py, libs/python/computer-server/computer_server/cli.py
Server.__init__ and the CLI --host argument both default to 127.0.0.1 instead of 0.0.0.0. Parameter docstrings are updated to document the localhost default and explain passing 0.0.0.0 explicitly for external access.
README and changelog documentation
libs/python/computer-server/README.md, changelog/2026-05-18.md
README adds an example showing --host 0.0.0.0 for external access and clarifies the localhost-only default. Changelog documents the highlights of the change.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐇 A server once bound to all,
Now localhost heeds the call,
Safer by default, snug and tight—
external access needs explicit might. 🔐

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(computer-server): default to localhost binding' accurately summarizes the main change: switching the default host binding from 0.0.0.0 to 127.0.0.1.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/computer-server-localhost-default

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sentry

sentry Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…line' into security/computer-server-localhost-default
@0xjohnnydev
0xjohnnydev changed the base branch from main to security/python-import-sort-baseline June 4, 2026 18:26
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📦 Publishable packages changed

  • pypi/computer-server

Add release:<service> labels to auto-release on merge (+ optional bump:minor or bump:major, default is patch).
Or add no-release to skip.

…line' into security/computer-server-localhost-default
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📦 Publishable packages changed

  • pypi/computer-server

Add release:<service> labels to auto-release on merge (+ optional bump:minor or bump:major, default is patch).
Or add no-release to skip.

…line' into security/computer-server-localhost-default
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

📦 Publishable packages changed

  • pypi/computer-server

Add release:<service> labels to auto-release on merge (+ optional bump:minor or bump:major, default is patch).
Or add no-release to skip.

@f-trycua

Copy link
Copy Markdown
Collaborator

Nice — this covers the two real bind sites (cli.py --host default + Server.host default), which is the path python -m computer_server actually takes, so it closes the #1892 network exposure for the documented entrypoint.

One loose end: there's a third hardcoded bind in main.py:1433:

if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000)

It's only reached via a direct run (python -m computer_server.main / running main.py), not the __main__.pycli.main() path this PR fixes, so it's lower-risk — but for completeness it should be 127.0.0.1 too (or read the CLI default) so no entrypoint binds wide. Happy to push that one-liner if useful.

@f-trycua
f-trycua merged commit 9dae01e into security/python-import-sort-baseline Jun 18, 2026
15 checks passed
@f-trycua
f-trycua deleted the security/computer-server-localhost-default branch June 18, 2026 22:35
f-trycua pushed a commit that referenced this pull request Jun 18, 2026
* chore(python): format lint baseline

* chore(python): stabilize isort first-party config

* chore(python): scope lint baseline

* fix(computer-server): default to localhost binding (#1845)

Co-authored-by: jf-mac-mini <jf-mac-mini@jf-mac-minis-Mac-mini.local>

* chore(deps): bump cua-cli litellm to 1.86.2 (#1838)

Co-authored-by: jf-mac-mini <jf-mac-mini@jf-mac-minis-Mac-mini.local>

* chore(typescript): scope Prettier lint baseline (#1840)

* chore(typescript): format lockfiles

* chore(typescript): format prettier baseline

* chore(typescript): scope prettier lint baseline

---------

Co-authored-by: jf-mac-mini <jf-mac-mini@jf-mac-minis-Mac-mini.local>

---------

Co-authored-by: jf-mac-mini <jf-mac-mini@jf-mac-minis-Mac-mini.local>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants