fix(network): allow localhost connect on declared open ports in proxy mode - #1701
Open
Frankie-Xu wants to merge 6 commits into
Open
fix(network): allow localhost connect on declared open ports in proxy mode#1701Frankie-Xu wants to merge 6 commits into
Frankie-Xu wants to merge 6 commits into
Conversation
Contributor
Author
|
CI approve requested — fork PR needs maintainer workflow approval. Local |
Contributor
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
Frankie-Xu
marked this pull request as draft
August 21, 2026 10:56
Contributor
Author
|
Converting to draft to honor the 1–2 open PR limit. While it's a draft I'll fix the --listen-port-range bug nogent found (parsed into allow_bind_range but never added to the capability set). No action needed from reviewers now. |
14 tasks
… mode Align Linux seccomp supervisor with macOS ProxyOnly semantics for pre-declared open_port and listen_port grants, merge single-port open_port into seccomp allowlists, and add --open-port-range / --listen-port-range CLI flags. Signed-off-by: Frankie-Xu <frankie-xu@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Frankie-Xu <92643488+Frankie-Xu@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Frankie-Xu <92643488+Frankie-Xu@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
CLI --listen-port-range and profile listen_port_range were parsed but never added to CapabilitySet, so Landlock/Seatbelt/seccomp ignored the declared bind grant. Store them as bind-only tcp_bind_port_ranges (mechanism, not policy) and switch remaining chunks_exact(2) call sites to as_chunks for Clippy 1.98. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Frankie-Xu <92643488+Frankie-Xu@users.noreply.github.com>
Loopback is required for connect in proxy mode, not for bind. Servers typically listen on 0.0.0.0, which is not loopback, so requiring it would break listen_port. Signed-off-by: Frankie-Xu <92643488+Frankie-Xu@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Bare cat looks up PATH, which other unit tests temporarily poison. That left provider-stdin.json empty under the parallel test runner. Signed-off-by: Frankie-Xu <92643488+Frankie-Xu@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Frankie-Xu
marked this pull request as ready for review
August 26, 2026 10:09
Frankie-Xu
force-pushed
the
feat/1652-localhost-whitelist
branch
from
August 26, 2026 10:09
a2d8319 to
2d37486
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Refs #1652
This PR intentionally does not close #1652 — it delivers a focused Phase-1 subset (proxy-mode localhost connect on declared ports + CLI range flags). Port
0cross-platform semantics and dynamic bind→connect remain for maintainer direction.Summary
In Linux proxy mode, seccomp previously allowed localhost
connectonly to the nono proxy listener port. That blocked legitimate localhost IPC to ports the profile already declared viaopen_port/listen_port(and ranges), while macOS ProxyOnly already permitted those connects.This change:
--open-port-range/--listen-port-rangeCLI flags (withallow-port-range/allow-bind-rangealiases) matching existing profile keys.CapabilitySet::merged_localhost_port_ranges()as a pure merge helper over client-provided grants (no library policy).Agent Disclosure
This PR was prepared by an AI coding agent on behalf of Frankie-Xu.
Consulted:
AGENTS.md/CONTRIBUTING.md(library vs CLI boundary, DCO, unwrap policy)crates/nono-cli/src/exec_strategy/supervisor_linux.rs(decide_network_notification)crates/nono-cli/src/proxy_runtime.rs,cli.rs,capability_ext.rs,supervised_runtime.rscrates/nono-cli/src/tool-sandbox/platform/{linux,macos}.rscrates/nono/src/capability.rs(grant merge helper only)Confirms compliance with repository coding and security requirements for this scoped change.
Test Plan
make fmt-checkmake clippymake test/make cilocally (macOS); Linux supervisor unit tests for declared-port connect allow/denyscripts/test-list-aliases.sh/scripts/lint-docs.shChecklist
--help/ alias inventory; no broader docs change required for this subset)Agent Compliance Check
Made with Cursor