auth-security-expert
БесплатноЗапускает вложенные скриптыНе проверенOAuth 2.1, JWT (RFC 8725), encryption, and authentication security expert. Enforces 2026 security standards.
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Auth Security Expert
⚠️ CRITICAL: OAuth 2.1 becomes MANDATORY Q2 2026
OAuth 2.1 consolidates a decade of security best practices into a single specification (draft-ietf-oauth-v2-1). Google, Microsoft, and Okta have already deprecated legacy OAuth 2.0 flows with enforcement deadlines in Q2 2026.
Required Changes from OAuth 2.0
1. PKCE is REQUIRED for ALL Clients
- Previously optional, now MANDATORY for public AND confidential clients
- Prevents authorization code interception and injection attacks
- Code verifier: 43-128 cryptographically random URL-safe characters
- Code challenge: BASE64URL(SHA256(code_verifier))
- Code challenge method: MUST be 'S256' (SHA-256), not 'plain'
// Correct PKCE implementation
async function generatePKCE() {
const array = new Uint8Array(32); // 256 bits
crypto.getRandomValues(array); // Cryptographically secure random
const verifier = base64UrlEncode(array);
const encoder = new TextEncoder();
const hash = await crypto.subtle.digest('SHA-256', encoder.encode(verifier));
const challenge = base64UrlEncode(new Uint8Array(hash));
return { verifier, challenge };
}
// Helper: Base64 URL encoding
function base64UrlEncode(buffer) {
return btoa(String.fromCharCode(...new Uint8Array(buffer)))
.replace(/\+/g, '-')
.replace(/\//g, '_')
.replace(/=+$/, '');
}
2. Implicit Flow REMOVED
- ❌
response_type=tokenorresponse_type=id_token token- FORBIDDEN - Tokens exposed in URL fragments leak via:
- Browser history
- Referrer headers to third-party scripts
- Server logs (if fragment accidentally logged)
- Browser extensions
- Migration: Use Authorization Code Flow + PKCE for ALL SPAs
3. Resource Owner Password Credentials (ROPC) REMOVED
- ❌
grant_type=password- FORBIDDEN - Violates delegated authorization principle
- Increases phishing and credential theft risk
- Forces users to trust client with credentials
- Migration: Authorization Code Flow for users, Client Credentials for services
4. Bearer Tokens in URI Query Parameters FORBIDDEN
- ❌
GET /api/resource?access_token=xyz- FORBIDDEN - Tokens leak via:
- Server access logs
- Proxy logs
- Browser history
- Referrer headers
- ✅ Use Authorization header:
Authorization: Bearer <token> - ✅ Or secure POST body parameter
5. Exact Redirect URI Matching REQUIRED
- No wildcards:
https://*.example.com- FORBIDDEN - No partial matches or subdomain wildcards
- MUST perform exact string comparison
- Prevents open redirect vulnerabilities
- Implementation: Register each redirect URI explicitly
// Server-side redirect URI validation
function validateRedirectUri(requestedUri, registeredUris) {
// EXACT match required - no wildcards, no normalization
return registeredUris.includes(requestedUri);
}
6. Refresh Token Protection REQUIRED
- MUST implement ONE of:
- Sender-constrained tokens (mTLS, DPoP - Demonstrating Proof-of-Possession)
- Refresh token rotation with reuse detection (recommended for most apps)
PKCE Downgrade Attack Prevention
The Attack:
Attacker intercepts authorization request and strips code_challenge parameters. If authorization server allows backward compatibility with OAuth 2.0 (non-PKCE), it proceeds without PKCE protection. Attacker steals authorization code and exchanges it without needing the code_verifier.
Prevention (Server-Side):
// Authorization endpoint - REJECT requests without PKCE
app.get('/authorize', (req, res) => {
const { code_challenge, code_challenge_method } = req.query;
// OAuth 2.1: PKCE is MANDATORY
if (!code_challenge || !code_challenge_method) {
return res.status(400).json({
error: 'invalid_request',
error_description: 'code_challenge required (OAuth 2.1)',
});
}
if (code_challenge_method !== 'S256') {
return res.status(400).json({
error: 'invalid_request',
error_description: 'code_challenge_method must be S256',
});
}
// Continue authorization flow...
});
// Token endpoint - VERIFY code_verifier
app.post('/token', async (req, res) => {
const { code, code_verifier } = req.body;
const authCode = await db.authorizationCodes.findOne({ code });
if (!authCode.code_challenge) {
return res.status(400).json({
error: 'invalid_grant',
error_description: 'Authorization code was not issued with PKCE',
}
Установить auth-security-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
FAQ
Что делает скилл auth-security-expert?
OAuth 2.1, JWT (RFC 8725), encryption, and authentication security expert. Enforces 2026 security standards.
Как установить скилл auth-security-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл auth-security-expert запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic