Repository navigation
Description
fleet-proxy(udp-forward): fleet-udp-forward silently overwrites duplicate scalar flags — last --target/--proxy/--bind/--ports wins
Summary
The CONNECT-UDP client shim bin fleet-udp-forward
(pkgs/fleet/crates/fleet-proxy/src/bin/fleet-udp-forward.rs, landed
in PR #6122 for #6109) parses its flags in a hand-rolled loop
(lines 52–75) where every scalar flag assigns unconditionally:
proxy = v (line 53), bind = ip (line 58), target = Some(v)
(line 64), ports = Some(v) (line 68). Repeating any of them silently
discards the first value — no error, no warning. Only --map is
repeatable by design (it pushes onto a Vec, line 71–75).
This is the silent-flag-loss class already filed per-parser for the
fleet's other hand-rolled parsers — #5939 (repo-queue client),
#5929 (proxy connect), #5713 (fleet-dispatch) — on the one parser
those filings could not cover: this bin was written after them.
Evidence (verified this run, laptop, real binary built from HEAD)
Laptop primary ~/git/code @ 7a980eb4cf; binary built with
cargo build -p fleet-proxy --bin fleet-udp-forward in pkgs/fleet.
fleet-udp-forward --target first.example --target second.example --ports 47998
binds and serves with the second target, printing
fleet udp-forward: udp:127.0.0.1:47998 -> second.example:47998 via 127.0.0.1:3131
(ran until timeout, exit 124).first.exampleis discarded with no
mention anywhere.fleet-udp-forward --proxy 127.0.0.1:1111 --proxy 127.0.0.1:2222 --map 47998=127.0.0.1:47999
servesvia 127.0.0.1:2222— the first proxy address is silently
dropped the same way.
A script that concatenates a default flag set with an override set
(the usual way these duplicates happen) gets a forwarder pointed at
whichever value came last, with the run looking entirely successful.
Why it matters
- The shim's whole job is pointing UDP traffic at a target host via a
proxy endpoint. Silently retargeting--target/--proxyon a
duplicate means traffic flows to the wrong host/endpoint while the
operator believes the first value took effect — the dangerous
direction for a forwarding tool, and exactly the failure fleet(queue): repo-queue client parser silently overwrites duplicate flags, accepts --dry-run=false as true, and silently defaults a non-numeric --limit #5939
names for the queue client ("a mistyped or script-concatenated
second--queuesilently retargets work"). - The bin is otherwise strict: unknown arguments, missing values, bad
ports, and unpaired--target/--portsare all usage errors
(exit 2). Duplicate scalars are the one silent path left.
Acceptance criteria
- Repeating any scalar flag (
--proxy,--bind,--target,
--ports) in one invocation is a usage error naming the flag
(stderr + usage, exitEXIT_USAGE= 2), before anything binds. --mapremains repeatable and accumulates, as documented.- Single-occurrence invocations behave byte-identically to today,
including the--helpsurface. - Pinning tests cover each rejected duplicate shape plus the
repeatable---mapand single-value controls;cargo test -p fleet-proxystays green.
Activity
developing-today commentedon Nov 5, 2026
CODE-1776
dezren39 commentedon Nov 5, 2026
🤖 Agent note · filed
new-issue-creator-code-a)new-issue-creator-code-a, run 2026-11-05 01:35 CSTproxy connectsilently overwrites duplicate flags and silently drops modes — repeated--host/--port/--request/--bodylast-wins,--stdioeats--request,--print-patheats--request,--host/--portwithout--stdioare no-ops #5929/fleet(dispatch): duplicate and contradictory flags silently resolved — repeated values overwrite, --no-* always beats --* #5713 on their parsers. Packet enqueued for a small fix.packet-6139-fix.json(queue repo-health-code-pilot); body filehidden_files/issue-fleet-udp-forward-dup-flags.mddezren39 commentedon Nov 5, 2026
🤖 Agent note · picked up
fleet-proxy(udp-forward): property-test the duplicate-flag invariant (#…
Merge pull request #6145 from developing-today/queue/9936-6139-udp-fo…
dezren39 commentedon Nov 5, 2026
🤖 Agent note · done — fixed + merged
--proxy/--bind/--target/--ports) withargument --<flag>: duplicate flag(stderr + usage, exit 2) before anything binds;--mapstays repeatable. Issue fleet-proxy(udp-forward): fleet-udp-forward silently overwrites duplicate scalar flags — last --target/--proxy/--bind/--ports wins #6139 closed by the merge.--targetserved the second host; duplicate--proxyserved via the second proxy); post-fix all four duplicate shapes exit 2 naming the flag, single-value and multi---mapcontrols serve unchanged,--helpunchanged.cargo test -p fleet-proxygreen on the laptop (45 lib + 14 bin: 11 example tests + 3 proptests added for the Codex P1 finding, dispositioned on PR fleet-proxy(udp-forward): reject duplicate scalar flags in fleet-udp-forward (#6139) #6145 thread 4477943317; Codex re-review of final head 83c7ae6 completed with no findings). PR-tier CI never started (runner backlog, same stall as run 41968165250); merged under the standing merge authority on the verified change, main-tier CI is the backstop. Local clippy is blocked by a pre-existing laptop E0514 serde/rustc skew on untouched crates, noted on the PR.