Back to skill

Security audit

pctx — MCP Aggregation & Code Mode

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent MCP aggregation purpose, but it installs and starts high-impact local tooling with persistent access to GitHub/Linear-style credentials and includes unsafe helper-script behavior that deserves review before use.

Review before installing. Only run this if you trust the pctx, Homebrew, npm, GitHub MCP, and Linear MCP supply chain, and if you are comfortable with a persistent localhost service that can use configured API tokens. Inspect or recreate the LaunchAgent yourself before starting it, avoid passing untrusted names into the test command, and back up pctx config before using rollback or MCP mutation commands.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
pctx-skill.sh:213
Finding

Arbitrary Local Code Execution Through Unsafe CLI Argument Interpolation

Content
View full analysis
/dev/null | grep "^data:" | head -1 | sed 's/^data: //') echo "📚 Available functions in $ns:" echo "$list_resp" | python3 -c " import sys, json, re ns = '$ns' d = json.load(sys.stdin) text = d.get('result',{}).get('content',[{}])[0].get('text','') pattern = f'namespace {ns}' idx = text.find(pattern) ... " 2>/dev/null return fi local code="async function run() { const result = await ${ns}.${fn}({}); return JSON.stringify(result, null, 2); }" local call_payload call_payload=$(python3 -c " import json print(json.dumps({'jsonrpc':'2.0','id':2,'method':'tools/call','params':{ 'name':'execute_typescript', 'arguments':{'code':'$code'} }})) " 2>/dev/null) ``` ### Technical Analysis The `test` command accepts `server` and `fn` as command-line arguments. Values other than the two recognized server names are assigned directly to `ns` without validation: ```bash *) ns="$server" ;; ``` The resulting value is embedded inside Python source supplied to `python3 -c`: ```python ns = '$ns' ``` Both `ns` and `fn` are also included in `code`, which is subsequently embedded inside another single-quoted Python string: ```python 'arguments':{'code':'$code'} ``` Shell quoting does not make these generated Python strings ...[truncated 1898 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
install.sh:17
Finding

Unpinned Third-Party Packages Are Installed and Executed

Content
View full analysis
/dev/null; then ok "pctx already installed: $(pctx --version 2>/dev/null)" else info "Installing pctx via brew..." brew install portofcontext/tap/pctx ok "pctx installed" fi ``` ```bash # 4. @tacticlaunch/mcp-linear if command -v mcp-linear &>/dev/null; then ok "mcp-linear already installed" else info "Installing @tacticlaunch/mcp-linear..." npm install -g @tacticlaunch/mcp-linear ok "mcp-linear installed" fi ``` Equivalent unpinned installation behavior appears in `pctx-skill.sh`: ```bash if ! command -v pctx &>/dev/null; then info "Installing pctx..." brew install portofcontext/tap/pctx else ok "pctx $(pctx --version 2>/dev/null)" fi ``` ```bash if ! command -v mcp-linear &>/dev/null; then info "Installing @tacticlaunch/mcp-linear..." npm install -g @tacticlaunch/mcp-linear else ok "mcp-linear installed" fi ``` ### Technical Analysis The project installs the current versions of packages from a custom Homebrew tap and the public npm registry without pinning reviewed versions or verifying immutable artifact checksums. In particular, `npm install -g` may execute package lifecycle scripts and installs the package globally into the user's npm environment. The effective code installed later can therefore differ from the code present when this Skill was audited. The custom Homebrew tap also adds reliance on an external publisher-controlled formula. If the formula, release asset, package account, registry entry, or associated source repository is compromised, a subsequent installation can execute altered code. There is no evidence in the reviewed project that these packages are currently malicious. The issue is that insta ...[truncated 1425 chars]
Remediation
View remediation
``` Only remove `--ignore-scripts` if a reviewed lifecycle script is strictly required. 3. Verify downloaded artifacts against documented SHA-256 checksums or trusted signatures before execution. 4. Prefer project-local dependency installation over global npm installation to reduce modification of shared user tooling. 5. Pin and audit Homebrew formula revisions or fetch signed release artifacts directly from an immutable release URL with checksum validation. 6. Record dependency names, versions, hashes, publishers, and source repositories in the project. 7. Use automated dependency monitoring, but require review before updating pinned versions. 8. Clearly prompt the user before installing executable third-party software and describe which external repositories will be trusted. ]]>

T06 · System Persistence

Note
Location
install.sh:68
Finding

Unvalidated Pre-Existing LaunchAgent Is Automatically Loaded

Content
View full analysis
/dev/null | grep -q "ai.openclaw.pctx"; then ok "pctx daemon already running" else if [[ -f "$PCTX_PLIST" ]]; then info "Loading pctx daemon..." launchctl load "$PCTX_PLIST" sleep 2 ``` From `pctx-skill.sh`: ```bash cmd_start() { require_pctx if daemon_running; then ok "pctx already running on http://${PCTX_HOST}:${PCTX_PORT}/mcp" return 0 fi [[ ! -f "$PCTX_PLIST" ]] && die "launchd plist not found at $PCTX_PLIST. Was MJM-210 setup completed?" info "Starting pctx daemon..." launchctl load "$PCTX_PLIST" 2>&1 || true ``` ### Technical Analysis The Skill loads a LaunchAgent from: ```text ~/Library/LaunchAgents/ai.openclaw.pctx.plist ``` A persistent user-level daemon is related to the declared functionality because the Skill advertises a continuously available local MCP endpoint. The persistence mechanism therefore does not, by itself, demonstrate a concealed backdoor or unnecessary privilege escalation. However, the reviewed package does not include or generate the plist. It assumes the file was created during a separate setup step and loads it based only on file existence. It does not validate: - File ownership or permissions. - Whether the file is a symbolic link. - The configured executable and arguments. - Environment variables embedded in the plist. - Whether the executable is the expected pctx binary. - Whether the daemon bin ...[truncated 1632 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (40)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The combined rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist command performs multiple destructive actions in one line, increasing the risk of accidental execution and making review harder for users or agents. Because the skill lacks strict tool-scope declarations and is intended for shell-capable automation, this context makes such commands more dangerous than in passive documentation.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

