security-hardening-auditor

Audits and hardens Next.js and Node.js applications against OWASP Top 10 vulnerabilities.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/sabiscore/swarmxq --skill security-hardening-auditor-sabiscore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-hardening-auditor
Source: https://github.com/sabiscore/swarmxq/tree/main/.ai/skills/security-hardening-auditor
Command: npx skills add https://github.com/sabiscore/swarmxq --skill security-hardening-auditor-sabiscore

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Full-stack applications ship with authentication gaps, missing security headers, unvalidated inputs, and injection risks that lead to breaches. This Skill audits existing code against the OWASP Top 10 and generates production-ready security configurations for Next.js and Node.js apps. ## Core Features & Use Cases - OWASP Top 10 Audit: Walks all ten categories (broken access control, injection, misconfiguration, and more) and produces a severity-rated findings report with root causes and remediations. - Auth.js v5 Setup: Generates complete authentication with Credentials and Google providers, JWT session callbacks, bcrypt password hashing, and middleware-based route protection. - Defense Configuration: Produces CSP and security headers, Upstash Redis rate limiting tiers, Zod input validation schemas, Prisma-safe query patterns, and startup-validated secrets management. - Use Case: Ask "is my Next.js app secure?" and receive a structured audit report listing critical, high, and medium findings with exact file locations and fixes. ## Quick Start Ask the assistant to audit your Next.js application for OWASP Top 10 vulnerabilities and generate the missing authentication, headers, and rate limiting configuration.

Frequently Asked Questions about security-hardening-auditor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Auth.js v5 authentication in Next.js?

Install next-auth@beta and define an auth.ts file exporting handlers, signIn, signOut, and auth. Configure providers like Google and Credentials, use JWT session strategy with role embedded in token callbacks, and protect routes through middleware that redirects unauthenticated requests.

How do I audit my Next.js app for OWASP Top 10 vulnerabilities?

Run through all ten categories from broken access control to SSRF, checking authentication, authorization ownership checks, headers, input validation, and query safety. The output is a severity-rated report listing critical, high, and medium findings with locations and remediations.

How do I add rate limiting to a Next.js or Fastify API?

Use @upstash/ratelimit with @upstash/redis for serverless Next.js routes, configuring sliding window limits such as 5 attempts per 15 minutes on auth endpoints. For Fastify, register @fastify/rate-limit with a max count, time window, and IP-based key generator.

Does Prisma prevent SQL injection by default?

Prisma parameterizes all standard queries automatically, making them safe by default. Raw queries must use tagged template literals like $queryRaw with interpolated variables; never pass user input into $queryRawUnsafe string concatenation.

What security headers should a Next.js app include?

Configure X-Frame-Options DENY, X-Content-Type-Options nosniff, Strict-Transport-Security with one-year max-age, Referrer-Policy, Permissions-Policy, and a Content-Security-Policy restricting script, style, image, and connect sources in next.config.ts.

Why should environment variables be validated at startup?

Startup validation with @t3-oss/env-nextjs and Zod fails fast when required secrets like DATABASE_URL or AUTH_SECRET are missing, preventing runtime failures in production. It also enforces constraints such as a minimum 32-character auth secret.