Back to skill

Security audit

Shadcn Ui

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent shadcn/ui implementation guide, with a notable but disclosed supply-chain caution around copy-paste package commands.

Before installing or using the commands, review the shadcn and next-themes packages, prefer exact pinned versions or locked project-local tooling, and be aware that broad triggers may invoke this skill for generic UI requests where shadcn/ui is not actually intended.

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
SKILL.md:34
Finding

Unpinned npm CLI Package Execution Through Mutable latest Tag

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 34-52
Vulnerability Type: T08: Insecure Dependencies
Risk Level: Medium

The installation instructions repeatedly use npx shadcn@latest, causing users to download and execute whichever package version the npm registry resolves under the mutable latest tag.

Vulnerable Code:

bash
# Initialize shadcn/ui in a Next.js project
npx shadcn@latest init

# Add individual components
npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add dialog
npx shadcn@latest add form
npx shadcn@latest add input
npx shadcn@latest add select
npx shadcn@latest add table
npx shadcn@latest add toast
npx shadcn@latest add dropdown-menu
npx shadcn@latest add sheet
npx shadcn@latest add tabs
npx shadcn@latest add sidebar

# Add multiple at once
npx shadcn@latest add button card input label textarea select checkbox

Technical Analysis

The latest npm distribution tag is mutable and does not identify an immutable, previously reviewed release. Depending on the local npm configuration, npx can retrieve the selected package version from a configured registry and execute its CLI code immediately. The instructions provide no exact version, lockfile enforcement, integrity value, provenance check, or package-source verification.

Consequently, the code that eventually runs can differ from the code available when this Skill was audited. Exploitation requires compromise of the legitimate package or publishing account, manipulation of the configured package registry, or another supply-chain event that causes shadcn@latest to resolve to a malicious release. This finding does not establish that the current shadcn package is malicious.

Attack Path

  1. An attacker compromises the package publisher, registry delivery path, or registry configured in the victim's npm environment.
  2. The attacker causes the mutable latest tag ...[truncated 1017 chars]
Remediation
View remediation

Remediation Suggestions

  • Replace the mutable tag with an exact, reviewed version, for example npx shadcn@<approved-exact-version>.
  • Record the approved version in project configuration and commit the relevant lockfile so dependency resolution is reproducible.
  • Configure npm to use an explicitly trusted registry and verify the package name, publisher, signatures, provenance attestations, and release integrity before execution.
  • Prefer installing the reviewed CLI as a pinned development dependency and invoking the locked local binary rather than downloading an arbitrary current release during every use.
  • In CI, enforce lockfile-only installation, restrict lifecycle scripts where feasible, use short-lived credentials, and run package tooling in a sandbox with least-privilege filesystem and network access.
  • Establish a controlled dependency-update process that reviews and tests newer releases before changing the pinned version.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (18)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest trigger list includes generic phrases such as "component library" (L009), "UI components" (L010), "dark mode" (L013), "theming" (L014), "dialog" (L016), and "command palette" (L020). These are common frontend terms that could invoke this skill for many unrelated frameworks or libraries, and the file does not provide exclusion conditions or tighter context boundaries.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The skill instructs users to execute npx shadcn@latest init, which pulls and runs the latest published package at execution time rather than a pinned, reviewed version. This creates a supply-chain risk: if the upstream package is compromised or a breaking/malicious release is published, users following the skill will execute untrusted code immediately.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This command uses npx shadcn@latest add button, which executes the newest package version without pinning. In a skill, that is risky because readers may copy-paste the command, causing arbitrary upstream code execution if the package or dependency chain is ever compromised.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The command npx shadcn@latest add card relies on an unpinned latest package, which is a classic supply-chain exposure. Because npx downloads and runs code on demand, any malicious or compromised release can affect users who trust this documentation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

npx shadcn@latest add dialog causes runtime retrieval and execution of the latest remote package. This is dangerous in instructional content because it normalizes executing unreviewed code and exposes consumers to package takeover or malicious release scenarios.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The unpinned npx shadcn@latest add form command creates supply-chain risk by trusting whatever version is current at execution time. In documentation, this broadens the blast radius because many users may run the exact command verbatim.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

npx shadcn@latest add input is a true issue because it fetches and executes unpinned code from the package registry. Even though the intent is normal developer setup, the delivery mechanism is still unsafe from a supply-chain perspective.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This example executes npx shadcn@latest add select, inheriting the same risk of arbitrary code execution from an unreviewed latest release. The skill context makes it somewhat more dangerous because it is presented as authoritative copy-paste guidance for production UI work.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The npx shadcn@latest add table instruction is vulnerable to supply-chain compromise because it does not constrain which code is executed. Any tampered or hijacked upstream release would be consumed immediately by users following the skill.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Using npx shadcn@latest add toast exposes users to the latest package state at run time, which is unsafe if that package or one of its transitive dependencies is compromised. As documentation, it implicitly encourages insecure operational habits around remote code execution.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The command npx shadcn@latest add dropdown-menu is a true positive because it executes an unpinned upstream CLI. This can be exploited through registry compromise, maintainer account takeover, or malicious package updates.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

npx shadcn@latest add sheet fetches and runs code that is not version-locked, making builds and onboarding non-reproducible and vulnerable to supply-chain attacks. The risk is real even though the example is commonplace and not intentionally harmful.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This command uses @latest, so users executing it are trusting the most recent package publication without review. In security terms, that is a true vulnerability pattern because it enables arbitrary code execution through compromised releases.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

npx shadcn@latest add sidebar is another unpinned remote execution example. Since the skill is meant to guide implementation, users are likely to run it verbatim, increasing the practical exposure compared with inert reference text.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The multi-component install command still uses npx shadcn@latest, so it has the same supply-chain and remote code execution concerns as the single-component examples. A single compromised release would affect all users who copy this command.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

This later example again instructs npx shadcn@latest add ..., repeating the unsafe pattern and reinforcing insecure practice. Repetition in a skill increases the likelihood that users will execute one of the commands without scrutiny.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The theming setup section includes another npx shadcn@latest add dropdown-menu command, which is still unpinned executable content. The context does not mitigate the risk; it remains a supply-chain exposure embedded in trusted documentation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

npx shadcn@latest add sonner is a true supply-chain risk because it executes the latest published package version at runtime. In a broadly reused skill, this can scale the impact of any upstream compromise across many downstream users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.