T08 · Insecure Dependencies
- Location
SKILL.md:180- Finding
Unpinned Third-Party Codemods Executed Through npx
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly Next.js guidance, but it needs review because it recommends unpinned remote codemods and includes examples that expose session tokens in rendered pages.
Install only if you are comfortable treating it as review-required guidance. Do not run the npx codemod commands verbatim without pinning or verifying the package version and reviewing changes in a clean branch or isolated environment. Do not copy examples that display session or token cookie values in HTML; use cookies server-side for authorization and render only non-sensitive state.
SKILL.md:180Unpinned Third-Party Codemods Executed Through npx
SKILL.md:108Session Tokens Rendered into Client-Visible HTML
Session: {token?.value}
; ``` A second example exposes a token in the same way: ```typescript const cookieStore = await cookies(); const token = cookieStore.get('token'); return{authenticated ? 'Authenticated' : 'Not authenticated'}
); ``` 4. Configure session cookies with `HttpOnly`, `Secure`, and an appropriate `SameSite` policy. 5. Use short token lifetimes, rotation, revocation, and replay protections where appropriate. 6. Review response logging, error tracking, APM, and browser telemetry configurations to ensure secrets are redacted. 7. Add automated secret-exposure tests or linting rules that reject rendering values retrieved from authentication cookies. 8. Revoke and rotate any real tokens that may already have been exposed through copied implementations. ]]>The documentation recommends executing npx @next/codemod@canary ..., which pulls and runs remote package code at invocation time without pinning to an immutable version. In a skill intended to guide developer actions, this creates a supply-chain risk because future package updates or a compromised canary release could execute unexpected code on the user's machine.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// Next.js 14: cached automatically (dangerous assumption)
export async function GET() {
const data = await fetch('https://api.example.com/data');
return Response.json(data);
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
// Next.js 14: cached automatically (dangerous assumption)
export async function GET() {
const data = await fetch('https://api.example.com/data');
return Response.json(data);
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
export default async function BlogPost({ params }: PageProps) {
const { slug } = await params; // Must await in v15+
const post = await fetch(https://api.com/posts/${slug});
return
This migration checklist instructs users to run a remote codemod package via npx using the mutable @canary tag. Because npx executes fetched code directly, an attacker controlling or compromising that release channel could achieve code execution in the developer environment.
The second checklist command again uses npx @next/codemod@canary, exposing users to execution of unpinned remote code. Repetition in a migration checklist increases the likelihood that users will run it verbatim, making the supply-chain exposure more operationally relevant.
The references section promotes another npx @next/codemod@canary command, which normalizes running mutable third-party code directly from documentation. In security terms this is a genuine supply-chain weakness, even if the author's intent is simply to provide convenient upgrade instructions.
The section labeled 'Pitfall 3' states 'App Router requires React 19' and immediately recommends installing latest React. This is an intent/documentation mismatch because the skill otherwise presents itself as accurate migration guidance for Next.js 15/16, but this statement is not generally true for all App Router usage and can mislead users about mandatory upgrades.
No suspicious patterns detected.