T09 · Insecure Skill Coding Practices
- Location
oauth.md:205- Finding
OIDC ID Token Decoded Without Cryptographic Verification
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a documentation-only authentication skill with no executable install behavior, but some copyable examples show insecure authentication patterns that could put accounts at risk if used as written.
Install only if you will treat it as a high-level checklist, not as code to paste into production. Before using its OAuth, OIDC, or middleware examples, replace them with patterns that fully verify tokens, link accounts only through an authenticated confirmation flow, and validate sessions cryptographically or through a trusted server-side store.
oauth.md:205OIDC ID Token Decoded Without Cryptographic Verification
oauth.md:165Automatic OAuth Account Linking Based Only on Email Address
middleware.md:208Next.js Middleware Treats Cookie Presence as Successful Authentication
Referenced artifact was not completely inspected
| OAuth and social login | `oauth.md` |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
+-----------------------------------------------------+
| Access Token (15min) Refresh Token (7 days) |
| - In memory - httpOnly cookie |
| - Sent in header - Sent only to /refresh |
| - Short-lived - Rotated on use |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**Refresh flow:**
1. Access token expires -> client calls /refresh
2. Server validates refresh token
3. Server issues new access token + rotates refresh token
4. If refresh token reused -> revoke all tokens (breach detected)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
**Refresh flow:**
1. Access token expires -> client calls /refresh
2. Server validates refresh token
3. Server issues new access token + rotates refresh token
4. If refresh token reused -> revoke all tokens (breach detected)
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Refresh flow:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Refresh flow:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| Storage | XSS Safe | CSRF Safe | Persists | Best For |
|---------|----------|-----------|----------|----------|
| Memory (JS variable) | [NO] | [YES] | [NO] | Access tokens (SPA) |
| httpOnly cookie | [YES] | [NO]* | [YES] | Refresh tokens, sessions |
| localStorage | [NO] | [YES] | [YES] | [NO] Never for auth |
| Secure enclave (mobile) | [YES] | [YES] | [YES] | Mobile apps |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
// Exchange code for tokens
const tokenResponse = await fetch('https://oauth2.googleapis.com/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const config = {
authUrl: 'https://github.com/login/oauth/authorize',
tokenUrl: 'https://github.com/login/oauth/access_token',
userInfoUrl: 'https://api.github.com/user',
emailUrl: 'https://api.github.com/user/emails', // Email is separate
scopes: ['read:user', 'user:email']
};
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const config = {
authUrl: 'https://github.com/login/oauth/authorize',
tokenUrl: 'https://github.com/login/oauth/access_token',
userInfoUrl: 'https://api.github.com/user',
emailUrl: 'https://api.github.com/user/emails', // Email is separate
scopes: ['read:user', 'user:email']
};
The OIDC example decodes an ID token with jwt.decode() without cryptographically verifying its signature, issuer, audience, or expiry before use. In authentication documentation, developers often copy samples directly, so this can lead to token forgery or acceptance of attacker-controlled identity claims, causing account takeover or authentication bypass.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const prefix = hash.slice(0, 5);
const suffix = hash.slice(5);
const res = await fetch(`https://api.pwnedpasswords.com/range/${prefix}`);
const text = await res.text();
return text.includes(suffix);
This markdown file includes a sensitive endpoint for account deletion protected by recent MFA, but the surrounding text does not explicitly warn that the operation is destructive or may permanently affect user data. Under the markdown-specific missing-warning criterion, behaviors that can affect user data or system integrity should be accompanied by a user-facing warning in the skill description.
No suspicious patterns detected.