Back to skill

Security audit

Next.js 15 Best Practices

Security checks for vulnerabilities and agentic risk

Overview

This is a mostly coherent Next.js guidance skill, but its migration guide tells agents/users to run mutable canary/latest package commands that execute external code without pinning or containment guidance.

Review the migration commands before use. Prefer pinned, reviewed versions of Next.js, React, and `@next/codemod`, run codemods in a clean branch or disposable environment, and inspect generated changes before merging. The rest of the skill is ordinary Next.js guidance.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
references/migration-config.md:6
Finding

Unpinned Package Retrieval and Execution During Migration

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/migration-config.md (reported line 69)May include surrounding context.

Environment Variables

bash
# .env.local
DATABASE_URL="postgresql://..."
NEXT_PUBLIC_API_URL="https://api.example.com"  # exposed to browser

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 71)May include surrounding context.

md
}

// fetch with cache control
const data = await fetch("https://api.example.com/data", {
  next: { revalidate: 60 },   // ISR: revalidate every 60s
  // cache: "no-store"         // always fresh
  // cache: "force-cache"      // static, until manual revalidation

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The guide recommends running npx @next/codemod@canary upgrade latest, which pulls and executes a canary package version at runtime rather than a stable, pinned release. In a migration guide, this increases supply-chain risk and reduces reproducibility because users may execute changing code with developer privileges.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.