Back to skill

Security audit

Clean Unused Deps

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple, purpose-aligned npm cleanup guide, but users should review results carefully before uninstalling packages.

Before installing or using this skill, treat depcheck output as a starting point, not proof. Review dynamic imports, scripts, configs, and framework conventions; commit or otherwise preserve your current state first; uninstall in small batches; then run tests and builds.

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:12
Finding

Unpinned Global Installation of a Third-Party npm Package

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 12–15
Vulnerability Type: Unpinned and globally installed third-party dependency
Risk Level: Medium

Vulnerable Code Snippet:

markdown
## Prerequisites

- Node.js and npm installed
- `depcheck` installed globally (`npm install -g depcheck`)

Technical Analysis

The skill instructs users to install depcheck globally without specifying a reviewed version, lockfile, package integrity value, or trusted registry. Consequently, npm resolves whichever version is current through the user's configured registry at execution time.

An npm installation may execute package lifecycle scripts and install transitive dependencies. Because the installation is global, any malicious package code runs with the invoking user's privileges and can modify the user's global Node.js environment. The effective installed code can also change after this skill has been reviewed.

This issue is conditional upon compromise or manipulation of the package, one of its transitive dependencies, or the configured npm registry. The audited file contains no evidence that depcheck itself is malicious.

Attack Path

  1. An attacker compromises a future depcheck release, one of its transitive dependencies, or the registry used by the victim.
  2. The victim follows the documented command npm install -g depcheck.
  3. npm resolves and downloads the uncontrolled package version and dependency graph.
  4. Malicious lifecycle scripts, if present and enabled, execute with the privileges of the invoking user.
  5. The malicious package can access user-readable data and alter files or global Node.js packages permitted by those privileges.

Impact Assessment

Successful exploitation could provide arbitrary code execution under the account running npm. The attacker could read or modify files accessible to that account, access environment variables and developer credentials available to the process, tamper with the globa ...[truncated 264 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the global installation prerequisite with a project-local development dependency.
  • Pin depcheck to a specifically reviewed version and commit the resulting lockfile.
  • Install dependencies using a reproducible command such as npm ci.
  • Explicitly document and enforce the expected trusted npm registry.
  • Verify package provenance and integrity before installation.
  • Disable lifecycle scripts during installation with --ignore-scripts where compatible with the reviewed package.
  • Run dependency-analysis tooling in an isolated, least-privileged environment without production credentials or sensitive environment variables.
  • Periodically review the pinned package and its transitive dependencies before upgrading.
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 (1)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to uninstall dependencies based solely on depcheck results without warning that depcheck can miss dynamically used, build-time, or configuration-referenced packages. Following these steps can modify the project state and remove required packages, causing broken builds, runtime failures, or accidental disruption of development workflows.

Content

No source excerpt is available for this finding.