Back to skill

Security audit

pharaoh

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about its code-intelligence service, but installation runs an unpinned remote npm package that can change installed skills and OpenClaw configuration.

Review the publisher and npm package before installing, prefer a pinned and verified package version, and install only for repositories you are comfortable having parsed by Pharaoh's remote service. Expect local OAuth tokens under `~/.pharaoh/`, persistent OpenClaw skill/config changes under `~/.openclaw/`, and server-side storage of repository structure metadata until deleted.

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:89
Finding
Unpinned Remote npm Package Execution Through npx## Vulnerability Details **File Location**: `SKILL.md`, lines 89-94; additional occurrences at lines 14 and 105 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```markdown ## Setup Steps 1. **Install the GitHub App** on your org at [github.com/apps/pharaoh-so](https://github.com/apps/pharaoh-so) — grants read-only access to selected repos 2. Pharaoh auto-maps selected repos into a knowledge graph (typically < 5 minutes) 3. Run `npx @pharaoh-so/mcp --install-skills` — installs skills + connects MCP server 4. Authorize via the device code shown in terminal (opens GitHub OAuth in browser) 5. Your agent now queries architecture instead of reading files one at a time ``` The same mutable package invocation also appears in the installer and logout instructions: ```markdown Running `npx @pharaoh-so/mcp --install-skills` performs these actions: ``` ```markdown npx @pharaoh-so/mcp --logout ``` ### Technical Analysis The documented `npx @pharaoh-so/mcp` commands do not specify an exact package version or an integrity digest. Consequently, `npx` can resolve, download, and execute whichever package release is current when the user runs the command. The executable payload can therefore change after this Skill has been reviewed. The package is documented as modifying `~/.openclaw/skills/` and `~/.openclaw/openclaw.json`. During normal operation, it also handles OAuth credentials stored under `~/.pharaoh/credentials.json` and proxies repository-related MCP messages. Although the documentation links to a public source repository, that link alone does not establish that a subsequently resolved npm artifact is identical to reviewed source. This is a supply-chain risk rather than evidence that the current package is malicious. Exploitation would require compromise of the npm publisher, package distribution channel, or a future malicious release. ### Attack Pat ...[truncated 1578 chars]
Remediation
## Remediation Suggestions 1. Pin every documented invocation to a reviewed exact version, for example: ```bash npx --yes @pharaoh-so/mcp@0.3.5 --install-skills ``` Version pinning reduces unexpected updates but does not by itself protect against replacement of an existing registry artifact. 2. Publish and verify package provenance, registry signatures, or cryptographic integrity hashes. Document how users can validate that the npm artifact corresponds to the reviewed source and release commit. 3. Prefer installation through a lockfile-controlled workflow using `npm ci`, with a committed integrity-bearing lockfile, rather than dynamically executing the latest registry release. 4. Separate installation, authentication, and logout operations where practical. A logout operation should not require downloading and executing a mutable remote package merely to delete local credentials. 5. Run installation with the minimum necessary privileges. Do not use `sudo`, and restrict package access to only the required OpenClaw and Pharaoh configuration paths. 6. Review and pin the 23 Skill files installed by the external package. Their contents were not included in this artifact and therefore were outside the scope of this audit. 7. Document a trusted release-verification procedure, including the expected package version, source commit, package digest, and provenance attestation.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Credential Access

High
Category
Privilege Escalation
Content
description: "Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so."
version: 0.3.5
homepage: https://pharaoh.so
metadata: {"emoji": "☥", "openclaw": {"requires": {"bins": ["npx", "node"], "env": [], "config": "~/.pharaoh/credentials.json"}, "permissions": {"network": ["mcp.pharaoh.so", "github.com"], "filesystem": ["~/.pharaoh/", "~/.openclaw/"]}, "always": false}, "tags": ["code-intelligence", "architecture", "mcp", "knowledge-graph", "dependencies", "blast-radius", "dead-code", "code-review", "refactoring", "test-coverage", "codebase-understanding", "developer-tools", "ai-coding"]}
---

# Pharaoh — Codebase Knowledge Graph + Developer Skill Library
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
description: "Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so."
version: 0.3.5
homepage: https://pharaoh.so
metadata: {"emoji": "☥", "openclaw": {"requires": {"bins": ["npx", "node"], "env": [], "config": "~/.pharaoh/credentials.json"}, "permissions": {"network": ["mcp.pharaoh.so", "github.com"], "filesystem": ["~/.pharaoh/", "~/.openclaw/"]}, "always": false}, "tags": ["code-intelligence", "architecture", "mcp", "knowledge-graph", "dependencies", "blast-radius", "dead-code", "code-review", "refactoring", "test-coverage", "codebase-understanding", "developer-tools", "ai-coding"]}
---

