Back to skill

Security audit

Promptbuddy Lite

Security checks for vulnerabilities and agentic risk

Overview

This prompt-optimization skill is not clearly malicious, but it needs review because it rewrites chat input automatically, requires root-level installation, and can run feedback code from another local skill without verification.

Review this before installing. It may automatically rewrite your chat prompts and consume a later '1' or '2' reply as feedback. Its installer asks for sudo and installs global commands, and its feedback path can run code from another local skill directory if present. Prefer a user-scoped install, explicit opt-in for rewriting, safer per-session state, and a bundled or verified feedback collector.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (5)

other

Warning
Location
scripts/preprocess.sh:36
Finding

Automatic Message Rewriting and Generic Reply Interception

Content
View full analysis
/dev/null fi # Remove metadata file rm -f "$METADATA_FILE" # Print acknowledgement instead of forwarding the message echo "感谢反馈!我们会持续优化体验。" exit 0 fi fi ``` ```bash if [ "$FIRST_LINE" = "OPT:YES" ]; then # Extract optimized prompt OPT_PROMPT=$(echo "$PARSED" | tail -n +2) # Save metadata for subsequent feedback METADATA=$(echo "$RESULT" | python3 -c " import sys, json try: d = json.load(sys.stdin) print(json.dumps({ 'intent': d.get('intent', 'unknown'), 'variant': d.get('variant', 0), 'role': d.get('role', ''), 'industry': d.get('industry', ''), 'domain': d.get('domain', '') })) except: print('{}') " 2>/dev/null) echo "$METADATA" > /tmp/pb_last_metadata.json # Determine whether to display the prompt structure if [ "$SHOW_PROMPT" = "show" ]; then cat <
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/preprocess.sh:45
Finding

Execution of an Unverified Script from a Separate Mutable Skill Directory

Content
View full analysis
/dev/null fi ``` From `scripts/feedback.sh`: ```bash # Record feedback record_feedback() { local metadata="$1" local feedback="$2" # helpful / needs_improve python3 "$OPTIMIZER_PATH/scripts/collect_feedback_safe.py" \ --metadata "$metadata" \ --feedback "$feedback" 2>/dev/null } ``` The external path is defined as: ```bash OPTIMIZER_PATH="$HOME/.openclaw/workspace/skills/promptbuddy-optimizer" ``` ### Technical Analysis The project directly executes `collect_feedback_safe.py` from another Skill directory. That Python file is not included in this artifact, so its implementation and security properties cannot be established by auditing this package. The code verifies only that the parent directory exists in `preprocess.sh`; `feedback.sh` does not perform even that check. Neither script verifies: - File ownership - File permissions - Symbolic-link status - Expected version - Cryptographic digest - Package provenance - Whether the target is a regular file The name `collect_feedback_safe.py` does not provide a security guarantee. Because Python executes top-level code immediately, replacement of this file is sufficient for arbitrary code execution under the account invoking PromptBuddy. ### Attack Path 1. An attacker gains write access to the user's `promptbuddy-optimizer` directory, replaces the directory through a symbolic link, or causes an untrusted version of that Skill to be installed. 2. The attacker ...[truncated 889 chars]
Remediation
View remediation
/dev/null`. 8. Declare Python and the optimizer integration as dependencies in project metadata and documentation. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/preprocess.sh:36
Finding

Predictable Shared Temporary File Enables Symlink and Race Attacks

Content
View full analysis
/dev/null fi # Remove metadata file rm -f "$METADATA_FILE" ``` ```bash # Save metadata to a temporary file for subsequent feedback METADATA=$(echo "$RESULT" | python3 -c " import sys, json try: d = json.load(sys.stdin) print(json.dumps({ 'intent': d.get('intent', 'unknown'), 'variant': d.get('variant', 0), 'role': d.get('role', ''), 'industry': d.get('industry', ''), 'domain': d.get('domain', '') })) except: print('{}') " 2>/dev/null) echo "$METADATA" > /tmp/pb_last_metadata.json ``` ### Technical Analysis The script stores state at a constant path in the globally shared `/tmp` directory. The file is created through shell redirection without exclusive creation, ownership verification, restrictive permissions, or symbolic-link protection. The `[ -f "$METADATA_FILE" ]` check is also subject to a time-of-check/time-of-use race. A local attacker can replace the file between the check and `cat`, or between other operations. Two primary exploitation modes are possible: - **Symlink overwrite:** Pre-create `/tmp ...[truncated 1789 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/promptbuddy.sh:321
Finding

