Skip to content

tidy-security: two seams documented as wired - #223

Merged
dinstein merged 2 commits into
mainfrom
tidy-security
Aug 7, 2026
Merged

tidy-security: two seams documented as wired#223
dinstein merged 2 commits into
mainfrom
tidy-security

Conversation

@dinstein

@dinstein dinstein commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Nightly-tidy slice over the security layer — internal/guard/spawnguard, guard/netguard,
oauthflow, oauthlogin — and docs/modules/security.md / docs/modules/oauth.md.

Both findings are the same shape: oauthflow offers a seam, the document says it is wired,
and nothing wires it. No predicate, failure direction or gate is touched.

  • 1. oauth.md marks pre-provisioned client_id supported and cites a flag that has never existed
  • 2. NoBrowser's comment tells you to wire it in a way that would change the mode it selects

dinstein and others added 2 commits August 7, 2026 14:49
The client-identity table marked "Operator pre-provisions a client_id" as ✅,
citing NewStaticRegistrar and a --client-id flag, and the paragraph under it
named that flag as the way out of the document's self-declared biggest spec
gap: an AS that implements only 2025-11-25 and does not enable DCR.

Neither half holds. There is no --client-id flag on auth login — the full flag
set is manual/device/loopback/no-browser/scopes/authorization-endpoint/issuer/
redirect-uri/allow-local/timeout. And while LoginRequest.Registrar is a real
seam and NewStaticRegistrar a real implementation, nothing in the tree ever
sets that field, so Flow.register always falls through to DCR;
NewStaticRegistrar's only caller is its own test.

The direction matters. A row marked ✅ is one a reader stops investigating,
and this is precisely the row someone reaches for after reading that our only
path is the one the spec demoted. Today such a provider has no route through
auth login at all, which the table now says. The neighbouring rows were
checked the same way: --redirect-uri exists, State.ClientID reuse is real, and
CIMD was already marked ❌ correctly.

Docs only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Its comment read "Wire it for --no-browser so mode selection takes the manual
path through the same code." Following that advice would change the mode that
gets chosen. SelectMode reads a non-nil Open as "this host can open a
browser", so an always-failing opener selects ModeLoopback and reaches manual
only by the downgrade path — after binding a listener and failing to open.
What the CLI actually does is leave Open nil, which is the signal SelectMode
reads to choose manual outright, and auth.go says so at the call site.

So the one instruction the comment gives is the one thing not to do, on a
function with no production caller. The comment now says which mechanism is
real, why the other is not equivalent, and what the function is still for.

While in the package: ran make fuzz FUZZ=FuzzScanAuthParam for 45s over the
WWW-Authenticate scanner this slice owns — 5.6M execs, no crashes. Nothing in
this commit touches it; the round is the slice's due diligence on a
hand-written parser reading untrusted input.

Comment only. make ci green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dinstein
dinstein marked this pull request as ready for review August 7, 2026 06:52
@dinstein
dinstein merged commit 7dd5eae into main Aug 7, 2026
3 checks passed
@dinstein
dinstein deleted the tidy-security branch August 7, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant