Back to skill

Security audit

Phy Css Dead Code

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent CSS cleanup auditor, but it gives raw delete commands and runs unpinned npx tools in ways users should review before installing.

Install only if you are comfortable with a skill that scans broad project source files and may suggest deleting files. Run it in a clean version-controlled workspace, review every reported selector manually, avoid the provided `rm` commands until verified, and prefer locally installed lockfile-pinned Tailwind or Percy binaries instead of unpinned `npx`.

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

Error
Location
SKILL.md:155
Finding
Unpinned npm Packages May Be Downloaded and Executed Through npx<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:155-158` and `SKILL.md:513` **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: High ### Vulnerable Code ```bash if command -v npx &>/dev/null; then echo "" echo "Running Tailwind dry-run to check purged classes..." npx --yes tailwindcss -i ./input.css -o /tmp/tw-output.css --minify 2>/dev/null echo "Output size: $(du -h /tmp/tw-output.css 2>/dev/null | cut -f1)" fi ``` A second unpinned invocation appears in the suggested cleanup workflow: ```bash # 4. After cleanup, verify no regressions # Run your visual regression tests, or: npx percy snapshot --dry-run # if using Percy ``` ### Technical Analysis The skill invokes npm packages by package name without an exact version, lockfile-backed resolution, or integrity verification. If the requested package is not installed locally, `npx` can retrieve it from a configured npm registry and execute its CLI entry point. The `--yes` option on the Tailwind invocation suppresses the normal installation confirmation. Consequently, the effective executable code is mutable after the skill has been reviewed. A compromised package release, maintainer account, transitive dependency, registry, or npm configuration could cause attacker-controlled JavaScript to execute. Package lifecycle behavior and CLI startup code run with the same operating-system identity and environment available to the agent. Although the skill advertises zero external APIs, these commands can still create outbound registry traffic and retrieve executable third-party content. ### Attack Path 1. A user invokes the CSS dead-code skill in a project where `npx` is available. 2. The Tailwind analysis branch reaches `npx --yes tailwindcss`, or the user follows the suggested `npx percy` verification command. 3. The requested package is absent locally, or npm resolves a mutable version using registry and project configuration. 4. `npx` downloads the packa ...[truncated 1401 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not allow the skill to download packages implicitly. Require dependencies to be installed and reviewed before invocation. 2. Execute only the project-local binary and fail safely when it is absent: ```bash TAILWIND_BIN="./node_modules/.bin/tailwindcss" if [ -x "$TAILWIND_BIN" ]; then "$TAILWIND_BIN" -i ./input.css -o /tmp/tw-output.css --minify else echo "Tailwind CLI is not installed locally; skipping CLI analysis." fi ``` 3. Pin exact dependency versions in `package.json` and commit a lockfile with integrity metadata. Install dependencies through a controlled CI or setup phase using a command such as `npm ci`, rather than during the audit. 4. Replace `npx percy` with an explicitly installed, lockfile-pinned local binary such as `./node_modules/.bin/percy`. 5. If on-demand retrieval is unavoidable, require explicit user approval, specify an exact reviewed version, use a trusted registry, and enforce lockfile or integrity verification. 6. Run third-party tooling in a sandbox with minimal filesystem access, a sanitized environment, no sensitive credentials, and restricted outbound network access. 7. Update the documentation to disclose that `npx` may access an external package registry and execute downloaded code. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
# 1. Delete orphaned CSS Modules
rm src/components/OldCheckout.module.css
rm src/components/LegacyModal.module.css

# 2. Remove dead selectors from legacy.scss (verify first with grep above)
Confidence
97% confidence
Finding
This command directly deletes a source file using 'rm' based solely on the tool's heuristic classification of it as orphaned. In an agentic or copy-paste workflow, such a command can irreversibly remove legitimate project files, especially when naming heuristics fail or alternate import/use patterns exist.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
# 1. Delete orphaned CSS Modules
rm src/components/OldCheckout.module.css
rm src/components/LegacyModal.module.css

# 2. Remove dead selectors from legacy.scss (verify first with grep above)
# Edit src/styles/legacy.scss — remove the 18 selectors listed above
Confidence
97% confidence
Finding
This is another direct file deletion command that can destroy project assets if the heuristic is wrong or the file is referenced indirectly. The surrounding context presents the deletion as routine cleanup, which increases the likelihood that an agent or user will execute it without adequate review.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
MCP server references in the skill manifest without version pinning are a rug-pull risk.

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.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger phrases are broad and overlap with normal developer conversation, which can cause accidental invocation of a skill that runs filesystem scans and suggests destructive cleanup actions. In an agent environment, unintended activation can expose repository contents to tools, consume resources, and chain into riskier behaviors described later in the skill.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The enumerated trigger list contains ambiguous phrases that are likely to appear in ordinary discussion, increasing the chance of unintentional execution. Because this skill performs broad repository inspection and later recommends deletion operations, accidental activation is more dangerous than for a read-only informational skill.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding
The skill invokes 'npx --yes tailwindcss' without pinning an exact package version. That allows execution of whatever version resolves at runtime, which can introduce supply-chain risk, nondeterministic behavior, or execution of a compromised/newly published package in the user's environment.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill is framed as an audit tool but includes direct cleanup and deletion instructions, shifting from analysis into destructive modification guidance. In an agentic context, this increases the chance that an automated system may delete files based on heuristic results that can be wrong, causing code loss or regressions.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The cleanup section includes deletion commands and edit instructions without a strong upfront warning that these are destructive and based on heuristic analysis that may have false positives. Users or agents may treat the commands as safe defaults and remove files that are still needed, causing outages or loss of work.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding
The documentation recommends 'npx percy snapshot --dry-run' without an exact version pin. Even in dry-run mode, invoking an unpinned package via npx may download and execute arbitrary package code, creating a supply-chain exposure and inconsistent results across environments.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
The manifest description says the skill uses only `npx` and `grep`, but the documented implementation invokes `python3`, `find`, `du`, `wc`, `tr`, `head`, `xargs`, and `rm`. This is not just omitted detail: the wording actively narrows the toolchain in a way the code examples contradict, which can mislead users about runtime requirements and behavior.

Static analysis

No suspicious patterns detected.