Repository navigation
Description
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%2epercent-decodes to/secret/..;/secret/a%2fbdecodes
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_namerefuses.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
InvalidNameerror text is updated to name the newly refused shapes. - New tests in the existing
name_validation_rejects_path_materialstyle pin
.,..,%2e%2e,%2f,a%2fb,a%3fb,a%23bas refused, and
legitimate dotted names (supabase.service-role-key,a.b-c_d) still pass. cargo test -p fleet-secretsgreen.
Activity
developing-today commentedon Nov 4, 2026
CODE-1330
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
fix(fleet-secrets): refuse dot-segment and percent-encoded secret nam…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done