Back to skill

Security audit

Shadcn Theme Default

Security checks for vulnerabilities and agentic risk

Overview

This theme skill is mostly coherent, but it understates its scope and can run unpinned package-manager commands that execute third-party code.

Install only if you are comfortable with a frontend theming skill that may change React/TSX files and package dependencies, not just CSS. Before using it, require approval for `npm install` or `npx` steps, consider pinning package versions, and review generated or modified files before committing.

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:284
Finding
Unpinned Third-Party Package Installation and Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:284`, `SKILL.md:393`, and `SKILL.md:689` **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```markdown npm install next-themes ``` ```markdown The following components are available and all respect the theme tokens above. Install via `npx shadcn@latest add <component>`: ``` ```markdown 8. **Installing new components.** Use `npx shadcn@latest add <component>`. The CLI respects `components.json` and generates components with the correct theme tokens. ``` ### Technical Analysis The Skill instructs the agent to install `next-themes` without specifying an exact reviewed version and to execute `shadcn@latest` through `npx`. The `latest` tag is mutable and can resolve to a different package release each time the command is run. In addition, `npx` can download and immediately execute package CLI code. The package contains no lockfile, integrity checksum, provenance requirement, or allowlist identifying a previously reviewed release. Consequently, the effective code executed by the agent can change after this Skill has been audited. Likewise, `npm install next-themes` allows dependency resolution to select the current registry version and its transitive dependency graph. Package installation may invoke lifecycle scripts with the permissions of the process running the agent. This is a supply-chain weakness rather than evidence that the currently named packages are malicious. ### Attack Path 1. An agent loads the Skill and follows its component or dark-mode setup instructions. 2. The agent runs `npx shadcn@latest add <component>` or `npm install next-themes`. 3. The package manager resolves packages from the configured external registry. 4. If a package publisher account, registry entry, future release, or transitive dependency has been compromised, attacker-controlled package code is downloaded. 5. The package CLI or lifecycle script ex ...[truncated 1016 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace mutable package references with exact, reviewed versions: ```bash npm install --save-exact next-themes@<reviewed-version> npx --yes shadcn@<reviewed-version> add <component> ``` 2. Commit a lockfile and use deterministic installation commands such as `npm ci` where applicable. 3. Verify package integrity and provenance before execution, including registry origin, publisher identity, release signatures or attestations, and lockfile integrity hashes. 4. Require explicit user approval before executing package installation commands or third-party CLIs. 5. Avoid automatic use of the `latest` tag. Update pinned versions only after reviewing the new release and its dependency changes. 6. Run package-management commands in a sandbox or restricted environment with: - Access limited to the target project. - No unnecessary credentials or environment variables. - Restricted network access. - No administrative privileges. 7. Where feasible, disable lifecycle scripts during installation: ```bash npm install --ignore-scripts --save-exact next-themes@<reviewed-version> ``` If lifecycle scripts are required, review them before permitting execution. 8. Update the Skill's scope declaration. It currently claims to modify only CSS and Tailwind configuration, while its instructions also install dependencies and create or modify TSX component and layout files. The documented permissions and approval workflow should accurately reflect these operations. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The skill claims it only modifies CSS and Tailwind configuration files, but later directs creation or modification of React/TypeScript files such as `theme-provider.tsx` and `layout.tsx`. This mismatch undermines scope guarantees and can mislead users or policy systems into granting broader file-modification authority than intended.

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.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The skill expands from passive theme enforcement into shell-command execution (`cat`, `grep`, `npm install`, `npx ... add`), including networked package installation and code generation. That broadens the agent's operational scope and creates avoidable risk of unintended command execution, dependency changes, and supply-chain exposure.

Rp1

Medium
Category
MCP Rug Pull
Confidence
72% confidence
Finding
This instruction tells the agent to execute `npx shadcn@latest add <component>`, which fetches and runs remote code without pinning a version. In an agent skill, that increases supply-chain risk because behavior can change over time and the fetched package could introduce unintended code or file modifications.

Intent-Code Divergence

Low
Confidence
76% confidence
Finding
The planning section presents itself as mandatory and comprehensive before any action, yet its prescribed survey covers CSS, Tailwind config, and `components.json` only. Later sections require modifying `src/app/layout.tsx`, creating `theme-provider.tsx`, and potentially adding toggle components, so the 'mandatory' protocol does not match the actual documented workflow.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The example sets `<html lang="en">`, which imposes a specific language/locale choice. Under the policy, forcing a language without opt-in or a documented regional justification is a natural-language policy violation.

Static analysis

No suspicious patterns detected.