Back to skill

Security audit

npm

Security checks for vulnerabilities and agentic risk

Overview

This is a focused npm release helper with no hidden code, but users should avoid pasting one-time passwords into command-line examples.

Use this only for intentional npm release work. Prefer npm's interactive OTP prompt or trusted publishing instead of inserting an OTP into a command, and confirm the package directory, version, and tag before running any publish or dist-tag command.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:61
Finding
npm One-Time Password Exposed Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:61` and `SKILL.md:73` **Vulnerability Type**: Sensitive credential exposure through process arguments and shell history **Risk Level**: Medium ### Vulnerable Code ```bash npm publish --access public --otp="<otp>" ``` ```bash npm publish --access public --tag beta --otp="<otp>" ``` ### Technical Analysis The documented publishing workflow instructs users or agents to substitute an npm one-time password directly into the `--otp` command-line argument. Although obtaining an OTP is legitimate for an authenticated npm publication, placing the value in a command exposes it to local observation channels such as: - Shell history files - Terminal or tmux logging - Command auditing and session-recording systems - Debug output or shell tracing - Process inspection while the command is running - Agent execution transcripts The related instruction at `SKILL.md:47` limits OTP retrieval to situations where npm requires it and therefore does not, by itself, exceed the publishing task's necessary privileges. No instruction sends the OTP to an unrelated service. The weakness is the insecure transfer of that credential from the password manager into a visible command-line argument. ### Attack Path 1. A release operator or agent initiates an npm publication that requires an OTP. 2. The OTP is retrieved through the referenced 1Password workflow. 3. The operator or agent replaces `<otp>` with the actual value in one of the documented commands. 4. The resulting command is captured through shell history, tmux logging, process monitoring, execution transcripts, or terminal-session recording. 5. An attacker with access to that local observation channel extracts the OTP before it expires. 6. If the attacker also has a usable npm authentication session or token, they may reuse the OTP to authorize a malicious publication or another protected npm operation during the OTP's validity window. ### Impact Assessment Succe ...[truncated 651 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer npm's interactive OTP prompt rather than embedding the OTP in the command: ```bash npm publish --access public ``` For beta releases: ```bash npm publish --access public --tag beta ``` 2. Allow npm to request the OTP interactively only when the registry requires it. Retrieve the OTP immediately before entry and do not paste it into a reusable command. 3. Explicitly prohibit recording OTPs in shell history, agent transcripts, logs, scripts, environment files, or release documentation. 4. Ensure shell tracing is disabled while handling credentials: ```bash set +x ``` 5. Disable tmux session logging and avoid terminal-recording environments during credential entry. 6. Where supported by the release process, use npm trusted publishing or another short-lived, workload-identity-based mechanism so that human OTP handling is unnecessary. 7. Update the Skill guardrail to state that the 1Password workflow may retrieve the OTP only for immediate interactive entry into npm and must not print, persist, or interpolate it into a command line. ]]>
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

Static analysis

No suspicious patterns detected.