Back to skill

Security audit

PM2 Gateway Restart

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward PM2-based OpenClaw gateway restart guide, with operational and supply-chain cautions but no hidden or malicious behavior.

Install this only if you intentionally want agents to help manage the local OpenClaw gateway with PM2. Pin and review the PM2 package version where practical, avoid elevated shells unless required, and confirm downtime impact before running production restart or reinstall commands.

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

Unpinned Global PM2 Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 67
Vulnerability Type: Unpinned third-party dependency installed globally
Risk Level: Medium

Complete Code Snippet:

powershell
npm install -g pm2

Technical Analysis

The setup instructions install PM2 globally without specifying a reviewed version or verifying package integrity. Consequently, the dependency resolved at installation time may differ from the version originally assessed. npm packages can also run lifecycle scripts during installation with the permissions of the invoking user.

This creates a supply-chain risk if a future PM2 release, its dependency tree, or the package distribution channel is compromised. The audit found no evidence that PM2 is currently malicious; the issue is the mutable and insufficiently verified installation process.

Attack Path

  1. An attacker compromises a future PM2 package release, a transitive dependency, or the package distribution channel.
  2. A user follows the documented setup command.
  3. npm resolves and downloads the mutable latest PM2 release because no version is pinned.
  4. Malicious package content or lifecycle scripts execute with the invoking user's permissions.
  5. The payload can access resources available to that user and potentially interfere with globally managed Node.js processes.

Impact Assessment

Successful exploitation could provide arbitrary code execution under the account running the installation. The affected scope may include that user's files, environment variables, npm configuration, and PM2-managed processes. If the command is run from an elevated shell, the impact could extend to administrative resources and system-wide Node.js tooling. No privilege escalation mechanism beyond the invoking account's existing permissions is demonstrated by the reviewed file.

Remediation
View remediation

Remediation Suggestions

  • Pin PM2 to a specifically reviewed version, for example npm install -g pm2@<reviewed-version>.
  • Obtain the package only from an explicitly trusted npm registry and document the expected registry configuration.
  • Verify package provenance and integrity before deployment.
  • Review the selected release and its transitive dependencies, including installation lifecycle scripts.
  • Prefer a reproducible, lockfile-backed deployment mechanism where operationally practical instead of resolving the latest global package dynamically.
  • Run installation with the least-privileged account necessary and avoid an elevated shell unless explicitly required.
  • Establish a controlled update process that reviews and tests new PM2 versions before changing the pinned version.
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
92% confidence
Finding

The skill instructs operators to restart and potentially reinstall the gateway service without clearly warning that these actions will interrupt a running service. In an automation or incident-response context, an agent could apply these commands immediately, causing avoidable downtime or disrupting active client connections.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.