Back to skill

Security audit

Phy Bundle Size Audit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent local bundle-analysis guide with some ordinary npm supply-chain caution points.

Before using the npm or npx examples, prefer project devDependencies with pinned versions, committed lockfiles, npm ci in CI, and least-privilege CI secrets. The local parsing snippets are consistent with the skill's bundle-audit purpose.

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:559
Finding
Unpinned npm Dependencies and Registry-Resolved npx Execution## Vulnerability Details **File Location**: `SKILL.md`, lines 559-560, 570, 592, 597, and 640-643 **Vulnerability Type**: Supply-chain exposure through unpinned package installation and execution **Risk Level**: Medium ### Vulnerable Code ```bash npm uninstall moment npm install date-fns ``` ```bash # OR install lodash-es: npm install lodash-es ``` ```bash npx bundlesize ``` ```bash npx size-limit ``` ```bash npm install --save-dev webpack-bundle-analyzer # Generate report npx webpack-bundle-analyzer stats.json dist/ --no-open --report report.html ``` ### Technical Analysis The Skill recommends installing npm packages without exact version constraints or documented integrity controls. It also invokes `bundlesize` and `size-limit` directly through `npx`. When an explicitly pinned local dependency is unavailable, `npx` can resolve and download a package from the configured npm registry before executing its binary. Consequently, the code executed by these instructions is not fixed at Skill review time and may change as new package releases are published. npm package installation may also execute package lifecycle scripts. A compromised package release, maintainer account, registry response, or transitive dependency could therefore introduce arbitrary code into the installation or execution process. No package referenced by the Skill was demonstrated to be malicious. The vulnerability is the unsafe, mutable dependency execution pattern rather than evidence of an active malicious payload. ### Attack Path 1. An attacker compromises a referenced package, one of its transitive dependencies, its maintainer account, or the registry path used by the environment. 2. The attacker publishes or serves a malicious package version. 3. A developer or CI pipeline follows the Skill's instructions and runs an unversioned `npm install` or `npx` command. 4. npm resolves the mutable package version from the r ...[truncated 920 chars]
Remediation
## Remediation Suggestions 1. Add required tools to the project's `devDependencies` using reviewed, exact versions rather than resolving the latest available releases at execution time: ```bash npm install --save-dev --save-exact bundlesize@VERSION size-limit@VERSION webpack-bundle-analyzer@VERSION ``` 2. Pin optimization dependencies such as `date-fns` and `lodash-es` to reviewed versions where the instructions are intended for reproducible automation. 3. Commit `package-lock.json` and use: ```bash npm ci ``` in CI to enforce lockfile-resolved versions and integrity hashes. 4. Prevent `npx` from downloading missing packages: ```bash npx --no-install bundlesize npx --no-install size-limit npx --no-install webpack-bundle-analyzer stats.json dist/ --no-open --report report.html ``` 5. Prefer package scripts that execute lockfile-managed local binaries: ```json { "scripts": { "check:bundle": "bundlesize", "analyze:bundle": "webpack-bundle-analyzer stats.json dist/ --no-open --report report.html" } } ``` 6. Review dependency changes and lockfile diffs, enable automated vulnerability monitoring, and restrict CI secrets and workflow-token permissions according to least privilege. 7. Where compatible with the required packages, disable unnecessary lifecycle scripts during installation or explicitly review packages that require them.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger list includes generic phrases such as "reduce bundle size", "chunk size", "size limit", and "which package is largest" that could appear in ordinary conversation outside an explicit request to invoke this skill. The file provides examples but no negative examples or tighter activation constraints to distinguish when the skill should and should not activate.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding
The skill instructs users to run `npx bundlesize`, which fetches and executes the latest package version at runtime unless a specific version is pinned. That creates a supply-chain risk: a compromised upstream package, typo-squatted resolution, or breaking release could execute unintended code in the developer or CI environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding
The skill recommends `npx size-limit` without version pinning, so execution depends on whatever version is resolved at invocation time. In CI or local environments this can lead to arbitrary third-party code execution from an unexpected or compromised release, making it a classic supply-chain exposure.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding
Using `npx webpack-bundle-analyzer` without an explicit version allows the latest package to be downloaded and executed on demand. Because this tool is intended for developer machines and CI, an upstream compromise or unexpected release could directly impact trusted build environments.

Static analysis

No suspicious patterns detected.