Logo vun Auditing Device Code And Pkce Flows

Auditing Device Code And Pkce Flows

Organisatioun
UnboundCompute
auditing-device-code-and-pkce-flows

Audit the server side of the authorization-code-with-proof-key and device-authorization grants for bugs that let a stolen or guessed code become a token. Covers a token endpoint that issues without checking the proof-key verifier at all, that accepts the plain challenge method or a challenge-absent downgrade, or that binds the verifier to the client rather than to the specific code; and a device grant whose short user code is brute-forceable because polling is unthrottled, whose device code is not bound to the requesting client, or whose approval is not tied to the authenticated approver. Scoped to the proof-key and device-code specifics, not general federated login, which a separate skill covers. Use when reviewing a token endpoint or a device-authorization endpoint. The token request parameters are the source, token issuance is the sink, and an unenforced proof binding between them is the bug.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-device-code-and-pkce-flows
Stären
27
Forks
8
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum UnboundCompute op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Auditing Device Code And Pkce Flows an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-device-code-and-pkce-flows
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-device-code-and-pkce-flows .claude/skills/auditing-device-code-and-pkce-flows
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Device Code And Pkce Flows an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Auditing Device Code And Pkce Flows automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Auditing Device Code And Pkce Flows net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Auditing proof-key and device-code grants: when a code becomes a token without proof

The proof-key exchange and the device-authorization grant both exist to close one gap: a authorization code, on its own, can be intercepted, and a short user code can be guessed. Each grant adds a proof that binds the token request to the party that actually started the flow, a verifier that only the real client knows, or a device code that only the real device holds. The server side is where that proof is enforced, and where it is quietly not. When the token endpoint issues without checking the verifier, honors a downgraded challenge, or hands tokens for a device code it never bound to a client, an intercepted or guessed code becomes a live token. You find these by reading the issuance path and asking what proof it demands before it mints a token.

When to use

  • The code implements or wraps a token endpoint that redeems an authorization code, or a device-authorization grant.
  • A public client (one that cannot hold a secret) relies on the proof key as its protection against code interception.
  • You want to know whether a captured code, a downgraded challenge, or a guessed user code yields a token.

Scope check

Exercise token and device-authorization endpoints only on systems you own or are authorized to assess, with test clients and test accounts. A confirmed issuance bypass is an authentication bypass, so treat it as account-takeover-grade and coordinate. If you can't name the authorization, stop.

The loop

  1. Map the issuance endpoints and whether a conformant server owns them. Find the token endpoint and, if present, the device-authorization and approval endpoints. Determine whether issuance is delegated to a conformant authorization server or handled in application code. If it proxies to a conformant server that enforces the proof, the local absence of a check is not the bug; confirm the delegation actually covers this path before reading further.

  2. Check that the proof-key verifier is enforced. On the code-for-token exchange, the endpoint must load the challenge stored against this exact authorization code and confirm the supplied verifier derives to it under the strong method. The bug is a handler that reads the code, looks up the grant, and issues without ever reading the verifier, so an intercepted code redeems with no proof at all.

  3. Check for method and presence downgrades. The endpoint must require the strong challenge method and reject the plain method, where challenge and verifier are equal and an interceptor who saw the challenge already holds the verifier. It must also enforce the invariant that a challenge present at authorization time requires a matching verifier at token time; issuing when the challenge is simply absent lets an attacker strip the proof entirely. Confirm the verifier is bound per authorization code, not stored per client, or any valid verifier for that client redeems any code.

  4. Check the device grant's user code and polling. The user code is short and human-entered, so its only protection is that guessing is throttled and the code is single-use and short-lived. The bug is a poll or approval path with no interval, backoff, or attempt cap, letting an attacker brute-force a pending code, combined with a user code drawn from a weak generator or one that outlives its window or survives a redemption.

  5. Check the device-code and approval bindings. The device code presented at the token endpoint must be bound to the client it was issued to, or one client redeems another's code. The approval step must tie the approved code to the authenticated user who approved it and be protected against a cross-site-request forcing an approval; otherwise an attacker's pending flow is completed with a victim's identity. Where a redirect target is involved, it must match exactly, not by prefix.

  6. Confirm and record. Confirm by driving the live endpoint: redeem a code with no verifier or a plain challenge, poll a user code without pause, or redeem a device code from a different client, and show a token issued. Kill the lead if issuance is delegated to a conformant server, the strong method is required and per-code bound, the challenge-present invariant holds, and the device grant enforces an interval, single-use high-entropy user codes with a short expiry, and strict device-code and approval bindings. Record the endpoint, the missing proof, and the token obtained.

