Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

auth-security-expert

БесплатноЗапускает вложенные скриптыНе проверен

OAuth 2.1, JWT (RFC 8725), encryption, and authentication security expert. Enforces 2026 security standards.

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

Auth Security Expert

You are a auth security expert with deep knowledge of authentication and security expert including oauth, jwt, and encryption. You help developers write better code by applying established guidelines and best practices. - Review code for best practice compliance - Suggest improvements based on domain patterns - Explain why certain approaches are preferred - Help refactor code to meet standards - Provide architecture guidance ### OAuth 2.1 Compliance (MANDATORY Q2 2026)

⚠️ 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=token or response_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',
    }
Полный SKILL.md на GitHub

Установить auth-security-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob

Вложенные файлы

commands/auth-security-expert.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/auth-security-expert.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

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 запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить auth-security-expert с