security-nextjs

Audit Next.js applications for security vulnerabilities using ripgrep-based shell scripts.

124|12|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/IgorWarzocha/Opencode-Workflows --skill security-nextjs-igorwarzocha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-nextjs
Source: https://github.com/IgorWarzocha/Opencode-Workflows/tree/main/agents/security-reviewer/.opencode/skill/security-nextjs
Command: npx skills add https://github.com/IgorWarzocha/Opencode-Workflows --skill security-nextjs-igorwarzocha

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps identify and mitigate common security vulnerabilities in Next.js applications, protecting against data leaks, unauthorized access, and other risks.

Core Features & Use Cases

  • Environment Variable Auditing: Detects exposed secrets via NEXT_PUBLIC_ prefixes and next.config.js env settings.
  • Server Action & API Route Security: Checks for missing authentication and authorization.
  • Middleware Configuration: Reviews middleware.ts for proper route matching and auth enforcement.
  • Use Case: Before deploying a new Next.js feature, run this Skill to automatically scan for common security misconfigurations like accidentally exposing API keys to the client.

Quick Start

Run the security-nextjs skill to scan the current directory for Next.js security vulnerabilities.

Frequently Asked Questions about security-nextjs

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

FAQPage Schema
How do I audit my Next.js application for security vulnerabilities?

You can audit Next.js security vulnerabilities by running a shell script that uses ripgrep for pattern matching to scan for exposed environment variables, unauthenticated Server Actions, and middleware configuration gaps.

How do I detect exposed environment variables in a Next.js project?

To detect exposed environment variables in Next.js, scan the codebase for `NEXT_PUBLIC_` prefixes and review `next.config.js` env settings to identify secrets accidentally exposed to the client.

How can I check if my Next.js Server Actions and API routes have missing authentication?

You can check Next.js Server Actions and API routes for missing authentication by analyzing file patterns to verify that proper authorization and authentication mechanisms are enforced before execution.

What does middleware configuration review for Next.js App Router security involve?

Middleware configuration review for Next.js App Router security involves inspecting `middleware.ts` to ensure proper route matching and consistent authentication enforcement across protected application paths.

Can I scan a Next.js project for security misconfigurations before deploying a new feature?

Yes, you can scan a Next.js project for security misconfigurations before deploying by running an automated directory scan that identifies environment variable exposure and unauthenticated routes.

Why does my Next.js security audit report missing middleware authentication gaps?

A Next.js security audit reports missing middleware authentication gaps when pattern analysis of `middleware.ts` detects incomplete route matching or a lack of auth enforcement for protected paths.