Where grant proof leaks

  • A public client has no secret, so the verifier is its whole defense. If the token endpoint does not demand it, code interception is enough; there is nothing else to stop it.
  • The plain method turns the proof into a copy of the challenge. Anyone who saw the authorization request holds the verifier. Only the strong method binds anything.
  • Downgrade by omission is the quiet version. If the endpoint enforces the proof only when the client sends a challenge, an attacker simply does not send one.
  • A user code is short by design. Its safety is a throttle and a short life, not its length; an unthrottled poll or approval endpoint brute-forces it.
  • A device code unbound to a client is a bearer token for the wrong bearer. Binding the code to the client that requested it is what stops cross-client redemption.

Worked example (a confirm and a kill)

Confirm. The token endpoint reads the authorization code, loads the grant, and issues an access token. The verifier parameter is never read, and the challenge stored at authorization time is never compared. The client is public. A captured authorization code, replayed with no verifier, yields a token. Confirmed proof-key verifier not enforced, high, remediation = require the strong challenge method, load the challenge bound to the exact code, reject any exchange whose verifier does not derive to it, and reject a public-client exchange that carries no proof.

Kill. The endpoint forwards the exchange to a conformant authorization server that enforces the strong method, binds the verifier to the code, and rejects the plain method and challenge-absent exchanges; the device grant it wraps enforces a polling interval, single-use high-entropy user codes with a short expiry, and a device-code-to-client binding. Replaying without a verifier is rejected upstream. Killed, kill_reason = "issuance delegated to a conformant server that enforces a per-code strong-method verifier and device-code binding; downgraded and proofless exchanges rejected."

Rationalizations to reject

  • "The code is single-use, so interception does not matter." -> Single-use only means the attacker must redeem before the client does; the proof key is what makes a raced code useless.
  • "We support the plain method for older clients." -> The plain method offers no protection against an interceptor. Supporting it is the downgrade, not a compatibility nicety.
  • "The user code is random, so it cannot be guessed." -> A short human-entered code is guessable in bulk unless polling and approval are throttled and the code expires quickly.
  • "The device code is unguessable, so binding is redundant." -> Binding stops a different client from redeeming a code it obtained, not just a guesser; unguessability is not the same property.
  • "The upstream server handles the proof." -> Only if this path actually reaches it with the parameters intact. Confirm the delegation, do not assume it.

Executing this in practice

You need the token-endpoint handler, the device-authorization and approval handlers, the store that holds challenges and device codes, and the polling and expiry logic. For each, decide what proof is demanded before a token is issued and whether that proof is bound to the specific code and client. Reading the issuance path tells you which checks exist; driving a proofless, downgraded, or cross-client exchange against a test client tells you which ones hold.

Related

  • auditing-saml-and-oidc-flows - the general federated-login sibling; this skill deliberately narrows to the proof-key and device-code enforcement those flows leave to the token endpoint.
  • auditing-webauthn-and-passkey-flows - another authentication-flow audit where a valid-looking request must be bound to its true initiator before it grants access.
  • auditing-randomness-and-nonce-quality - a weak user code or authorization code is a grant bug rooted in a weak generator; that skill covers the entropy this one assumes.
  • FINDING-SCHEMA.md - source = the token request parameters, sink = token issuance, evidence = the proofless or downgraded exchange that still returns a token.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Device Code And Pkce Flows?

Audit the server side of the authorization-code-with-proof-key and device-authorization grants for bugs that let a stolen or guessed code become a token. Covers a token endpoint that issues without checking the proof-key verifier at all, that accepts the plain challenge method or a challenge-absent downgrade, or that binds the verifier to the client rather than to the specific code; and a device grant whose short user code is brute-forceable because polling is unthrottled, whose device code is not bound to the requesting client, or whose approval is not tied to the authenticated approver. S...

Firwat Auditing Device Code And Pkce Flows op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Device Code And Pkce Flows besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Auditing Device Code And Pkce Flows an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-device-code-and-pkce-flows an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Auditing Device Code And Pkce Flows benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Auditing Device Code And Pkce Flows benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Device Code And Pkce Flows domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Auditing Device Code And Pkce Flows gratis?

Jo. De Skill gëtt vum UnboundCompute ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