{baseDir}/pctx-skill.sh stop brew uninstall pctx github-mcp-server npm uninstall -g @tacticlaunch/mcp-linear rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist

text

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The combined rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist command performs multiple destructive actions in one line, increasing the risk of accidental execution and making review harder for users or agents. Because the skill lacks strict tool-scope declarations and is intended for shell-capable automation, this context makes such commands more dangerous than in passive documentation.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

{baseDir}/pctx-skill.sh stop brew uninstall pctx github-mcp-server npm uninstall -g @tacticlaunch/mcp-linear rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist

text

---

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

The combined rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist command performs multiple destructive actions in one line, increasing the risk of accidental execution and making review harder for users or agents. Because the skill lacks strict tool-scope declarations and is intended for shell-capable automation, this context makes such commands more dangerous than in passive documentation.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

{baseDir}/pctx-skill.sh stop brew uninstall pctx github-mcp-server npm uninstall -g @tacticlaunch/mcp-linear rm -rf ~/.config/pctx/ ~/Library/LaunchAgents/ai.openclaw.pctx.plist

text

---

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill exposes shell-capable workflows (install.sh, pctx-skill.sh, package manager commands, curl, rm -rf) but does not declare an explicit tool scope or allowed-tools boundary. That increases the chance an agent will execute powerful local commands without policy gating, especially because this skill is specifically designed to bridge to many external MCP tools and local code execution.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

The skill establishes a persistent local endpoint and long-lived daemon that aggregates access to GitHub, Linear, and code execution behind a single interface. Persistent agent-accessible infrastructure broadens the attack surface: if another process, agent, or prompt can reach the endpoint, it may reuse existing authenticated sessions or trigger sensitive actions through the aggregated tools.

Content

Scanner excerpt · SKILL.md (reported line 14)May include surrounding context.

md
pctx is a local server that:
1. **Aggregates MCP servers** — connects to Linear, GitHub, and other MCP backends behind one endpoint
2. **Code Mode** — instead of sequential tool calls, agents write TypeScript that runs in a Deno sandbox; only the result comes back (up to 98% token reduction on complex workflows)

**Live endpoint:** `http://127.0.0.1:8080/mcp`
**Connected MCPs:** Linear (42 tools), GitHub (41 tools)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 119)May include surrounding context.

The pctx server exposes an MCP endpoint at http://127.0.0.1:8080/mcp. Agents can call tools directly via JSON-RPC, or use Code Mode for batched TypeScript execution.