Unescaped User Input Produces Malformed or Injectable JSON Output

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/install.sh:13
Finding

Prompt Utility Requires Unnecessary Root-Level System-Wide Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
91% confidence
Finding

The script intentionally supports a 'show prompt' mode and defaults to displaying the optimized prompt structure back to the user. In an agent/skill context, exposing internal optimized prompts can leak hidden system instructions, prompt-engineering logic, or other sensitive orchestration details that make prompt injection, policy evasion, or model manipulation easier.

Content

Scanner excerpt · scripts/preprocess.sh (reported line 24)May include surrounding context.

sh
# 处理指令
case "$USER_LOWER" in
    "/prompt"|"/prompt show"|"/prompt on"|"show prompt"|"开启 prompt"|"展示 prompt")
        echo "show" > "$PREF_FILE"
        echo "✅ 已开启 Prompt 结构展示"
        exit 0

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrases listed for intent recognition are very broad and overlap with normal user requests such as 'how', 'why', 'write one', and 'help me'. In a prompt-rewriting skill, this can cause unintended activation or misclassification of benign inputs, leading the agent to apply the wrong prompting strategy and potentially alter task scope or behavior without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language content in the skill file is presented only in Chinese, including headings, usage examples, and descriptive text. Under the policy rules, forcing a specific language without user opt-in or a documented justification can be a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description is written entirely in Chinese and provides no indication that other languages are supported. This can violate a language/locale policy when the skill effectively constrains users to a single language without documenting choice, opt-in, or region-specific justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script contains natural-language comments and output exclusively in Chinese, including the usage message shown to users. The policy scope covers all file types, and there is no indication that Chinese is optional or that the skill is intentionally limited to a Chinese-only region or audience.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script’s safety claim is not enforced at the trust boundary. While extract_metadata does sanitize a JSON result into selected fields, the record action accepts arbitrary caller-supplied metadata and forwards it directly to collect_feedback_safe.py, so raw user input or sensitive content could still be logged despite the comment stating otherwise.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's user-facing strings, including the install prompt, error message, and usage instructions, are entirely in Chinese. This imposes a specific language on all users without opt-in or documented locale justification, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/install.sh (reported line 13)May include surrounding context.

sh
echo "  PromptBuddy Lite v2.0.0 安装"
echo "=========================================="

[ "$EUID" -ne 0 ] && { echo "请使用: sudo $0"; exit 1; }

# 安装核心脚本
echo "[1/3] 安装核心脚本..."

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Comments and user-facing strings such as status messages and feedback prompts are presented only in Chinese, with no indication that the user can choose another language. This is a natural-language policy concern because it forces a locale choice rather than offering or documenting it.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The comment at L003 describes the script as an automatic preprocessing wrapper, but the implementation also performs command handling that toggles a saved preference file and submits user feedback to another skill path. This is more than incomplete documentation: the script is acting as a command-and-feedback controller, which diverges from the narrow preprocessing description in the header.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script writes preference state to $HOME/.openclaw/.pb_show_prompt and later writes and deletes /tmp/pb_last_metadata.json, but there is no prior disclosure in comments or user-facing output that local files will be created and removed as part of processing. Because these side effects affect user data/state outside simple stdout transformation, they should be disclosed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language templates and comments define the skill entirely in Chinese, and all role/task/output strings returned to the user are Chinese-language phrases. There is no indication that the user can choose another language or that the skill is intentionally limited to a Chinese-only locale, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language content and examples are written in Chinese, and the file does not indicate that language selection is optional or that the skill is intentionally restricted to a Chinese-speaking context. This can conflict with language/locale policy expectations when no user opt-in or justification is provided.

Content

No source excerpt is available for this finding.