Back to skill

Security audit

performance-optimization

Security checks for vulnerabilities and agentic risk

Overview

This skill is a performance-tuning checklist; its only notable risk is unpinned npx tool examples users should pin before running.

Install is reasonable for performance work. Before running the CI examples, add trusted exact dev dependencies and use lockfile-verified local commands instead of allowing npx to fetch unpinned packages on demand.

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:266
Finding
Unpinned Third-Party Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md:266` **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ```bash npx lhci autorun ``` ### Technical Analysis The skill recommends executing `lhci` directly through `npx` without specifying a reviewed version, requiring a lockfile, or restricting execution to an already installed local package. If the package is unavailable locally, `npx` may retrieve and execute it from the configured package registry. Because the package name and version are not securely pinned, the effective executable can change after the skill has been reviewed. The short package name may also resolve to an unintended package rather than the expected Lighthouse CI tooling. This creates exposure to package compromise, package-name confusion, registry compromise, and unexpected upstream changes. ### Attack Path 1. A user or CI agent follows the instruction in `SKILL.md`. 2. The environment does not contain a trusted local executable matching `lhci`. 3. `npx` resolves the unpinned package through the configured package registry. 4. An attacker-controlled, compromised, or unintended package is downloaded. 5. Package lifecycle logic or the package CLI executes with the privileges of the user or CI runner. 6. The malicious code can access resources available to that process, including the source tree, environment variables, build artifacts, and CI credentials. ### Impact Assessment Successful exploitation permits arbitrary code execution with the invoking user's or CI runner's privileges. The accessible scope may include project files, repository credentials, package-registry tokens, deployment credentials, environment secrets, and build outputs. In a privileged CI environment, this could lead to source-code modification, secret theft, poisoned artifacts, or compromise of downstream deployment processes.
Remediation
## Remediation Suggestions 1. Verify the intended Lighthouse CI package and use its official, fully qualified package name. 2. Add a reviewed, exact version as a development dependency and commit the generated lockfile. 3. Run only the locally installed and lockfile-verified executable, for example with `npx --no-install`, rather than allowing on-demand registry retrieval. 4. Configure CI to use lockfile-enforcing installation commands such as `npm ci`. 5. Disable or strictly control dependency lifecycle scripts where operationally feasible. 6. Apply dependency integrity verification, automated vulnerability scanning, and controlled registry policies. 7. Apply the same pinning and local-only execution requirements to the `npx bundlesize` guidance near line 263 if it is used as an executable command.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Hidden Instructions

High
Category
Prompt Injection
Content
---
name: performance-optimization
version: 1.0.0
description: "Measure bottlenecks then optimize for performance"
Confidence
60% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

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.

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.

Static analysis

No suspicious patterns detected.