Back to skill

Security audit

Vercel React Best Practices

Security checks for vulnerabilities and agentic risk

Overview

This is a documentation-only React/Next.js performance skill, but some recommended examples could lead agents to generate insecure application code.

Review this skill before installing. It is not a self-executing malware package, but agents using it may copy insecure examples into your app. Avoid logging raw cookies or tokens, pin any CLI tools instead of using bare npx, restrict inline scripts to vetted static bootstraps, and do not use client-side storage or DOM mutation as an authority source for authentication.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
rules/server-after-nonblocking.md:44
Finding

Raw Session Credential Passed to an Unspecified Logging Pipeline

Content
View full analysis
{ const userAgent = (await headers()).get('user-agent') || 'unknown' const sessionCookie = (await cookies()).get('session-id')?.value || 'anonymous' logUserAction({ sessionCookie, userAgent }) }) ``` ### Technical Analysis The recommended example reads the raw value of the `session-id` cookie and passes it to `logUserAction`. A session identifier is generally a bearer credential: anyone who obtains a valid value may be able to impersonate the associated user until the session expires or is revoked. The destination and security properties of `logUserAction` are unspecified. It could write to local logs, a shared observability platform, or an external analytics service. Logging infrastructure commonly has broader access controls, longer retention periods, and more downstream integrations than the authentication system. Consequently, transmitting the raw session identifier into that pipeline violates data-minimization and least-privilege principles. Using `after()` does not mitigate this exposure. It only changes when the logging operation runs. ### Attack Path 1. An agent or developer applies the recommended example in a Next.js application. 2. An authenticated request supplies a valid `session-id` cookie. 3. The server reads the raw session credential and passes it to `logUserAction`. 4. The logging implementation stores or forwards the credential to a log aggregation or analytics system. 5. A malicious insider, compromised integration, exposed dashboard, or attacker with log access retrieves the session value. 6. If the session remains valid and is not bound to additional client properties, the attacker places the stolen value in a request cookie and impersonates the victim. ### Impact Assessment Successf ...[truncated 474 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
rules/rendering-svg-precision.md:26
Finding

Unpinned Package Download and Execution Through npx

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Unvalidated Output Injection

High
Category
Output Handling
Confidence
97% confidence
Finding

dangerouslySetInnerHTML is an output-injection sink, and its inclusion in a 'best practices' skill materially increases the chance that downstream code generation will reproduce unsafe inline-script patterns. If any future adaptation inserts dynamic or user-influenced data into that block, it becomes a direct XSS vector; additionally, inline scripts undermine strict CSP deployments.

Content

Scanner excerpt · AGENTS.md (reported line 2257)May include surrounding context.

md
{children}
      </div>
      <script
        dangerouslySetInnerHTML={{
          __html: `
            (function() {
              try {

Unvalidated Output Injection

High
Category
Output Handling
Confidence
65% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · rules/rendering-hydration-no-flicker.md (reported line 63)May include surrounding context.

md
{children}
      </div>
      <script
        dangerouslySetInnerHTML={{
          __html: `
            (function() {
              try {

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example explicitly shows non-blocking audit logging of user-agent and session-cookie-derived identifiers without minimization or privacy safeguards. In a broadly reusable best-practices skill, this can encourage logging sensitive session-linked identifiers into analytics or logs, increasing privacy, retention, and secondary-exposure risk if logs are accessed or breached.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill recommends an inline <script> populated via dangerouslySetInnerHTML for hydration behavior. Even though the shown payload is static, this normalizes a hazardous pattern in a best-practices document and can lead agents or developers to copy it into contexts where any interpolated data turns into XSS or CSP bypass issues.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The guidance explicitly recommends using an inline script via dangerouslySetInnerHTML to mutate the DOM before hydration. While the example itself uses a fixed script, it normalizes a powerful XSS-prone pattern in a general best-practices skill, making downstream users more likely to adapt it with dynamic or user-controlled values and bypass safer framework mechanisms.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The documentation overextends the pattern to authentication states, even though the example only reads localStorage and toggles a CSS class. Applying pre-hydration DOM mutation and localStorage-based client trust to auth-related UI can expose users to auth state spoofing, inconsistent access-control presentation, and unsafe reliance on client-side state for sensitive decisions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guidance overstates what useTransition guarantees and pairs those claims with an async function inside startTransition. In React, useTransition prioritizes state updates but does not itself make arbitrary async work safe, cancel network requests, or reliably provide the loading/error semantics claimed here, so developers may ship race-prone or misleading loading behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The claim that new transitions automatically cancel pending ones is unsafe in the context of fetchResults, because React transitions do not cancel in-flight network requests. This can lead to stale responses winning races, wasted network activity, and incorrect UI state if developers rely on the documentation as written.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file demonstrates background logging of a session cookie value and user-agent data, which are privacy-relevant identifiers, but the surrounding guidance contains no warning that such data may be collected or sent for logging/analytics. For markdown files, omissions of warnings about behaviors affecting user data or privacy should be flagged.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file describes deferring and embedding analytics, logging, and error-tracking components, but it does not include any user-facing warning that these integrations may transmit usage or system data to third parties. Under the markdown-specific SQP-2 criteria, privacy-affecting behaviors should be disclosed in the skill description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This markdown file recommends a pattern that performs result fetching during user input updates, but it does not disclose that the example initiates network/data retrieval behavior. Under the markdown-specific warning criterion, user-facing documentation should mention behaviors that may affect privacy or data transmission when such behavior is part of the illustrated skill behavior.

Content

No source excerpt is available for this finding.