GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused · Issue #6516 · developing-today/code

fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused #6516

New issue
Copy link
New issue
Copy link
Closed
#7053
Closed
fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused#6516
#7053
Copy link
Labels
app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Nov 6, 2026
Issue body actions

Summary

The fleet session broker's request-frame parser silently reroutes a request to the default laptop-agent port (4799) whenever the frame's port field is present but not a valid u16 — out of range, negative, a float, or a string. A request addressed somewhere else (or nowhere valid) is delivered to a service it was never addressed to, with a 200, instead of being refused. A present-but-invalid port is not an absent port; only an absent one should take the default.

Evidence

pkgs/fleet/crates/fleet-proxy/src/serve.rs (at 540d3bea3f):

  • parse_request (:610; the port chain at :636-639): let port = frame.get("port").and_then(|v| v.as_u64()).and_then(|p| u16::try_from(p).ok()); — every failure mode of that chain (70000, -1, 4801.5, "4801") collapses to None, indistinguishable from the field being absent.
  • Broker::do_request (:507; the default at :511): let port = req.port.unwrap_or(fleet_config::PORT_LAPTOP_AGENT); — the None becomes port 4799, and the request (method, path, body, and the caller's token file) is forwarded there.
  • Contrast in the same function: method and path are strictly validated and rejected when malformed (fleet-proxy(broker): method/path CRLF injection — one frame smuggles a second request onto the pooled tunnel #5750), and port: 0 — which survives the chain as Some(0) — is dialled and fails. The invalid cases are not even consistent: 0 errors, 70000 silently reroutes.

The module's own contract says the lenient parsing "mirrors the Python's dict access" for defaults — the Python takes req.get("port", 4799) only when the key is absent; a present 70000 is used and the connect fails. The broker's hello also advertises a closed routing table (services_map, ports 4799/4800/4801 per fleet-config) with the proto rule that an unadvertised port is "not here" — a frame for port 70000 being served by 4799 breaks that contract from inside.

Verified (probe, laptop, real crates)

Probe ~/git/fleet/probe-broker-port (path-deps on the real fleet-proxy/fleet-config/fleet-proxy-proto crates at 540d3bea3f): stub HTTP services on 127.0.0.1:4799 and 127.0.0.1:4801 that answer with their own port; the real broker (serve::run, direct mode, temp socket/token) in front of them; legacy request frames over the broker socket:

  • port: 4801 → 200, served by 4801 (control)
  • port absent → 200, served by 4799 (control — the documented default)
  • port: 70000 → 200, served by 4799 (bug)
  • port: "4801" (string) → 200, served by 4799, not 4801 (bug)
  • port: -1 → 200, served by 4799 (bug)
  • port: 4801.5 → 200, served by 4799 (bug)
  • port: 0 → 502 broker: tunnel to 127.0.0.1:0: Connection refused (dial failure — the inconsistent contrast)

Why it matters

The broker is the fleet's local RPC router: a frame's port is its address. Silently delivering a request to the wrong service is worse than failing it — the wrong service acts on a request it was never sent (the laptop-agent daemon executes commands), the caller sees a plausible 200 from a service it did not address, and the misaddressing is invisible in logs. Client bugs that serialize a port as a string or compute an out-of-range port become silent misroutes instead of loud errors at the frame boundary, exactly where #5750 already established strict validation for method/path.

Acceptance criteria

  • parse_request distinguishes an absent port (→ default 4799) from a present-but-invalid one (non-integer, negative, float, string, or > 65535), and the broker answers the latter with the standard {status: 502, body: {error: "broker: …"}} frame naming the bad port value's shape — no connection is opened.
  • port: 0 gets the same frame-boundary refusal instead of a dial attempt (or is explicitly documented and tested as a dial error, consistently with the other invalid values).
  • Tests in fleet-proxy pin: valid port routes to that port, absent port routes to 4799, and each invalid shape (70000, -1, 4801.5, "4801", 0 per the chosen rule) is refused without touching any service.
  • Existing fleet-proxy tests keep passing (cargo test -p fleet-proxy on the laptop or CI).

Scope notes

  • Frame-boundary parsing in serve.rs only. Not the typed fleet-proxy-proto Request (its port: Option<u16> cannot express these shapes — the gap exists precisely because the broker parses raw frames leniently, which legacy/Python clients still use).
  • Not fleet-config's services-table validation (fleet-config: [[proxy.services]] is never validated — duplicate ports silently collapse last-wins in the broker's routing map, and port 0 / empty names load #6397) and not the proxy connect CLI flag handling (fleet(proxy): proxy connect silently overwrites duplicate flags and silently drops modes — repeated --host/--port/--request/--body last-wins, --stdio eats --request, --print-path eats --request, --host/--port without --stdio are no-ops #5929).

Activity

Next
  1. developing-today commented on Nov 6, 2026

    @developing-today
    developing-todayBot
    on Nov 6, 2026 – with developing.today
    Contributor
    More actions

    CODE-1974

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/fleetpkgs/fleet multicall binary + platform crates
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  3. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, slug new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b run 2026-11-06 06:50 CST
    • Found via: filed this run
    • Task: Filed after verifying with a probe on the laptop (~/git/fleet/probe-broker-port, real fleet-proxy/fleet-config/fleet-proxy-proto crates @540d3bea3f): stub services on 127.0.0.1:4799 and 127.0.0.1:4801 behind the real broker — frames with port 70000, "4801", -1, and 4801.5 were all answered 200 by the 4799 service; controls (port 4801, port absent) routed correctly; port 0 502'd at dial. Triage: refuse present-but-invalid ports at the frame boundary in parse_request (serve.rs:636-639), keeping the absent-port default.
    • Expectation: effort s — done looks like: parse_request distinguishes absent from present-but-invalid port, invalid shapes get the standard 502 broker error frame with no connection opened, and fleet-proxy tests pin all shapes.
    • Links: issue body carries the full probe table and acceptance criteria; queue packet follows in this run.
  4. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 6, 2026
  5. dezren39 commented on Nov 6, 2026

    @dezren39
    dezren39
    on Nov 6, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-v
    • Session / ID: task 11155
    • Found via: queue claim
    • Task: task 11155 (triage for issue fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused #6516) is assigned to the opencode execution lane; handing off to the opencode claimant. Re-verified fresh: issue fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused #6516 OPEN, no hard-stop labels.
    • Expectation: claimant launches the bound opencode session; task parked 1200s for that launch.
    • Links: fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused #6516
  6. 43 remaining items

  7. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 8, 2026
  8. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-n
    • Session / ID: task 11387
    • Found via: queue claim
    • Task: make parse_request in pkgs/fleet/crates/fleet-proxy/src/serve.rs refuse present-but-invalid request-frame ports at the frame boundary (502 broker frame naming the bad shape) instead of silently rerouting to 4799; absent port keeps the 4799 default; tests pin every shape
    • Expectation: effort m; done = PR open with CI green (cargo test -p fleet-proxy), merged under the standing criteria
    • Links: no existing PR or branch for issue fleet-proxy(broker): a present-but-invalid request-frame port silently reroutes to the default 4799 service — 70000, -1, 4801.5 and "4801" are all served by laptop-agent instead of refused #6516 (verified fresh 2026-11-08T02:19Z); issue OPEN, no hard-stop labels
  9. developing-today
    added
    status:in-review
    on Nov 8, 2026
  10. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · PR opened

    • Agent: queue worker (repo-worker-code), lane code-n
    • Session / ID: task 11387
    • Found via: queue claim
    • Task: frame-boundary refusal of present-but-invalid request-frame ports in fleet-proxy parse_request
    • Expectation: merge PR fix(fleet-proxy): refuse present-but-invalid request-frame ports at the frame boundary #7053 when CI is green under the standing criteria; otherwise park with the CI state named
    • Links: PR fix(fleet-proxy): refuse present-but-invalid request-frame ports at the frame boundary #7053 (branch queue/11387-6516-frame-port-refusal, commit 745addfd84) — parse_port refuses string/float/bool/negative/zero/>65535 ports with the standard 502 broker frame naming the shape; absent/null keeps the 4799 default; port 0 refused at the boundary per the acceptance option; unit tests pin every shape.
  11. dezren39
    added a commit that references this issue on Nov 8, 2026

    test(fleet-proxy): property coverage for the strict port parser (#6516)

    7474bac
  12. dezren39
    closed this as completedin #7053on Nov 8, 2026
  13. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 8, 2026
  14. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-n
    • Session / ID: task 11387
    • Found via: queue claim
    • Task: frame-boundary refusal of present-but-invalid request-frame ports in fleet-proxy parse_request
    • Expectation: done = PR merged and this issue closed
    • Links: PR fix(fleet-proxy): refuse present-but-invalid request-frame ports at the frame boundary #7053 MERGED (merge commit 6d0867d). parse_port refuses string/float/bool/negative/zero/>65535 ports with the standard 502 broker frame naming the shape; absent/null keeps the 4799 default; port 0 refused at the boundary. Tests: cargo test -p fleet-proxy on the laptop under fleet-build-lock — 69+14 passed, including 3 example tests and a proptest over generated shapes against the acceptance model (added for the Codex P1 finding, dispositioned on PR fix(fleet-proxy): refuse present-but-invalid request-frame ports at the frame boundary #7053). GitHub PR checks (scripts-test, proxy-port-fallbacks) do not exercise this crate and were still queued in the runner backlog at merge time; the change itself was verified by the real suite pre-merge.
  15. dezren39
    removed
    status:in-review
    on Nov 8, 2026
  16. developing-today
    added
    status:done
    on Nov 8, 2026
  17. dezren39
    added a commit that references this issue on Nov 23, 2026

    fleet-proxy: pin explicit-allow for unadvertised dial ports (#13464)

    bcea651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/fleetpkgs/fleet multicall binary + platform crateskind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.