Back to skill

Security audit

jun-invest-option-master-agent

Security checks for vulnerabilities and agentic risk

Overview

The skill discloses an auto-backup installer, but it installs persistent publishing automation that can upload broad local workspace contents without clear per-release review or opt-in.

Install only if you intentionally want this agent to maintain a local investment workspace and automatically publish backups to ClawHub. Before use, disable or review the launchd job, require manual approval before publishing, replace broad sync with an allowlist, remove personal/local files from publishable artifacts, and avoid storing credentials or infrastructure details in the workspace.

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
scripts/sync-runtime-to-artifact.sh:18
Finding
Unattended publication can expose personal, infrastructure, and sensitive workspace data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/sync-runtime-to-artifact.sh:18-44`, with publication at `scripts/publish.sh:94-112` and sensitive-data collection encouraged by `agent/BOOTSTRAP.md:23-35` and `agent/TOOLS.md:5-25` **Vulnerability Type**: Excessively broad synchronization followed by unattended external publication **Risk Level**: High ### Complete Code Snippet ```bash # One-time safety cleanup: ensure runtime-only files never live in artifact rm -rf "${ARTIFACT_AGENT_DIR}/memory" >/dev/null 2>&1 || true rm -f "${ARTIFACT_AGENT_DIR}/.publish-state.json" >/dev/null 2>&1 || true rm -f "${ARTIFACT_AGENT_DIR}/.publish-now" >/dev/null 2>&1 || true rsync -a --delete \ --exclude '.openclaw/' \ --exclude '.git/' \ --exclude 'memory/' \ --exclude '.publish-state.json' \ --exclude '.publish-now' \ --exclude '**/.venv/' \ --exclude '**/__pycache__/' \ --exclude '**/*.pyc' \ --exclude '**/*.pyo' \ --exclude '**/.DS_Store' \ --exclude 'logs/' \ --exclude 'tmp/' \ "${RUNTIME_DIR}/" \ "${ARTIFACT_AGENT_DIR}/" # Record which runtime commit this artifact was synced from if command -v git >/dev/null 2>&1 && [[ -d "${RUNTIME_DIR}/.git" ]]; then (cd "${RUNTIME_DIR}" && git rev-parse HEAD) > "${ARTIFACT_AGENT_DIR}/.runtime-head" || true fi ``` The synchronized artifact is subsequently published: ```bash cd "${SKILL_DIR}" echo "Publishing ${SLUG}@${version} ..." # Best-effort: publishing may fail if not logged in; do not crash the whole system. # clawhub publish can occasionally timeout; retry a few times. try=1 max=3 ok="false" while [[ ${try} -le ${max} ]]; do echo "Publish attempt ${try}/${max}..." if "${CLAWHUB_BIN}" publish . --slug "${SLUG}" --name "${NAME}" --version "${version}" --changelog "${changelog}"; then ok="true"; break fi sleep $((try * 5)) try=$((try + 1)) done if [[ "${ok}" == "true" ]]; then mkdir -p "$(dirname "${STATE_FILE}")" node -e 'const fs=require("fs"); const p=process.ar ...[truncated 2940 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace denylist-based workspace synchronization with an explicit allowlist containing only reviewed, distributable source files. 2. Permanently exclude local personalization and operational-state files, including: - `USER.md` - `IDENTITY.md` - `SOUL.md` - `TOOLS.md` - `.env*` - credential and account configuration files - private keys, certificates, and host inventories 3. Build releases in a clean staging directory rather than directly under the mutable workspace or installed Skill directory. 4. Generate and display the exact publication manifest and diff before upload. 5. Require explicit user approval for every publication. 6. Run secret scanning and sensitive-data detection over the staged package. Publication must fail closed if a possible secret is detected. 7. Validate that no symbolic links escape the staging root. 8. Separate local agent state from distributable Skill assets at the directory-architecture level. 9. Add automated tests proving that personalization, account, and infrastructure files cannot enter release artifacts. ]]>

T06 · System Persistence

