Back to skill

Security audit

企业年金查询技能

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent pension-investigation purpose, but its scripts use unsafe file handling and run unverified external search scripts with inherited credentials, so users should review it before installing.

Install only if you are comfortable with company names and investigation queries being sent to external search tools. Do not run the batch script on company lists from untrusted sources, and avoid setting sensitive API keys until the external-script execution path is reviewed. The maintainer should fix filename sanitization, replace unsafe sed templating, verify or vendor search dependencies, and clearly document where reports and raw data are saved.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_report.sh:192
Finding

Command Injection Through User-Controlled GNU sed Program

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_report.sh:192
Vulnerability Type: Command injection through unsafe construction of a sed program
Risk Level: Critical

bash
# Replace placeholders
sed -i "s/\[COMPANY_NAME\]/$COMPANY_NAME/g" "$REPORT_FILE"

Technical Analysis

COMPANY_NAME originates from the first command-line argument and is inserted directly into a double-quoted GNU sed program. Shell quoting prevents a direct shell metacharacter injection at the initial expansion stage, but it does not make the resulting sed program safe.

An attacker can include sed delimiters, backslashes, ampersands, or literal newline characters in the company name. A newline can terminate the intended substitution and introduce additional sed commands. On GNU sed, the e command can execute a shell command. Consequently, crafted input can transform the generated sed expression into multiple sed instructions, one of which invokes a command.

The value is also not escaped for replacement-string semantics. Even inputs that do not achieve command execution can corrupt the generated report or cause report generation to fail.

Attack Path

  1. The attacker supplies a crafted company name directly to generate_report.sh or places it in a company list processed by batch_query.sh.
  2. The value is forwarded unchanged as COMPANY_NAME.
  3. generate_report.sh interpolates the value into the sed program at line 192.
  4. Embedded delimiter or newline content terminates the intended substitution expression.
  5. On GNU sed, an injected e instruction executes an attacker-selected shell command.
  6. The command runs with the user identity, filesystem access, environment variables, and network permissions of the Skill process.

Impact Assessment

