Back to skill

Security audit

Nextjs Expert

Security checks for vulnerabilities and agentic risk

Overview

This Next.js guide is mostly ordinary, but some sample API code could lead users to build unsafe unauthenticated create and delete endpoints.

Review this skill carefully before installing. It is markdown-only and does not appear to execute code, but users should not copy its Basic CRUD route-handler examples into a real app without adding authentication, authorization, strict input validation, field allowlisting, and safer deletion controls.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:570
Finding

Unauthenticated record creation with unsafe mass assignment

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:586
Finding

Unauthenticated deletion of arbitrary records

Content
View full analysis
}) { const { id } = await params await db.post.delete({ where: { id } }) return new NextResponse(null, { status: 204 }) } ``` ### Technical Analysis The deletion handler uses a caller-controlled route parameter as the database record identifier and deletes the matching record without authenticating the requester or verifying ownership or administrative permission. This is a missing function-level and object-level authorization flaw. Knowledge of a record identifier is treated as sufficient authority to delete that record. Predictable or discoverable identifiers would make exploitation particularly straightforward. The code appears as an implementation example rather than an active endpoint in this repository. Nevertheless, copying it into an application would expose a destructive operation without the minimum access controls required for production-grade functionality. ### Attack Path 1. A developer adopts the example as `app/api/posts/[id]/route.ts`. 2. The route is exposed as `DELETE /api/posts/{id}`. 3. An unauthenticated attacker obtains post identifiers from public pages, API responses, enumeration, logs, or predictable ID generation. 4. The attacker sends a DELETE request for a post belonging to another user. 5. The handler passes the supplied identifier directly to `db.post.delete`. 6. The targeted database record is deleted without any authentication or ownership check. 7. The attacker repeats the request for additional identifiers, potentially causing broad data loss. ### Impact Assessment Any network client able to reach the endpoint may delete records identified by the route parameter. The immediate impact includes unauthorized data d ...[truncated 372 chars]
Remediation
View remediation
}, ) { const session = await auth() if (!session?.user?.id) { return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }) } const { id } = await params const post = await db.post.findUnique({ where: { id } }) if (!post) { return NextResponse.json({ error: 'Not found' }, { status: 404 }) } const isAdmin = session.user.role === 'admin' if (post.authorId !== session.user.id && !isAdmin) { return NextResponse.json({ error: 'Forbidden' }, { status: 403 }) } await db.post.delete({ where: { id } }) return new NextResponse(null, { status: 204 }) } ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes very broad terms such as 'Next', 'use server', and 'use client' that are likely to match many unrelated prompts and cause this skill to activate unexpectedly. Over-broad activation can route users into specialized guidance in the wrong context, increasing the chance of unsafe or irrelevant code generation and creating prompt-scope confusion.

Content

No source excerpt is available for this finding.

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 322)May include surrounding context.

tsx
export default async function PostsPage() {
  const posts = await fetch('https://api.example.com/posts').then(r => r.json())
  return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>
}

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 362)May include surrounding context.

tsx
export default async function PostsPage() {
  const posts = await fetch('https://api.example.com/posts').then(r => r.json())
  return <ul>{posts.map(p => <li key={p.id}>{p.title}</li>)}</ul>
}

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The root layout example sets <html lang="en">, which imposes an English locale in natural-language-facing output without any opt-in or note that this is only illustrative. Because the file is a skill guide, this can steer users toward a fixed language choice contrary to locale-flexible policy expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.