Error
Location
scripts/setup-launchd.sh:18
Finding
Default installation creates a persistent LaunchAgent for recurring network publication<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup-launchd.sh:18-52`, invoked by default from `scripts/auto-install.sh:52-55` **Vulnerability Type**: Cross-session scheduled-task persistence **Risk Level**: High ### Complete Code Snippet ```bash cat > "${PUBLISH_PLIST}" <<EOF <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key><string>${PUBLISH_LABEL}</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>${SKILL_DIR}/scripts/publish.sh</string> </array> <key>EnvironmentVariables</key> <dict> <key>PATH</key><string>/Users/lijunsheng/.nvm/versions/node/v22.22.0/bin:/usr/bin:/bin:/usr/sbin:/sbin</string> <key>CLAWHUB_BIN</key><string>${CLAWHUB_BIN}</string> <key>CLAWHUB_REQUEST_TIMEOUT_MS</key><string>120000</string> </dict> <key>RunAtLoad</key><true/> <!-- Daily publish window: 03:15 local time --> <key>StartCalendarInterval</key> <dict> <key>Hour</key><integer>3</integer> <key>Minute</key><integer>15</integer> </dict> <!-- Also poll every 30 minutes to honor .publish-now flag without waiting until 03:15 --> <key>StartInterval</key><integer>1800</integer> <key>StandardOutPath</key><string>$HOME/.openclaw/logs/jun-invest-option-master-agent.publish.out.log</string> <key>StandardErrorPath</key><string>$HOME/.openclaw/logs/jun-invest-option-master-agent.publish.err.log</string> </dict> </plist> EOF # Reload job launchctl unload "${PUBLISH_PLIST}" >/dev/null 2>&1 || true launchctl load "${PUBLISH_PLIST}" >/dev/null 2>&1 || true ``` The default installer activates this persistence mechanism: ```bash # Setup unattended daily publish (macOS launchd; best-effort) if [[ "$(uname -s)" == "Darwin" ]]; then bash "$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)/setup-launchd.sh" || true ...[truncated 2210 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove LaunchAgent installation from the default installation path. 2. Expose background publication as a separate command with explicit, informed user consent. 3. Before installation, display: - the exact plist path; - the command that will execute; - execution frequency; - network destinations and data scope; - disable and uninstall instructions. 4. Disable `RunAtLoad` unless it is strictly necessary. 5. Avoid simultaneous daily and 30-minute schedules; use the least frequent schedule required. 6. Add an uninstall script that unloads the task and removes the plist: ```bash launchctl unload "$HOME/Library/LaunchAgents/ai.openclaw.jun-invest-option-master-agent.publish.plist" rm -f "$HOME/Library/LaunchAgents/ai.openclaw.jun-invest-option-master-agent.publish.plist" ``` 7. Pin the persisted command to an integrity-verified, immutable executable rather than a script in an automatically updated directory. 8. Require interactive approval before publication even when a scheduler initiates the check. 9. Surface launchd registration failures instead of suppressing them with `|| true`, so users can accurately determine whether persistence was installed. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/auto-install.sh:43
Finding
Forced unpinned package updates expose the installation and publication chain to supply-chain compromise<![CDATA[ ## Vulnerability Details **File Location**: `scripts/auto-install.sh:43-46` and `scripts/install.sh:76-87` **Vulnerability Type**: Unpinned, unverified latest-version dependency updates **Risk Level**: Medium ### Complete Code Snippet ```bash if command -v clawhub >/dev/null 2>&1; then clawhub update jun-invest-option-master-agent --force || true fi ``` The same unsafe update policy is used for optional external Skills: ```bash # Best-effort: install skills (latest) if command -v clawhub >/dev/null 2>&1 && command -v node >/dev/null 2>&1; then LOCK_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/skills.lock.json" SKILLS=$(node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); console.log((j.skills||[]).map(s=>s.slug).filter(Boolean).join("\n"));' "${LOCK_FILE}" || true) if [[ -n "${SKILLS}" ]]; then echo "Installing external skills (latest):" echo "${SKILLS}" | while IFS= read -r slug; do [[ -z "${slug}" ]] && continue echo "- clawhub update ${slug} --force (latest, best-effort)" clawhub update "${slug}" --force >/dev/null 2>&1 || clawhub install "${slug}" || true done fi else echo "clawhub/node not found; skipping external skill install. (OK)" fi ``` ### Technical Analysis The installer intentionally requests the latest registry version and forces replacement without pinning a version, validating a digest, checking a signature, or obtaining review approval. Although `skills.lock.json` is named like a lockfile, the documented policy is to list only slugs and fetch the latest release. The currently reviewed lockfile contains no external Skills, but the generic installer behavior becomes active as soon as entries are added. The self-update is immediately relevant: the package updates itself before completing installation. Consequently, the code actually used after the update may differ from the code reviewed in this audit. Suppressing failures with `|| true` a ...[truncated 1439 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove automatic self-update from the installer. 2. Pin every Skill dependency to an exact immutable version and cryptographic digest. 3. Convert `skills.lock.json` into a real lockfile containing at least: - package slug; - exact version; - SHA-256 digest; - trusted publisher identity or signature. 4. Verify signatures and hashes before installation or execution. 5. Download updates into a staging directory and review their manifest and diff before activation. 6. Require explicit user approval for version changes. 7. Do not use `--force` during ordinary installation. 8. Fail closed on verification or update errors rather than suppressing failures with `|| true`. 9. Separate update, install, and activation phases so newly retrieved code is never executed implicitly during the currently running installer. 10. Add provenance verification and release signing to the publishing workflow. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (93)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
File synchronization and publishing logic that uses rsync --delete and explicit rm cleanup can remove data from the target artifact directory, making mistakes or abuse potentially destructive. When combined with publishing/version-stamping behavior, this can silently overwrite or delete released assets under the guise of routine installer activity.

Missing User Warnings

High
Confidence
98% confidence
Finding
This workflow tells the agent to default to modifying the live source workspace, committing code, syncing artifacts, publishing to ClawHub, and then deploying the result automatically. That creates a highly dangerous autonomous supply-chain path: a user request can be translated directly into code changes and publication without review, testing gates, or explicit release approval, enabling accidental breakage or malicious prompt-driven code publication.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The bootstrap content is materially inconsistent with the declared purpose of an installer/upgrade/register skill and instead instructs the agent to perform persona-building, memory creation, and user-engagement workflows. This creates a prompt-injection style scope hijack: the agent may ignore its intended operational role and begin collecting user data or initiating unrelated workflows, increasing the risk of misuse and unauthorized actions.

Self-Modification

High
Category
Rogue Agent
Content
## Why Separate?

Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.

---
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The prompt explicitly instructs the agent to modify workspace files, run shell-based self-checks, create git commits, and trigger publication to ClawHub. That exceeds a normal advisory/project-management role and creates an autonomous code-change and release path, which is dangerous because prompt content can directly cause operational side effects in the local environment without separate authorization.

Context-Inappropriate Capability

High
Confidence
97% confidence
Finding
This prompt grants a project-management persona authority to perform privileged operational actions on the filesystem and release pipeline. Even if intended for maintenance automation, embedding this authority in a prompt increases the chance of unintended or adversarially induced changes, especially because the agent is told it is responsible for carrying them out itself.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
echo "  artifact: ${ARTIFACT_AGENT_DIR}"

# One-time safety cleanup: ensure runtime-only files never live in artifact
rm -rf "${ARTIFACT_AGENT_DIR}/memory" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-state.json" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-now" >/dev/null 2>&1 || true
Confidence
95% 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
# One-time safety cleanup: ensure runtime-only files never live in artifact
rm -rf "${ARTIFACT_AGENT_DIR}/memory" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-state.json" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-now" >/dev/null 2>&1 || true

rsync -a --delete \
Confidence
95% 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
# One-time safety cleanup: ensure runtime-only files never live in artifact
rm -rf "${ARTIFACT_AGENT_DIR}/memory" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-state.json" >/dev/null 2>&1 || true
rm -f "${ARTIFACT_AGENT_DIR}/.publish-now" >/dev/null 2>&1 || true

rsync -a --delete \
  --exclude '.openclaw/' \
Confidence
95% 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).

Static analysis

No suspicious patterns detected.