# Pharaoh — Codebase Knowledge Graph + Developer Skill Library
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
description: "Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so."
version: 0.3.5
homepage: https://pharaoh.so
metadata: {"emoji": "☥", "openclaw": {"requires": {"bins": ["npx", "node"], "env": [], "config": "~/.pharaoh/credentials.json"}, "permissions": {"network": ["mcp.pharaoh.so", "github.com"], "filesystem": ["~/.pharaoh/", "~/.openclaw/"]}, "always": false}, "tags": ["code-intelligence", "architecture", "mcp", "knowledge-graph", "dependencies", "blast-radius", "dead-code", "code-review", "refactoring", "test-coverage", "codebase-understanding", "developer-tools", "ai-coding"]}
---

# Pharaoh — Codebase Knowledge Graph + Developer Skill Library
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
description: "Codebase knowledge graph with 23 development workflow skills. Query architecture, dependencies, blast radius, dead code, and test coverage via MCP. Requires GitHub App installation (read-only repo access) and OAuth authentication. Connects to external MCP server at mcp.pharaoh.so."
version: 0.3.5
homepage: https://pharaoh.so
metadata: {"emoji": "☥", "openclaw": {"requires": {"bins": ["npx", "node"], "env": [], "config": "~/.pharaoh/credentials.json"}, "permissions": {"network": ["mcp.pharaoh.so", "github.com"], "filesystem": ["~/.pharaoh/", "~/.openclaw/"]}, "always": false}, "tags": ["code-intelligence", "architecture", "mcp", "knowledge-graph", "dependencies", "blast-radius", "dead-code", "code-review", "refactoring", "test-coverage", "codebase-understanding", "developer-tools", "ai-coding"]}
---

# Pharaoh — Codebase Knowledge Graph + Developer Skill Library
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
**No write access.** The GitHub App cannot modify code, create branches, open PRs, or change settings.

**Credential storage:** `~/.pharaoh/credentials.json` — OAuth access token + refresh token. Tokens expire after 7 days with automatic refresh. Clear with `npx @pharaoh-so/mcp --logout`.

## Data & Privacy
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
# Remove skills (installed by --install-skills)
rm -rf ~/.openclaw/skills/pharaoh*
# Remove MCP server entry from ~/.openclaw/openclaw.json (delete the "pharaoh" key under mcpServers)

# If using Claude Code directly (without OpenClaw):
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
# Remove skills (installed by --install-skills)
rm -rf ~/.openclaw/skills/pharaoh*
# Remove MCP server entry from ~/.openclaw/openclaw.json (delete the "pharaoh" key under mcpServers)

# If using Claude Code directly (without OpenClaw):
Confidence
90% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# Remove stored credentials
npx @pharaoh-so/mcp --logout
# or: rm ~/.pharaoh/credentials.json
```

## Links
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
The skill repeatedly instructs users to run `npx @pharaoh-so/mcp` without pinning an exact package version. Because `npx` resolves and executes the current published package, a compromised publisher account, typosquat, or malicious package update could cause arbitrary code execution on the user's machine at install or runtime.

Session Persistence

Medium
Category
Rogue Agent
Content
1. **Downloads** the `@pharaoh-so/mcp` npm package ([source](https://github.com/Pharaoh-so/pharaoh-mcp), [npm](https://www.npmjs.com/package/@pharaoh-so/mcp))
2. **Copies 23 skill directories** (SKILL.md markdown files) into `~/.openclaw/skills/` — **warning: overwrites existing pharaoh skill files on reinstall** (uses `cpSync` with `force: true`; does not touch non-pharaoh skills)
3. **Adds an MCP server entry** `"pharaoh"` to `~/.openclaw/openclaw.json` under `mcpServers` (skips if already present, refuses to write if JSON is corrupted)
4. If OpenClaw is not detected (`~/.openclaw/` doesn't exist), prints manual installation instructions and exits — **does not create directories or modify config**

Authentication happens separately when the MCP server first runs (not during `--install-skills`):
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
Using `npx @pharaoh-so/mcp --logout` without a pinned version still fetches and runs whatever version npm currently serves. Even though this is presented as a logout command, it creates the same supply-chain execution risk as the install command.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
The setup instructions again direct execution of an unpinned npm package through `npx`. In a skill whose primary action is to install tooling and connect to a remote MCP service, this materially increases the attack surface for supply-chain compromise.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding
The uninstall/logout example uses the same unpinned transient package execution model. Any command that causes users or agents to execute a remote package by name alone can be hijacked by a malicious update and should be treated as a real supply-chain risk.

Static analysis

No suspicious patterns detected.