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-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused · Issue #6518 · developing-today/code

fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518

New issue
Copy link
New issue
Copy link
Closed
#7062
Closed
fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused#6518
#7062
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)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/parkedDeliberately paused with a recorded resume conditionstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Description

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

Summary

The fleet session broker's request-frame parser silently discards a present-but-non-string token_file — a number, boolean, object, or array collapses to None, and the broker then authenticates the request with the default token file instead of the credential the caller named, or instead of refusing the frame. The request is delivered and answered (200) with a credential substitution that neither the caller nor the service can see. A present-but-invalid token_file is not an absent one; only an absent one should take the default. Sibling of #6516 (the same collapse for the frame port, in the same function).

Evidence

pkgs/fleet/crates/fleet-proxy/src/serve.rs (at 6046e1d7bc):

  • parse_request (:610; the token_file chain at :640-643): frame.get("token_file").and_then(|v| v.as_str()).map(|s| s.to_string()) — every non-string shape (123, true, {"x":1}, ["x"]) fails as_str() and collapses to None, indistinguishable from the field being absent.
  • Broker::do_request (:507; the fallback at :512-514): None becomes self.config.default_token_file() ($HOME/tools/laptop-agent-token, fleet-config default_token_file()), whose contents are read, trimmed, and sent to the target service as the X-Agent-Token header (pkgs/fleet/crates/fleet-proxy/src/http.rs:195).
  • Contrast in the same call path: a token_file that is a string but names a missing file is a loud 502 — broker: cannot read token file /nonexistent/token: No such file or directory. The invalid shapes are not even consistent: a bad string errors, a non-string is silently replaced with a different credential.
  • Contrast in the same function: method and path are strictly validated and refused when malformed (fleet-proxy(broker): method/path CRLF injection — one frame smuggles a second request onto the pooled tunnel #5750). The module comment describes the leniency as mirroring the Python's defaults — the Python takes its default only when the key is absent.

Verified (probe, laptop, real crates)

Probe ~/git/fleet/probe-broker-tokenfile (path-deps on the real fleet-proxy/fleet-config/fleet-proxy-proto crates at 6046e1d7bc): a stub HTTP service on 127.0.0.1:4799 that echoes the X-Agent-Token header it received; the real broker (serve::run, direct mode, temp socket) in front of it; HOME pointed at the probe dir so the broker's default token file is the probe's own (default-token); a custom token file holding custom-token:

  • token_file: <custom path> → 200, service received custom-token (control)
  • token_file absent → 200, service received default-token (control — the documented default)
  • token_file: 123 → 200, service received default-token (bug — the named credential was silently replaced)
  • token_file: true → 200, service received default-token (bug)
  • token_file: {"x":1} → 200, service received default-token (bug)
  • token_file: ["x"] → 200, service received default-token (bug)
  • token_file: "/nonexistent/token" → 502 broker: cannot read token file /nonexistent/token: No such file or directory (os error 2) (the inconsistent contrast)
  • token_file: null → 200, service received default-token (JSON null; arguably absent-equivalent — triage's call, listed for completeness)

Why it matters

The broker is the fleet's local RPC router, and token_file is how a frame names the credential its request should carry. Silently substituting the default credential means a request can succeed against a service under an identity the caller never named — or fail confusingly elsewhere — with nothing in the response or logs saying a substitution happened. Client bugs that serialize the field wrong (a config object, a boolean flag, a numeric id) become silent credential swaps instead of loud errors at the frame boundary, exactly where #5750 established strict validation and #6516 is establishing it for port.

Acceptance criteria

  • parse_request distinguishes an absent token_file (→ the default token file) from a present-but-non-string one, and the broker answers the latter with the standard {status: 502, body: {error: "broker: …"}} frame naming the bad shape — no connection is opened and no token is read.
  • The rule for token_file: null is chosen explicitly (absent-equivalent or refused) and pinned by a test.
  • Tests in fleet-proxy pin: a string token_file sends that file's token, an absent one sends the default token, and each non-string shape (number, boolean, object, array) 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 — the token_file field. The port field's version of this collapse is 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; the typed fleet-proxy-proto Request (token_file: Option<String>) cannot express these shapes — the gap exists precisely because the broker parses raw frames leniently, which legacy/Python clients still use.
  • Not the brokers' empty-token-file authentication behaviour (fleet(queue): brokers accept an empty token file — empty X-Agent-Token header authenticates to queue-broker and secrets-broker #6320, closed — a file that exists but is empty, at the queue/secrets brokers) and not fleet-config's empty/blank config strings (fleet-config: empty/blank config-file strings are used verbatim — broker_socket="" resolves to the home directory itself, and a blank dispatch url overrides as Some("") #6405).

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-1975

  2. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/fleetpkgs/fleet multicall binary + platform crates
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    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 (new-issue-creator-code-b)
    • Session / ID: cron job new-issue-creator-code-b, run 2026-11-06T13:34Z
    • Found via: filed this run
    • Task: Filed after verifying with a laptop probe (~/git/fleet/probe-broker-tokenfile, real fleet-proxy broker + header-echoing stub service) that a present-but-non-string token_file (123 / true / object / array) is silently discarded and the request is served with the default token, while a string naming a missing file correctly 502s. Sibling of 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 (port field, same function).
    • Expectation: effort s — triage confirms the frame-boundary refusal shape (and the null rule), then a small-fix refuses non-string token_file in parse_request with tests pinning string/absent/non-string shapes.
    • Links: probe ~/git/fleet/probe-broker-tokenfile (laptop); body file hidden_files/issue-fleet-proxy-broker-tokenfile-fallback.md
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    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-x
    • Session / ID: task 11164
    • Found via: queue claim
    • Task: Handing off task 11164 for issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518 to the opencode execution lane per instruction §1b; verified issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518 is OPEN with no held, user/owned, do-not-merge, or do-not-auto-edit labels.
    • Expectation: opencode-claimant launches the bound opencode session to drive task 11164 to a terminal state.
    • Links: issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518
  6. 22 remaining items

  7. dezren39
    added a commit that references this issue on Nov 8, 2026

    fix(fleet-proxy): reject non-string token_file values (#6518)

    866f52e
  8. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 8, 2026
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: repo queue worker (repo-worker-code), OpenChamber scheduled lane 335a5d1f-bfc1-4831-99ea-850c8939a727
    • Session / ID: task 11395
    • Task: Implemented and pushed commit 866f52e16e on queue/11395-6518-token-file-shape; PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 is OPEN. Targeted regression test and full cargo test -p fleet-proxy passed. PR checks had not started yet (only CodeRabbit skipping) when the run reached its ~30-minute budget, so task 11395 is parked for 20 minutes. No merge attempted.
    • Expectation: resume after the park timer; re-check PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 and all required checks fresh, then merge only if green and the diff remains correct.
    • Links: task 11395; issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518; PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062
  10. developing-today
    added
    status:in-review
    on Nov 8, 2026
  11. dezren39
    added 2 commits that reference this issue on Nov 8, 2026

    fix(fleet-proxy): reject non-string token_file values (#6518)

    c2361aa

    test(fleet-proxy): cover token_file shape invariant with generated te…

    c21d583
  12. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo queue worker, lane code-l (repo-worker-code)
    • Session / ID: cron repo-queue-worker-shift-l run 2026-11-08; task 13345
    • Found via: claimed task 13345 this shift; execution-lane assignment returned direct — this lane works it.
    • Task: task 13345 (pr_shepherd) for PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 (batch issue Unowned PR batch from branch disposition (2026-11-07) #7297, underlying issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518). Fresh check: PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 is OPEN at head c21d583 (matches the checkpointed head), no hard-stop labels on PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 or issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518. Resuming from stage awaiting_ci: rechecking CI; merge only if checks are green, the Codex disposition stands, and the standing criteria hold.
    • Expectation: merge PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 if verified green, else park again naming the pending checks.
    • Links: task 13345 · PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 · issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518 · issue Unowned PR batch from branch disposition (2026-11-07) #7297
  13. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked — CI pending

    • Agent: repo queue worker, lane code-l (repo-worker-code)
    • Session / ID: cron repo-queue-worker-shift-l run 2026-11-08; task 13345
    • Task: task 13345 (pr_shepherd) for PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 at head c21d583. Polled CI ~5 minutes this shift: the 4 basic checks (fleet-search pyjson/render parity, proxy port fallbacks, scripts-test 3.12, scripts-test 3.14) are still pending; the run was created 2026-11-08T20:08:02Z and is still queued — systemic CI stall, no failures. CodeRabbit skipping. Prior verification stands: cargo test -p fleet-proxy 75 lib + 14 bin pass incl. token_file proptest; Codex P1 fixed and dispositioned in its thread.
    • Expectation: on resume, recheck PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 checks; merge when green, then close out issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518 / batch issue Unowned PR batch from branch disposition (2026-11-07) #7297 outcome.
    • Links: task 13345 · PR fix(fleet-proxy): reject non-string token_file shapes (#6518) #7062 · issue fleet-proxy(broker): a present-but-non-string token_file is silently discarded — the request is authenticated with the default token instead of the named credential, or refused #6518 · issue Unowned PR batch from branch disposition (2026-11-07) #7297
  14. dezren39
    added a commit that references this issue on Nov 9, 2026

    Merge pull request #7062 from developing-today/queue/11395-6518-token…

    c994bdb
  15. dezren39
    closed this as completedin #7062on Nov 9, 2026
  16. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 9, 2026
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)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/parkedDeliberately paused with a recorded resume conditionstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

    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.