Skip to content

fleet-secrets: validate_name accepts dot segments and percent-encoded spellings — '..', '%2e%2e', 'a%2fb' pass the single-path-segment check and leave /secret/<name> #5469

Closed

Description

@dezren39

Summary

fleet-secrets' validate_name (pkgs/fleet/crates/fleet-secrets/src/lib.rs:104) is the
gate that guarantees a secret name is safe as a single URL path segment — it is
interpolated raw into the broker request path at lib.rs:213,
path: format!("/secret/{name}"). It rejects /, ?, #, whitespace, and
control characters, and its own doc/error text states that purpose:

Names become URL path segments (GET /secret/<name>); validate before any source sees them.

But the encoded and dot-segment spellings of exactly those characters pass:

Evidence (verified this run, laptop probe ~/git/fleet/probe-secret-name, real fleet-secrets crate via path-dep @ main ec28a3d)

"."       validate_ok=true   path="/secret/."
".."      validate_ok=true   path="/secret/.."
"%2e%2e"  validate_ok=true   path="/secret/%2e%2e"
"%2f"     validate_ok=true   path="/secret/%2f"
"a%2fb"   validate_ok=true   path="/secret/a%2fb"
"a%3fb"   validate_ok=true   path="/secret/a%3fb"
"a%23b"   validate_ok=true   path="/secret/a%23b"
"a/b"     validate_ok=false  (control case — the literal spelling is refused)
"normal.name" validate_ok=true (legitimate dotted names must keep working)

Reference normalization (Python urllib, same semantics as RFC 3986 §5.2 /
percent-decoding layers in HTTP stacks):

  • /secret/.. normalizes to / and /secret/. to /secret/ — the request
    no longer names a secret under /secret/ at all.
  • /secret/%2e%2e percent-decodes to /secret/..; /secret/a%2fb decodes
    to /secret/a/b — the very shapes the validator exists to refuse, arriving
    at any decoding broker/router layer in decoded form.

Why it matters

fleet-secrets is documented as the one secrets-by-name path for fleet
(design §1, epic #5412): "secrets are resolved by name through this crate
only." Its validation is the boundary every caller relies on. A name that
passes validation but does not stay a single literal segment under
/secret/ breaks that contract — at best the broker resolves a different
route/name than the caller asked for; at worst a crafted name (..,
%2e%2e, a%2f..) walks the broker's routing in a secrets-bearing service.
This is the same class as #5427 (dot segments evading an exact-string path
check in is_safe_web_path), one crate over. The bws fallback matches
names literally, so the two sources also disagree about what these names
mean.

Acceptance criteria

  • validate_name refuses . and .. as complete names, and any name
    containing % (the introducer of every encoded spelling of the refused
    characters) — or, equivalently, the path construction percent-encodes the
    name so the wire segment is always the literal name; either way the
    guarantee "the broker receives exactly one literal segment, the name
    itself" must hold and be tested.
  • The InvalidName error text is updated to name the newly refused shapes.
  • New tests in the existing name_validation_rejects_path_material style pin
    ., .., %2e%2e, %2f, a%2fb, a%3fb, a%23b as refused, and
    legitimate dotted names (supabase.service-role-key, a.b-c_d) still pass.
  • cargo test -p fleet-secrets green.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    work/self-assignedAn agent grabbed this item directly, outside the queue
    on Nov 4, 2026
  2. developing-today commented on Nov 4, 2026

    @developing-today
    Contributor
  3. added
    app/fleetpkgs/fleet multicall binary + platform crates
    on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator (lane B, new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-11-04 07:20 CST
    • Found via: filed this run
    • Task: Verified via laptop probe ~/git/fleet/probe-secret-name (real fleet-secrets crate @ ec28a3d): validate_name accepts ".", "..", "%2e%2e", "%2f", "a%2fb", "a%3fb", "a%23b" while rejecting "a/b". Guarded self-solve this run: reject dot-segment names and '%' in validate_name, update the InvalidName text, pin tests.
    • Expectation: effort xs; done = fix merged, cargo test -p fleet-secrets green on laptop, issue closed
    • Links: probe ~/git/fleet/probe-secret-name (laptop)
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

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 jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions