Security

From qauth-labs/qauth · View interactive version

Security is an AI agent skill from the GitHub repository qauth-labs/qauth. Implements and reviews security controls for auth-server and OAuth flows following OWASP API Security Top 10, dependency hygiene (CVE/audit), and timing-safe practices. Use when hardening authentication, rate limiting, secrets handling, or when the user asks about security, CVEs, or OWASP.

How to use this skill

Skill file

Security (QAuth)

Standards-aligned security for QAuth: authentication, authorization, rate limiting, timing-safe operations, secrets, and dependency hygiene. Use this skill when implementing or reviewing security-sensitive code, handling CVEs, or aligning with OWASP and related standards.

When to Use This Skill

Quick Reference

| Concern | QAuth pattern |

| ----------------- | ---------------------------------------------------------------------------------------------------------- |

| Passwords | Argon2id via @node-rs/argon2; never store plaintext; validate strength (zxcvbn) |

| Timing | Constant-time comparison for PKCE (crypto.timingSafeEqual); minimum response time on login/token/refresh |

| Rate limiting | Per-route and global via @fastify/rate-limit; Redis store; env-driven limits |

| Errors | Generic messages for auth failures (no user enumeration); domain errors from @qauth-labs/shared-errors |

| Secrets | Keys in env/secrets manager; never in images or logs; see ADR-001 for JWT keys |

| Audit | Log auth/token events to audit_logs (success/failure, IP, userAgent, metadata) |

| Dependencies | Run pnpm audit (or npm audit); fix or document exceptions; track CVEs |

OWASP API Security Top 10:2023 — Checklist

OWASP Top 10:2025 — Checklist

Authentication and Timing

  1. Login / token / refresh

Use minimum response time (ensureMinimumResponseTime, MIN_RESPONSE_TIME_MS) so success and failure take similar time. Prevents user enumeration and reduces timing side channels.

  1. PKCE

Verify code challenge with crypto.timingSafeEqual (see libs/server/pkce). Never use plain string comparison.

  1. Password verification

Always run verification (even when user not found) so response time doesn't leak existence. Use Argon2id verify; avoid early returns that shorten failure path.

  1. Error messages

Use the same generic message for "invalid credentials" and "user not found" (e.g. InvalidCredentialsError). Don't expose "email not found" vs "wrong password."

Passwords and Hashing

Rate Limiting and Abuse

Secrets and Configuration

Dependency and CVE Hygiene

Audit Logging

Checklist for Security-Sensitive Changes

Additional Resources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.