Back to skill

Security audit

Wip Universal Installer

Security checks for vulnerabilities and agentic risk

Overview

This installer has a coherent broad installation purpose, but it can make persistent agent and global system changes from repository contents with unsafe command and path handling.

Install only after reviewing the target repository and this installer’s actions. Avoid running it automatically from an agent on your main machine; prefer an isolated environment. Be especially careful with --dry-run, remote repo targets, Claude Code hooks, MCP registrations, and any repo whose package name, scripts, or claudeCode.hook metadata you have not inspected.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
install.js:758
Finding
Shell Command Injection Through Unescaped CLI Arguments and Repository URLs<![CDATA[ ## Vulnerability Details **File Location**: `install.js:758-771`, `install.js:793-797`, and `install.js:818-840` **Vulnerability Type**: OS command injection **Risk Level**: Critical ### Vulnerable Code ```javascript const flags = args.filter(a => a.startsWith('--')); const rawTarget = process.argv[2]; execSync(`ldm install ${rawTarget} ${flags.join(' ')}`, { stdio: 'inherit' }); ``` The same unsafe delegation is repeated after bootstrapping LDM OS: ```javascript const flags = args.filter(a => a.startsWith('--')); const rawTarget = process.argv[2]; try { execSync(`ldm install ${rawTarget} ${flags.join(' ')}`, { stdio: 'inherit' }); process.exit(0); } catch (delegateErr) { if (!JSON_OUTPUT) console.error(' ldm install failed. Falling back to standalone installer.'); } ``` The standalone clone fallback also interpolates an untrusted URL into shell commands: ```javascript if (target.startsWith('http') || target.startsWith('git@') || target.match(/^[\w-]+\/[\w.-]+$/)) { const isShorthand = target.match(/^[\w-]+\/[\w.-]+$/); const httpsUrl = isShorthand ? `https://github.com/${target}.git` : target; const sshUrl = isShorthand ? `git@github.com:${target}.git` : target.replace(/^https:\/\/github\.com\//, 'git@github.com:'); const repoName = basename(httpsUrl).replace('.git', ''); repoPath = join('/tmp', `wip-install-${repoName}`); try { if (existsSync(repoPath)) { execSync(`rm -rf "${repoPath}"`); } try { execSync(`git clone "${httpsUrl}" "${repoPath}"`, { stdio: 'pipe' }); } catch { if (existsSync(repoPath)) execSync(`rm -rf "${repoPath}"`); execSync(`git clone "${sshUrl}" "${repoPath}"`, { stdio: 'pipe' }); } } } ``` ### Technical Analysis `execSync()` executes string commands through a shell. `rawTarget`, arbitrary arguments beginning with `--`, `httpsUrl`, and `sshUrl` are incorporated without shell escaping or strict validation. Quotation marks around the clone UR ...[truncated 1298 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace every string-form `execSync()` invocation with `execFileSync()` or `spawnSync()` and pass arguments as an array: ```javascript execFileSync('ldm', ['install', target, ...validatedFlags], { stdio: 'inherit', }); execFileSync('git', ['clone', '--', httpsUrl, repoPath], { stdio: 'pipe', }); ``` - Allowlist supported flags instead of accepting every argument beginning with `--`. - Parse repository URLs with `new URL()` and allow only explicitly supported protocols and hosts. - Reject targets containing control characters, NUL bytes, or unsupported URL syntax. - Replace `rm -rf` shell commands with `fs.rmSync(path, { recursive: true, force: true })`. - Add automated regression tests using semicolons, quotes, command substitutions, newlines, and option-like repository names. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
install.js:596
Finding
Package-Name Path Traversal Enables Arbitrary Deletion and Writes Under the User Home Directory<![CDATA[ ## Vulnerability Details **File Location**: `install.js:596-602`, `install.js:286-288`, `install.js:321-340`, and `install.js:532-534` **Vulnerability Type**: Path traversal and unsafe recursive deletion **Risk Level**: Critical ### Vulnerable Code The package name is treated as a safe directory name without validation: ```javascript function installSingleTool(toolPath) { const { interfaces, pkg } = detectInterfaces(toolPath); const ifaceNames = Object.keys(interfaces); if (ifaceNames.length === 0) return 0; const toolName = pkg?.name?.replace(/^@\w+\//, '') || basename(toolPath); ``` It is then used to construct deployment paths: ```javascript function deployExtension(repoPath, name) { const ldmDest = join(LDM_EXTENSIONS, name); const ocDest = join(OC_EXTENSIONS, name); ``` Existing destinations are recursively deleted before attacker-controlled repository content is copied: ```javascript if (existsSync(ldmDest)) { execSync(`rm -rf "${ldmDest}"`, { stdio: 'pipe' }); } mkdirSync(ldmDest, { recursive: true }); cpSync(repoPath, ldmDest, { recursive: true, filter: (src) => !src.includes('.git') && !src.includes('node_modules') && !src.includes('ai/') }); if (existsSync(join(ldmDest, 'package.json'))) { try { execSync('npm install --omit=dev', { cwd: ldmDest, stdio: 'pipe' }); ok(`LDM: dependencies installed`); } catch { skip(`LDM: no deps needed`); } } ``` The same untrusted name controls Skill deployment: ```javascript function installSkill(repoPath, toolName) { const skillSrc = join(repoPath, 'SKILL.md'); const ocSkillDir = join(OC_ROOT, 'skills', toolName); const ocSkillDest = join(ocSkillDir, 'SKILL.md'); ``` ### Technical Analysis `path.join()` normalizes `..` components. It does not guarantee that the resulting path remains beneath the intended parent directory. A local or cloned repository can provide a malformed `package.json` name such as `../../.ssh`. The code does not enforce npm package- ...[truncated 1483 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Validate package names before using them as filesystem components. Prefer a strict identifier such as: ```javascript const safeNamePattern = /^[a-z0-9][a-z0-9._-]*$/; ``` - After removing a valid npm scope, reject names containing `/`, `\`, `..`, absolute-path prefixes, control characters, or platform-specific separators. - Resolve and verify every destination remains under its expected root: ```javascript const root = resolve(LDM_EXTENSIONS); const destination = resolve(root, safeName); if (destination === root || !destination.startsWith(root + sep)) { throw new Error('Unsafe extension destination'); } ``` - Repeat containment validation immediately before deletion, copying, directory creation, and file writing. - Use `rmSync(destination, { recursive: true, force: true })` only after containment checks. - Do not follow symbolic links in extension roots; inspect every relevant path component with `lstat`. - Add tests covering scoped names, `../`, absolute paths, backslashes, symlink escapes, Unicode separators, and malformed package metadata. ]]>

T03 · Remote Payload Retrieval and Execution

Error
Location
install.js:741
Finding
Unrequested, Unpinned Global LDM OS Installation Occurs Before Dry-Run Enforcement<![CDATA[ ## Vulnerability Details **File Location**: `install.js:741-745` and `install.js:753-800` **Vulnerability Type**: Unsafe remote package bootstrap and dry-run contract violation **Risk Level**: High ### Vulnerable Code ```javascript // If ldm is not on PATH, try to install it silently before falling back. function bootstrapLdmOs() { try { execSync('npm install -g @wipcomputer/wip-ldm-os', { stdio: 'pipe', timeout: 120000 }); execSync('ldm --version', { stdio: 'pipe', timeout: 5000 }); return true; } catch { return false; } } ``` The package is installed automatically when `ldm` is absent: ```javascript if (!ldmAvailable) { if (!JSON_OUTPUT) { console.log(''); console.log(' Installing LDM OS infrastructure...'); console.log(''); } if (bootstrapLdmOs()) { ldmAvailable = true; if (!JSON_OUTPUT) { console.log(' LDM OS installed. Delegating to ldm install...'); console.log(''); } const flags = args.filter(a => a.startsWith('--')); const rawTarget = process.argv[2]; try { execSync(`ldm install ${rawTarget} ${flags.join(' ')}`, { stdio: 'inherit' }); process.exit(0); } catch (delegateErr) { if (!JSON_OUTPUT) console.error(' ldm install failed. Falling back to standalone installer.'); } } } ``` ### Technical Analysis The bootstrap retrieves the current registry-selected version of `@wipcomputer/wip-ldm-os` and installs it globally without an explicit confirmation step or an exact version. npm installation can execute package lifecycle scripts, and the newly installed `ldm` executable is immediately invoked. This happens before the standalone installer applies its `DRY_RUN` behavior. Therefore, a command presented as detection-only can still modify global npm state, download code, execute package installation scripts, and introduce a global executable. The behavior exceeds the minimum privileges necessary for interface detection. It also expands th ...[truncated 1050 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Never bootstrap additional software during `--dry-run` or `--json` operations. - Require explicit, informed user consent before installing LDM OS. - Add an opt-in flag such as `--install-ldm`; default to the audited standalone implementation otherwise. - Pin an exact reviewed version and verify package integrity before execution. - Prefer a project-local dependency or isolated temporary environment over global installation. - Consider installing with lifecycle scripts disabled where compatible: ```text npm install --ignore-scripts --save-exact ... ``` - Clearly document that delegation changes the executing implementation and trust boundary. - Do not immediately execute a newly downloaded binary until its provenance and integrity have been verified. ]]>

T06 · System Persistence

Error
Location
install.js:234
Finding
Untrusted Repositories Can Execute npm Lifecycle Scripts and Install Persistent Agent Hooks<![CDATA[ ## Vulnerability Details **File Location**: `install.js:234-245`, `install.js:336-340`, `install.js:458-523`, and `detect.mjs:52-63` **Vulnerability Type**: Untrusted code execution and persistent configuration installation **Risk Level**: High ### Vulnerable Code A repository-controlled build script is executed automatically: ```javascript // If the package has a build script and dist/ is missing, build first if (pkg?.scripts?.build && !existsSync(join(repoPath, 'dist'))) { try { log(`CLI: building ${binNames.join(', ')} (TypeScript)...`); execSync('npm run build', { cwd: repoPath, stdio: 'pipe' }); } catch (e) { fail(`CLI: build failed. ${e.stderr?.toString()?.slice(0, 200) || e.message}`); } } try { execSync('npm install -g .', { cwd: repoPath, stdio: 'pipe' }); ``` Copied extensions also receive a normal npm installation, which permits lifecycle scripts: ```javascript if (existsSync(join(ldmDest, 'package.json'))) { try { execSync('npm install --omit=dev', { cwd: ldmDest, stdio: 'pipe' }); ok(`LDM: dependencies installed`); } catch { skip(`LDM: no deps needed`); } } ``` Hook detection trusts either repository metadata or the mere presence of `guard.mjs`: ```javascript // 6. Claude Code Hook: guard.mjs or claudeCode.hook in package.json if (pkg?.claudeCode?.hook) { interfaces.claudeCodeHook = pkg.claudeCode.hook; } else if (existsSync(join(repoPath, 'guard.mjs'))) { interfaces.claudeCodeHook = { event: 'PreToolUse', matcher: 'Edit|Write', command: `node "${join(repoPath, 'guard.mjs')}"`, timeout: 5 }; } ``` The repository-supplied hook is written into persistent Claude Code settings: ```javascript const hookCommand = existsSync(installedGuard) ? `node ${installedGuard}` : (door.command || `node "${join(repoPath, 'guard.mjs')}"`); settings.hooks[event].push({ matcher: door.matcher || undefined, hooks: [{ type: 'command', command: hookCommand, timeout: door.time ...[truncated 2375 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Separate detection from installation and present an explicit installation plan before making changes. - Require confirmation for each privileged interface: global CLI, dependency installation, MCP registration, OpenClaw extension, Skill, and Claude Code hook. - Display all lifecycle scripts and hook commands before execution. - Do not accept arbitrary hook commands from `package.json`. Construct commands from validated, deployed files under a controlled root. - Allowlist hook events and matchers, and validate timeout values and command arguments. - Install dependencies with lifecycle scripts disabled by default: ```text npm install --omit=dev --ignore-scripts ``` - If lifecycle scripts are essential, require a separate explicit opt-in and run them in a sandbox with restricted filesystem, network, and environment access. - Avoid global npm installation by default; prefer local installation and explicit linking. - Back up configuration before modification and provide an uninstall command that removes every MCP registration, hook, Skill, extension, and registry entry. - Record cryptographic hashes of installed files so later changes can be detected. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (18)

Agent Config Directory Access

High
Category
Agent Snooping
Content
| `mcp-server.mjs` | MCP | Prints `.mcp.json` config |
| `openclaw.plugin.json` | OpenClaw | Copies to `~/.openclaw/extensions/` |
| `SKILL.md` | Skill | Reports path |
| `guard.mjs` or `claudeCode.hook` | CC Hook | Adds to `~/.claude/settings.json` |

## Real Examples
Confidence
95% confidence
Finding
The reference explicitly states that detected hook files may be added to ~/.claude/settings.json, which is a trusted agent configuration file. Allowing a repository scanner/installer to register hooks into agent config creates a persistence and code-execution path where untrusted repository content can influence future agent behavior beyond the current install session.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description materially understates the installer’s behavior: the finding indicates it can globally install external packages, clone remote repositories, delegate execution to another installer layer, modify multiple user configuration files, alter .gitignore, and delete or migrate existing integrations. This is dangerous because users and policy engines may grant trust based on the benign-sounding description while the actual behavior has broad system, network, and persistence implications that could be abused to run unreviewed code or alter developer environments.

Ae1

High
Category
analysis-evasion
Content
import { detectInterfaces, describeInterfaces, detectInterfacesJSON } from './detect.mjs';
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
5. **Skill** ... `SKILL.md`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Agent Config Directory Access

High
Category
Agent Snooping
Content
**Detection:** `guard.mjs` exists, or `pkg.claudeCode.hook` is defined.

**Install:** Added to `~/.claude/settings.json` under `hooks`.

```json
{
Confidence
90% confidence
Finding
Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Missing User Warnings

High
Confidence
99% confidence
Finding
The migration routine forcefully deletes extension directories, MCP registrations, skill directories, and registry entries using `rm -rf` and config rewrites without user confirmation. If matching logic is wrong or manipulated, this can destroy user data and remove unrelated installed tools or agent integrations.

Credential Access

High
Category
Privilege Escalation
Content
args: [mcpPath],
      };
      if (existsSync(OC_ROOT)) {
        ocMcp.mcpServers[name].env = { OPENCLAW_HOME: OC_ROOT };
      }
      writeJSON(OC_MCP, ocMcp);
      ok(`MCP (OC): registered ${name} in ${OC_MCP}`);
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Agent Config Directory Access

High
Category
Agent Snooping
Content
console.log('    MCP Server ... mcp-server.mjs -> claude mcp add --scope user');
    console.log('    OpenClaw   ... openclaw.plugin.json -> ~/.ldm/extensions/ + ~/.openclaw/extensions/');
    console.log('    Skill      ... SKILL.md -> ~/.openclaw/skills/<tool>/');
    console.log('    CC Hook    ... guard.mjs or claudeCode.hook -> ~/.claude/settings.json');
    console.log('');
    console.log('  Modes:');
    console.log('    Single repo  ... installs one tool');
Confidence
94% confidence
Finding
The skill accesses and modifies agent configuration under `~/.claude/settings.json`, a high-sensitivity location controlling persistent Claude Code behavior. In this installer context, that access is especially dangerous because it is used to register hooks that can trigger future command execution.

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.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The installer documentation describes actions that install packages globally and modify user-level agent configuration locations, but it does not clearly warn users that running the installer may change persistent system or agent settings. In an agent-executed context, this omission is dangerous because users or calling agents may treat detection/install as low-risk and unknowingly permit repository-driven changes to trusted execution surfaces.

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill advertises installation and repository scanning behavior but does not declare any explicit tool scope or allowed tools, despite requiring environment/system capabilities. For an installer that may invoke npm, git, and node and potentially modify user state, missing permission boundaries makes its effective authority ambiguous and increases the risk of unintended or overly broad execution.

Session Persistence

Medium
Category
Rogue Agent
Content
ok(`MCP (CC): registered ${name} at user scope`);
      ccRegistered = true;
    } catch (e) {
      // Fallback: write to ~/.claude/.mcp.json
      try {
        const mcpConfig = readJSON(ccMcpPath) || { mcpServers: {} };
        mcpConfig.mcpServers[name] = {
Confidence
91% confidence
Finding
Writing MCP server entries into `~/.claude/.mcp.json` creates persistent user-scope agent behavior that survives the current session. While persistence is part of installation, it is security-relevant because it causes future executions of repo-derived code from agent tooling without a fresh trust decision.

Context-Inappropriate Capability

Medium
Confidence
98% confidence
Finding
The installer writes command hooks into `~/.claude/settings.json`, creating persistent execution of repository-provided commands on future Claude Code events. This is a sensitive user-agent configuration change that can lead to unreviewed code execution well after installation and exceeds a narrow 'repo installer' expectation.

Context-Inappropriate Capability

Medium
Confidence
96% confidence
Finding
The installer edits the target repository's `.gitignore`, which is outside the stated purpose of detecting and installing interfaces. Modifying project source trees can create surprising side effects, hide files from version control, and alter developer workflow without consent.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The installer changes `.gitignore` automatically and without warning, altering repository state in a way users may not notice immediately. Even if the entry seems harmless, unexpected source-tree mutation is unsafe behavior for an installer and can conceal generated worktree artifacts from review.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The installer goes beyond scanning and installing interfaces from the target repository by silently installing and delegating to a separate global package (`@wipcomputer/wip-ldm-os`). That expands trust to unrelated code, changes the system state globally, and can cause execution paths the user did not request or review.

Missing User Warnings

Medium
Confidence
99% confidence
Finding
The code silently performs `npm install -g @wipcomputer/wip-ldm-os` without prior confirmation. Installing global software changes the host environment, extends the trusted codebase, and can execute package lifecycle scripts, making this risky in an installer that users may expect to be limited to the target repo.

Description-Behavior Mismatch

Medium
Confidence
87% confidence
Finding
The skill manifest says this installer 'scans a repo, detects which interfaces it exposes, and installs them all,' which describes detection and installation of existing interfaces. In package.json, the description instead says it 'teaches your AI how to build repos with every interface,' implying a repo-generation or enablement capability rather than just detection/installation, creating a meaningful intent mismatch.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
install.js:35