secure-oauth-oidc

Design, audit, and test OAuth 2.0 and OpenID Connect systems against RFC 9700.

723|93|Updated Nov 14, 2021
One-click install
npx skills add https://github.com/citypaul/.dotfiles --skill secure-oauth-oidc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secure-oauth-oidc
Source: https://github.com/citypaul/.dotfiles/tree/main/claude/.claude/skills/secure-oauth-oidc
Command: npx skills add https://github.com/citypaul/.dotfiles --skill secure-oauth-oidc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

OAuth and OIDC implementations frequently ship with subtle protocol flaws—missing PKCE enforcement, redirect URI mismatches, mix-up attacks, and improper ID Token validation—that lead to account takeover and token theft. This Skill provides a rigorous, standards-grounded workflow for designing, reviewing, and testing OAuth/OIDC systems against RFC 9700 / BCP 240.

Core Features & Use Cases

  • Security design and migration: Establish a security profile, build a transaction ledger of artifact bindings, and migrate away from implicit and resource-owner-password grants.
  • Adversarial review and testing: Apply an attack-to-control matrix covering mix-up, code injection, CSRF, token replay, and proxy-header spoofing, with concrete negative test suites for authorization servers, clients, and resource servers.
  • OIDC validation: Enforce atomic ID Token validation, exact issuer binding, discovery trust chains, and UserInfo subject matching.
  • Use Case: Audit a multi-issuer login system by tracing each flow's state, nonce, and PKCE bindings, then produce a findings report with severity-calibrated attack paths, remediation steps, and closure tests.

Quick Start

Use the secure-oauth-oidc skill to review my OAuth authorization-code flow implementation for RFC 9700 compliance and identify exploitable weaknesses.

Frequently Asked Questions about secure-oauth-oidc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit an OAuth 2.0 implementation for security flaws?

Build a transaction ledger tracing every artifact binding (state, nonce, PKCE, codes, tokens), then apply the RFC 9700 control catalog and attack matrix. Report findings with evidence, attack paths, severity, and negative tests proving each control fails closed.

How do I validate an OpenID Connect ID Token correctly?

Validate the signature with the expected issuer's keys, then check exact issuer equality, audience containing your client ID, time claims, nonce, and flow-specific hashes like at_hash. Commit the session atomically only after all checks pass, and never use an access token as proof of authentication.

Is PKCE required for confidential OAuth clients?

RFC 9700 requires PKCE for public clients and recommends it for confidential clients. A confidential OIDC client may use nonce instead only with the specific token-endpoint validation precautions defined in RFC 9700 section 4.5.3.2.

What is a mix-up attack in OAuth and how do I prevent it?

A mix-up attack occurs when a multi-issuer client sends an honest issuer's code or credentials to an attacker-controlled endpoint. Prevent it by binding the chosen issuer to the user-agent session and validating the authorization response issuer using RFC 9207 iss or distinct per-issuer redirect URIs.

When should I use DPoP or mTLS for access tokens?

Use DPoP or mTLS to sender-constrain access tokens so stolen tokens cannot be replayed by an attacker. The resource server must validate both the token binding and the proof; a cnf claim without proof enforcement provides no protection.

Why is the implicit flow discouraged in modern OAuth?

RFC 9700 recommends against responses that return access tokens from the authorization endpoint because they are exposed to injection and leakage through browser history, Referer headers, and token substitution. Migrate to the authorization code flow with PKCE instead.