Successful exploitation provides arbitrary command execution under the account running the Skill. The attacker could read or modify files available to that accou ...[truncated 384 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not interpolate untrusted data into a sed program.
  • Use a template renderer that accepts values as data rather than executable syntax.
  • A safe alternative is to perform replacement in a small Python program where the company name is passed as a normal argument or environment value.
  • If sed must be retained, reject carriage returns, newlines, and other control characters, and correctly escape backslashes, the selected delimiter, and ampersands before constructing the replacement.
  • Validate company names against a conservative length and character policy.
  • Run report generation with a minimal environment and without unnecessary credentials.
  • Add regression tests for names containing /, &, backslashes, newlines, sed syntax, shell syntax, and Unicode control characters.

T09 · Insecure Skill Coding Practices

Error
Location
scripts/batch_query.sh:98
Finding

Path Traversal Through Unvalidated Company Names

Content
View full analysis

Vulnerability Details

File Location: scripts/batch_query.sh:98-103; related report path construction at scripts/generate_report.sh:42
Vulnerability Type: Path traversal and unintended file creation or truncation
Risk Level: High

bash
# Execute query
if bash "$SCRIPT_DIR/search.sh" "$company" deep > "$OUTPUT_DIR/${company}_search_log.txt" 2>&1; then
    log_success "✓ $company investigation completed"
    SUCCESS=$((SUCCESS + 1))

    # Generate report
    bash "$SCRIPT_DIR/generate_report.sh" "$company" "" "$OUTPUT_DIR" 2>/dev/null || true

The downstream report generator constructs another path from the same value:

bash
REPORT_FILE="$OUTPUT_DIR/${COMPANY_NAME}_年金调查报告_${TIMESTAMP}.md"

Technical Analysis

Company names read from the batch input file are used directly as filename components. The scripts do not reject /, .., control characters, or other path syntax, and they do not canonicalize the final path before opening it.

Shell quoting prevents word splitting and shell metacharacter execution, but it does not prevent filesystem path traversal. A value such as ../../outside/acme causes the normalized destination to escape the intended output directory. The shell redirection in batch_query.sh opens the destination before search.sh runs, so an existing suffix-compatible file can be truncated immediately.

The same untrusted value is passed to generate_report.sh, which creates a second attacker-influenced path. Symbolic links or attacker-controlled parent directories can further expand the overwrite risk.

Attack Path

  1. The attacker creates or modifies the company-list file consumed by batch_query.sh.
  2. A company entry contains one or more ../ path components.
  3. The script concatenates that entry with OUTPUT_DIR without validation.
  4. Filesystem path normalization resolves the destination outside the intended report directory.
  5. Shell ...[truncated 846 chars]
Remediation
View remediation

Remediation Suggestions

  • Never use the raw company name as a path component.
  • Convert it to a safe filename slug using a strict allowlist, such as letters, digits, spaces, underscores, and hyphens.
  • Explicitly reject /, backslashes, .., null bytes, newlines, and other control characters.
  • Generate internal filenames from a digest or opaque identifier and store the original company name only inside report content.
  • Canonicalize both the output directory and proposed destination, then verify that the destination remains beneath the canonical output directory.
  • Refuse to follow symbolic links when creating output files where platform support permits it.
  • Create files with restrictive permissions and use atomic creation to reduce race and symlink risks.
  • Apply the same centralized filename-validation function in both batch_query.sh and generate_report.sh.

T08 · Insecure Dependencies

Error
Location
scripts/search.sh:135
Finding

Execution of Mutable External Skill Scripts With Inherited API Credentials

Content
View full analysis

Vulnerability Details

File Location: scripts/search.sh:135-140; related external execution at scripts/search.sh:153-156
Vulnerability Type: Unverified external dependency execution and local tool hijacking
Risk Level: High

bash
local tavily_script="/home/admin/.openclaw/workspace/skills/tavily-search-skill/search.sh"

if [ -f "$tavily_script" ]; then
    chmod +x "$tavily_script" 2>/dev/null || true
    export TAVILY_API_KEY
    bash "$tavily_script" "$query" "$max_results" 2>/dev/null
else
    log_error "Tavily script does not exist: $tavily_script"
    return 1
fi

The SearXNG path is trusted in the same manner:

bash
local searxng_script="/home/admin/.openclaw/workspace/skills/searxng/scripts/searxng.py"

if [ -f "$searxng_script" ]; then
    python3 "$searxng_script" search "$query" 2>&1 | head -50
else
    log_error "SearXNG script does not exist: $searxng_script"
    return 1
fi

Technical Analysis

The Skill executes scripts outside its audited package based solely on their existence at fixed filesystem paths. It does not verify the external files' owner, permissions, canonical location, version, signature, or cryptographic digest.

This creates a local supply-chain boundary that is neither declared precisely nor protected. Any actor or compromised component able to replace one of these files can cause arbitrary code to run when the pension-search Skill is invoked.

The Tavily path is especially sensitive because TAVILY_API_KEY is explicitly exported before execution. The external script therefore inherits that credential together with the rest of the process environment. Calling chmod +x on an unverified file also mutates a dependency that this Skill does not own, although invoking it through bash does not require executable permission.

Attack Path

  1. An attacker gains write access to the expected Tavily or SearXNG Skill path, or com ...[truncated 1162 chars]
Remediation
View remediation

Remediation Suggestions

  • Prefer calling a documented search API directly rather than executing another mutable Skill.
  • If external scripts are required, pin an exact reviewed version and verify a cryptographic digest or signature before every execution.
  • Resolve and validate the canonical path, expected owner, group, and permissions.
  • Reject dependencies writable by untrusted users or groups.
  • Remove the chmod +x operation; this Skill should not modify an external dependency.
  • Pass only the minimum required environment variables using an explicit environment allowlist.
  • Avoid exporting API keys globally. Provide credentials only to a verified child process and unset them immediately afterward.
  • Document the Tavily and SearXNG integrations as explicit dependencies, including their trusted source and update policy.
  • Execute third-party integrations in a sandbox with restricted filesystem and network access where possible.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (26)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language instructions throughout the README are presented exclusively in Chinese, and the document does not indicate that this locale restriction is optional, user-selectable, or required for a region-specific purpose. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger set includes broad phrases like benefits, compensation, and housing-fund-related queries that can cause the skill to activate outside its intended pension-investigation scope. Over-broad activation increases the chance of unintended network searches, collection of unnecessary workplace-related information, and execution in contexts where the user did not mean to invoke this skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The usage examples encourage broad requests such as comprehensive welfare investigations without clear scope limits or confirmation gates. In this skill's context, that makes the risk more concrete because the documented workflow performs external searches and report generation, so ambiguous activation can lead to excessive data collection and off-target investigation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs automatic investigation via Tavily, SearXNG, and direct web access without clearly warning users that company names, search terms, and derived investigation context may be transmitted to third-party services. This is dangerous because users may unknowingly disclose sensitive business interests, employment targets, or investigative activity to external providers and websites.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The configuration enables auto-saving reports and optionally including raw data, but the skill does not clearly warn users that investigation results may be persistently written to local storage. In this context, saved reports can contain sensitive employer targeting, collected links, and derived conclusions that remain on disk and may be exposed to other local users, backups, or later unintended reuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown skill file presents all instructions, workflows, and required output formats exclusively in Chinese. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not documented here.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes broad phrases such as general benefits or treatment/investigation terms that can match routine user requests outside the narrow pension-search purpose. This can cause unintended invocation of the skill, exposing user queries to unnecessary external search behavior and producing misleading pension-related outputs in unrelated contexts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

This manifest-style JSON contains all human-facing descriptive strings and comments in Chinese, such as the file description, usage guidance, and section comments. That imposes a specific language on users without offering an opt-in choice or documenting that the skill is intentionally limited to a Chinese-speaking or China-specific context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This shell script runs other scripts via bash and writes multiple output files and a summary report to disk. Although it logs progress, the messages do not disclose the safety-relevant behavior up front, and there is no confirmation prompt or warning comment/docstring explaining that executing the script will create files and launch subordinate scripts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s user-facing comments and usage guidance force a specific language/locale, which matches the policy category for language or locale violations. There is no indication that the skill is region-specific or that users can opt into Chinese output or instructions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header and usage text describe the script as a 企业年金查询自动化脚本, implying a focused annuity-information lookup tool. However, the implemented searches also cover recruitment, employee social posts, business registry data, company type identification, and broad 'deep investigation' workflows, which materially exceed that stated intent.

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/search.sh (reported line 38)May include surrounding context.

sh
if [ ${#missing[@]} -gt 0 ]; then
        log_error "缺少依赖:${missing[*]}"
        echo "请先安装依赖:"
        echo "  Ubuntu/Debian: sudo apt install -y ${missing[*]}"
        echo "  macOS: brew install ${missing[*]}"
        exit 1
    fi

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script sends user-supplied company names and derived investigative queries to external search services without an explicit consent or privacy notice. In this skill context, the queries may reveal sensitive research targets, internal interests, or due-diligence activity to third-party services, especially when using Tavily or a remote SearXNG instance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file presents all user-facing instructions, examples, and warnings exclusively in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is clearly documented and justified, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file is entirely written in Chinese and describes the skill's operating guidance and feedback flow without indicating that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown file instructs users to export TAVILY_API_KEY but does not include any warning about treating the key as sensitive, avoiding shell history exposure, or not committing credentials to files. For a skill description, credential-handling guidance is a relevant user warning because the behavior affects privacy and account security.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The usage example says batch investigation is performed '并行执行调查' (parallel execution), but the provided batch_query.sh example uses a simple while-read loop invoking ./search.sh and ./generate_report.sh one company at a time. This is a direct contradiction between stated behavior and the documented implementation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document repeatedly presents itself as v3.2 and describes v3.1/v3.2 features throughout the file, but the closing metadata block states version 2.0.0 and last updated 2026-03-12. This is an active contradiction in the documentation that can mislead users about which capabilities and safeguards are actually intended to be present.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The description and all activation phrases are written exclusively in Chinese, which effectively constrains use to a single language. There is no indication that the skill offers a language choice, user opt-in, or a documented region-specific justification for this restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing instructions and examples exclusively in Chinese, and it does not indicate that the language is optional or region-specific. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

A natural-language policy issue exists because the skill content forces a specific language experience for all users without any opt-in or explanation that the skill is intended only for a Chinese-language or China-specific audience. The topic is China-focused, but the file does not explicitly document that locale constraint or offer language choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document explicitly recommends contacting current or former employees through private messages and similar channels, but it does not place a clear warning alongside that guidance about consent, data minimization, or avoiding pressure to disclose internal or personal information. In a research skill focused on investigating employer benefits, this can normalize borderline intrusive outreach and increase the chance of collecting personal or confidential information without appropriate safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

All help text and runtime messages are presented in Chinese, which enforces a specific language for users. The file does not indicate that the tool is intentionally region-specific or provide any opt-in or alternative locale behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

All user-facing strings, usage text, and help content are presented only in Chinese, which can impose a language choice without user opt-in. Under the language/locale policy, this is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The usage documentation states that text, json, and markdown output formats are supported. In the code, OUTPUT_FORMAT is only logged and never used to alter output generation, so the documented behavior contradicts the actual implementation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.