oauth-implementation
Skill20 starsChanged 4 months agoMITView on GitHub
Detects weak JWT validation, loose redirect_uri matching, and missing state
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Mindrally/skillstheir own version, first seen Oct 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Mindrally/skills★ 275same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- authentication-failuresSkill
- broken-access-controlSkill
- concurrency-correctnessSkill
- contract-reviewSkill
- cryptographic-failuresSkill
- crypto-library-misuseSkill
- csrfSkill
- exceptional-conditionsSkill
- excessive-agencySkill
- file-uploadSkill
- graphql-securitySkill
- hardcoded-secretsSkill
- header-injectionSkill
- hotspotsSkill
- injectionSkill
- insecure-designSkill
- insecure-local-storageSkill
- insecure-output-handlingSkill
- insecure-plugin-designSkill
- integrity-failuresSkill
- ipc-securitySkill
- llm-supply-chainSkill
- logging-failuresSkill
- mass-assignmentSkill
- mcp-securitySkill
- memory-api-misuseSkill
- model-dosSkill
- model-theftSkill
- multi-agent-trustSkill
- nosql-injectionSkill
- numeric-trust-boundarySkill
- open-redirectSkill
- overrelianceSkill
- path-traversalSkill
- privilege-handlingSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- pr-reviewSkill
- race-conditionSkill
- rag-securitySkill
- redosSkill
- security-cleanupSkill
- security-misconfigurationSkill
- security-reviewSkill
- sensitive-disclosureSkill
- ssrfSkill
- supply-chainSkill
- threat-modelSkill
- token-smugglingSkill
- training-data-poisoningSkill
- unsafe-api-consumptionSkill
The file
Files
OAuth/OIDC Implementation Security (OWASP A07:2025)
What this checks
Prevents authentication bypasses from weak JWT validation, open redirects from loose
redirect_uri matching, and CSRF from missing state parameters. These flaws allow
account takeover and session hijacking.
Vulnerable patterns
- JWT decode call that accepts the
nonealgorithm, or accepts an attacker-supplied algorithm header — enabling algorithm-confusion bypass. redirect_urivalidated by prefix match, substring match, or regex — letting an attacker host a lookalike domain whose URL passes the check.- JWT decode that omits audience (
aud) validation — a token minted for a sibling service passes signature verification but should not be honored here. - Tokens stored in browser web storage (e.g.
localStorage) where any same-origin script can read them. - OAuth authorization request sent with no
stateparameter, or with astatethat is not bound to and verified against the initiating session.
Fix immediately
Flag the vulnerable code and explain the risk. Then suggest a fix that establishes these properties. Translate each property into the audited file's language and OAuth/JWT library — use the library's documented secure-by-default APIs rather than mirroring an example from another stack.
- JWT verification pins algorithms to an explicit allowlist that never
includes
noneand never permits switching between symmetric and asymmetric families (the classic HS256/RS256 public-key-as-HMAC attack). For broader JWT handling guidance, see theauthentication-failuresskill. - Redirect URIs match exactly against an allowlist set. Prefix matching, substring matching, and regex matching all have known bypass classes — percent-encoded tricks, userinfo smuggling, lookalike subdomains. The only safe comparison is exact string equality against a set of registered URIs.
- Every JWT decode validates
aud(audience) and required claims. A token minted for a different service of the same issuer will pass signature verification; only the audience check catches the confused-deputy case. Requireexp,iat,subat minimum. - State parameter ties the callback to the initiating session. Generate a
CSPRNG
state, store it in the session before redirect, compare it on the callback. Without this the OAuth flow is CSRF-forgeable. - Tokens live in a Secure, HttpOnly, SameSite cookie or in memory — not web storage. Browser storage is readable by any same-origin script, so one XSS compromise exfiltrates every token.
Verification
Confirm the response:
- Algorithm parameter is an explicit allowlist and never includes
none redirect_uriis checked with exact-match equality against an allowlist set- Audience is validated in every JWT decode call
stateparameter is generated, stored in session, and compared on callback- Tokens are not stored in browser web storage
References
- CWE-287 (Improper Authentication)
- CWE-601 (Open Redirect)
- CWE-346 (Origin Validation Error)
- OWASP A07:2025 Authentication Failures
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

