security-nextjs

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

Updated Aug 17, 2025
One-click install
npx skills add https://github.com/global-ministries/global-connect --skill security-nextjs-global-ministries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: security-nextjs
Source: https://github.com/global-ministries/global-connect/tree/main/.agent/skills/security-nextjs
Command: npx skills add https://github.com/global-ministries/global-connect --skill security-nextjs-global-ministries

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps developers identify and fix common security vulnerabilities in Next.js applications, preventing data leaks and unauthorized access.

Core Features & Use Cases

  • Environment Variable Auditing: Detects accidental exposure of secrets prefixed with NEXT_PUBLIC_.
  • Server Action & API Security: Checks for missing authentication and authorization in server-side code.
  • Middleware Configuration: Verifies that middleware correctly protects routes.
  • Security Headers: Audits next.config.js for essential security headers.

Quick Start

Run the security scan script to check the current project for Next.js security issues.

Frequently Asked Questions about security-nextjs

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

FAQPage Schema
How do I audit a Next.js app for server actions and API routes security vulnerabilities?

To audit a Next.js app for security vulnerabilities, run an automated scan using shell scripts and ripgrep to detect missing authentication in server actions and API routes within your App Router and Pages Router patterns.

How do I check if my Next.js environment variables are exposed to the client?

Checking Next.js environment variable exposure involves scanning your codebase for secrets accidentally prefixed with NEXT_PUBLIC_, which makes them accessible to the client-side browser environment and vulnerable to data leaks.

How do I verify that Next.js middleware correctly protects my routes?

Verifying Next.js middleware route protection requires auditing your middleware configuration files to detect insecure patterns and ensure that authentication checks are properly enforced before rendering pages or processing server actions.

Can I use automated scripts to scan Next.js App Router for missing authentication?

You can use automated shell scripts utilizing ripgrep to scan Next.js App Router directories for unauthenticated server actions and API routes, detecting common security pitfalls without requiring manual code review.

How do I audit next.config.js for missing security headers?

Auditing next.config.js for security headers involves scanning the configuration file to verify the presence of essential HTTP security headers, ensuring your Next.js application is protected against common web vulnerabilities like cross-site scripting.