Simple tool call via curl

bash
# Initialize + get session context

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The rollback section includes uninstall and deletion commands, including removal of configuration directories and launch agent files, without an explicit warning that they are destructive. In an agent skill context, terse destructive examples can be copied and executed automatically or with insufficient user confirmation, leading to loss of configuration, credentials, or service availability.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 209)May include surrounding context.

md
info "Initialising pctx config..."
  mkdir -p "$HOME/.config/pctx"
  pctx mcp init -y -c "$PCTX_CONFIG"
  chmod 600 "$PCTX_CONFIG"
  ok "pctx config created"
  echo ""
  echo "⚠️  MCP servers not configured. Add them manually:"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · install.sh (reported line 59)May include surrounding context.

sh
info "Initialising pctx config..."
  mkdir -p "$HOME/.config/pctx"
  pctx mcp init -y -c "$PCTX_CONFIG"
  chmod 600 "$PCTX_CONFIG"
  ok "pctx config created"
  echo ""
  echo "⚠️  MCP servers not configured. Add them manually:"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · pctx-skill.sh (reported line 158)May include surrounding context.

sh
info "Initialising pctx config..."
  mkdir -p "$HOME/.config/pctx"
  pctx mcp init -y -c "$PCTX_CONFIG"
  chmod 600 "$PCTX_CONFIG"
  ok "pctx config created"
  echo ""
  echo "⚠️  MCP servers not configured. Add them manually:"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · pctx-skill.sh (reported line 185)May include surrounding context.

sh
info "Initialising pctx config..."
  mkdir -p "$HOME/.config/pctx"
  pctx mcp init -y -c "$PCTX_CONFIG"
  chmod 600 "$PCTX_CONFIG"
  ok "pctx config created"
  echo ""
  echo "⚠️  MCP servers not configured. Add them manually:"

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

launchctl load "$PCTX_PLIST" starts a per-user LaunchAgent, creating session persistence for a local daemon. In this skill context, persistence is expected for an MCP aggregation service, but it still increases attack surface because a compromised or misconfigured daemon would auto-run in the user's session and expose a local endpoint on 127.0.0.1:8080.

Content

Scanner excerpt · install.sh (reported line 82)May include surrounding context.

sh
else
  if [[ -f "$PCTX_PLIST" ]]; then
    info "Loading pctx daemon..."
    launchctl load "$PCTX_PLIST"
    sleep 2
    if curl -sf --max-time 3 http://127.0.0.1:8080/mcp -o /dev/null 2>/dev/null; then
      ok "pctx daemon started on http://127.0.0.1:8080/mcp"

Session Persistence

Medium
Category
Rogue Agent
Confidence
78% confidence
Finding

launchctl load "$PCTX_PLIST" starts a per-user LaunchAgent, creating session persistence for a local daemon. In this skill context, persistence is expected for an MCP aggregation service, but it still increases attack surface because a compromised or misconfigured daemon would auto-run in the user's session and expose a local endpoint on 127.0.0.1:8080.

Content

Scanner excerpt · install.sh (reported line 82)May include surrounding context.

sh
else
  if [[ -f "$PCTX_PLIST" ]]; then
    info "Loading pctx daemon..."
    launchctl load "$PCTX_PLIST"
    sleep 2
    if curl -sf --max-time 3 http://127.0.0.1:8080/mcp -o /dev/null 2>/dev/null; then
      ok "pctx daemon started on http://127.0.0.1:8080/mcp"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · SKILL.md (reported line 191)May include surrounding context.

md
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 7)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 69)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 71)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 72)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 73)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · pctx-skill.sh (reported line 7)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · pctx-skill.sh (reported line 88)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 7)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 68)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% 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.

Content

Scanner excerpt · install.sh (reported line 69)May include surrounding context.

sh
set -euo pipefail

PCTX_CONFIG="${PCTX_CONFIG:-$HOME/.config/pctx/pctx.json}"
PCTX_PLIST="$HOME/Library/LaunchAgents/ai.openclaw.pctx.plist"
PCTX_PORT="${PCTX_PORT:-8080}"
PCTX_HOST="${PCTX_HOST:-127.0.0.1}"
PCTX_BIN="${PCTX_BIN:-$(which pctx 2>/dev/null || echo '')}"