Back to skill

Security audit

Technical Business Strategy Analysis

Security checks for vulnerabilities and agentic risk

Overview

This business-analysis skill appears purpose-aligned, but it needs review because its instructions can turn a user-provided topic into shell commands and it stores sensitive reports or API key material without enough safeguards.

Review before installing. Use this only with non-confidential business topics unless you are comfortable sending search queries and context to Tavily and other external sources. Do not follow the documented shell snippets with raw topic text; use a sanitized slug for output paths. Avoid storing real API keys with the documented echo command, prefer a secret manager or an owner-only file, and verify permissions on any generated reports because they may contain sensitive strategy work.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:177
Finding

Shell Command Injection Through Unvalidated Topic Substitution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 177-187
Vulnerability Type: Command injection through unsafe textual substitution
Risk Level: High

Complete Code Snippet

bash
cd /home/Vincent/.openclaw/workspace/

OUTPUT_DIR="/home/Vincent/.openclaw/workspace/tech-insight/business-strategy-analysis/{主题}"
mkdir -p "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR/data"

if [ ! -d "$OUTPUT_DIR" ]; then
    echo "Error: Failed to create output directory"
    exit 1
fi

Technical Analysis

The Skill instructs the agent to place a user-controlled topic directly into shell source code. No validation, canonicalization, or safe argument-passing mechanism is defined.

Double quotes do not make text safe when untrusted content is inserted into the command before shell parsing. Shell constructs such as command substitution remain active inside double-quoted strings. A topic containing $(...) could therefore execute a command while OUTPUT_DIR is being assigned. A topic containing quote characters could also terminate the quoted value and introduce additional shell syntax.

The topic is subsequently used as a filesystem path. Even if shell metacharacters are rejected, path traversal components such as ../ could cause generated reports and data files to be written outside the intended analysis directory.

The vulnerability is in the Skill's execution instructions rather than a conventional application function, but an agent following those instructions can turn untrusted conversational input into executable shell code.

Attack Path

  1. An attacker supplies a business-analysis topic containing shell syntax, for example $(touch /tmp/skill-topic-injection).
  2. The agent substitutes that topic text into the documented OUTPUT_DIR=".../{topic}" command.
  3. The generated shell command is executed as instructed by the Skill.
  4. During assignment, the shell evaluates the command substitution and crea ...[truncated 828 chars]
Remediation
View remediation

Remediation Suggestions

  • Never generate shell source by directly replacing a placeholder with conversational input.
  • Pass the topic as data through an environment variable or positional argument rather than embedding it into a command.
  • Convert the topic to a restricted slug, for example by allowing only ASCII letters, digits, underscores, and hyphens.
  • Reject empty values, absolute paths, . and .. components, path separators, control characters, shell metacharacters, and command-substitution syntax.
  • Resolve and canonicalize the destination path, then verify that it remains beneath the intended output root before creating or writing files.
  • Derive the workspace root from an explicitly configured trusted value rather than hardcoding another user's home directory.
  • Prefer a filesystem API that accepts paths as structured arguments instead of invoking a shell.
  • If shell use is unavoidable, assign untrusted input through a positional parameter and validate it before use:
bash
set -euo pipefail

topic="$1"
case "$topic" in
    ''|*[!A-Za-z0-9_-]*)
        printf '%s\n' "Invalid topic identifier" >&2
        exit 1
        ;;
esac

output_root="${OPENCLAW_WORKSPACE:?}/tech-insight/business-strategy-analysis"
output_dir="$output_root/$topic"
mkdir -p -- "$output_dir/data"

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:252
Finding

API Key Stored in a Plaintext File Without Enforced Access Controls

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 252-254
Vulnerability Type: Insecure credential storage
Risk Level: Medium

Complete Code Snippet

bash
mkdir -p ~/.config/business-strategy-analysis
echo "tvly-YOUR_API_KEY" > ~/.config/business-strategy-analysis/tavily_key

Technical Analysis

The setup instructions direct users to write a Tavily API key into a plaintext file but do not establish restrictive permissions on either the configuration directory or the credential file.

On systems using a common 022 umask, the directory may be created with mode 0755 and a newly created key file with mode 0644. This can make the API key readable by other local users. Entering a real key directly in the documented echo command may also retain it in interactive shell history.

The instruction is also inconsistent with README.md and tavily-config.sh, which identify ~/.openclaw/.env as the unified credential location. Maintaining multiple credential locations increases secret sprawl, complicates revocation, and leaves stale copies behind.

The audited tavily-config.sh only checks whether ~/.openclaw/.env exists; it does not read or transmit its contents. That existence check alone does not exceed the minimum privilege needed to verify configuration. The confirmed weakness is the separate plaintext-key creation procedure in SKILL.md.

Attack Path

  1. A user follows the documented setup command and replaces tvly-YOUR_API_KEY with a real Tavily API key.
  2. The shell creates tavily_key using the user's current umask because no explicit permission mode is imposed.
  3. On a multi-user host with permissive resulting permissions, another local account reads the file.
  4. Alternatively, a party with access to the user's shell-history file recovers the key from the entered command.
  5. The exposed credential is then used to make unauthorized Tavily API requests until it is revoked ...[truncated 511 chars]
Remediation
View remediation

Remediation Suggestions

  • Use one documented credential source and remove the conflicting tavily_key procedure.
  • Prefer an operating-system credential store or a dedicated secret manager where supported.
  • If a local file is required, create the directory and file with owner-only permissions:
bash
install -d -m 700 "$HOME/.config/business-strategy-analysis"
umask 077
read -r -s -p "Tavily API key: " tavily_api_key
printf '\n'
printf 'TAVILY_API_KEY=%s\n' "$tavily_api_key" \
  > "$HOME/.config/business-strategy-analysis/tavily.env"
chmod 600 "$HOME/.config/business-strategy-analysis/tavily.env"
unset tavily_api_key
  • Avoid placing the secret directly on an interactive command line so it is not retained in shell history.
  • Validate ownership and permissions before loading the file; reject files owned by another account or accessible to group and other users.
  • Never print the key in logs, diagnostics, generated reports, or error messages.
  • Document key rotation and revoke any credential that may already have been stored with permissive permissions.
  • Ensure generated credential files are excluded from version control, archives, diagnostic bundles, and presentation output.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a business analysis workflow, but it also prescribes local filesystem writes, configuration of external-service credentials, and creation of persistent config files. This expands the operational scope beyond pure analysis and can surprise users, increasing risk of unintended persistence and disclosure of sensitive business inputs or credentials.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 3)May include surrounding context.

sh
#!/bin/bash
# Business Strategy Analysis - Tavily 配置脚本
# 统一使用 ~/.openclaw/.env 中的 TAVILY_API_KEY

echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 7)May include surrounding context.

sh
#!/bin/bash
# Business Strategy Analysis - Tavily 配置脚本
# 统一使用 ~/.openclaw/.env 中的 TAVILY_API_KEY

echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 9)May include surrounding context.

sh
#!/bin/bash
# Business Strategy Analysis - Tavily 配置脚本
# 统一使用 ~/.openclaw/.env 中的 TAVILY_API_KEY

echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 27)May include surrounding context.

sh
#!/bin/bash
# Business Strategy Analysis - Tavily 配置脚本
# 统一使用 ~/.openclaw/.env 中的 TAVILY_API_KEY

echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 8)May include surrounding context.

sh
echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

# 检查 ~/.openclaw/.env 是否存在
if [ ! -f "$HOME/.openclaw/.env" ]; then
    echo "❌ 错误: ~/.openclaw/.env 文件不存在"
    echo "请先配置 Tavily API Key: echo 'TAVILY_API_KEY=your_key' > ~/.openclaw/.env"
    exit 1

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tavily-config.sh (reported line 10)May include surrounding context.

sh
echo "🔄 配置 Business Strategy Analysis 使用统一的 Tavily API Key..."

# 检查 ~/.openclaw/.env 是否存在
if [ ! -f "$HOME/.openclaw/.env" ]; then
    echo "❌ 错误: ~/.openclaw/.env 文件不存在"
    echo "请先配置 Tavily API Key: echo 'TAVILY_API_KEY=your_key' > ~/.openclaw/.env"
    exit 1

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This README presents all operational descriptions and metadata in Chinese, which effectively forces a specific language for users reading the skill documentation. The policy permits locale constraints only when they are optional or clearly justified, and neither condition is stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest description is written in Chinese and the document consistently presents the workflow and examples only in Chinese, with no indication that users may choose their preferred language. Under the language/locale policy, a skill should not impose a specific language unless it offers opt-in or clearly documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The workflow relies on Tavily and multiple third-party sources, but it does not warn that user prompts, company names, product plans, or other sensitive business context may be transmitted externally. This creates a data-leakage risk, especially for confidential strategy work.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill says outputs are automatically saved to a fixed local path, but it does not clearly warn users that invoking the skill creates persistent files. This can expose confidential strategic inputs, market research, and derived analysis to later access on the host.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
89% confidence
Finding

The skill explicitly creates persistent output directories under a fixed absolute path, causing session data and analysis artifacts to remain on disk after execution. In a strategy-analysis context, those artifacts may contain sensitive business intelligence, making persistence more dangerous than in low-sensitivity tasks.

Content

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

md
# 创建输出目录(绝对路径)
   OUTPUT_DIR="/home/Vincent/.openclaw/workspace/tech-insight/business-strategy-analysis/{主题}"
   mkdir -p "$OUTPUT_DIR"
   mkdir -p "$OUTPUT_DIR/data"
   
   # 验证目录创建成功

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The documentation instructs storing a Tavily API key in a local file without strong justification, access controls, or secure-secret handling guidance. If followed, credentials may be left in plaintext on disk where other local processes or users could read them.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description is written entirely in Chinese and presents the skill as a Chinese-language experience, but there is no indication that users can choose another language or that the locale restriction is intentional and documented. This may violate language or locale policy when the skill is exposed to broader users without opt-in.

Content

No source excerpt is available for this finding.

Session Persistence

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

Content

Scanner excerpt · tavily-config.sh (reported line 15)May include surrounding context.

sh
fi

# 创建配置目录(如果不存在)
mkdir -p ~/.config/business-strategy-analysis

# 创建域名白名单配置
cat > ~/.config/business-strategy-analysis/tavily_domains.json << EOF

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains user-facing natural-language content exclusively in Chinese, and there is no indication that users may choose another language or that the template is intentionally limited to a Chinese-language audience. Under the policy rule for language or locale constraints, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The configuration instructions tell users to place an API key in a local file but omit even basic warnings about secure handling. While not inherently malicious, this encourages insecure operational practices that can lead to credential exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This manifest description presents a general-purpose business strategy analysis capability but does not specify when the skill should or should not be invoked. In a manifest file, such broad language can contribute to unintended activation because there are no explicit trigger phrases, scope limits, or exclusion conditions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file presents the skill content primarily in Chinese throughout, with only brief English glosses in headings. Under the policy rule for natural-language violations, forcing a specific language without offering the user a choice or documenting a justified locale constraint is a reportable issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The entire skill content is written in Chinese and does not offer any language or locale choice. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation when no justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script's user-facing comments and echo messages are written in Chinese, including status and error output, with no indication that users can select another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language content is entirely in Chinese, and there is no indication that the skill offers a language option or that the locale restriction is intentional for a region-specific use case. Under the policy, forcing a specific language without user opt-in can constitute a language or locale policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file uses a single fixed language throughout and does not indicate that users can choose another language or that the template is intended only for a Chinese-language context. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

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 contains user-facing instructions entirely in Chinese, and there is no indication that the skill supports other languages or that Chinese is a required locale. Under the policy rule for language/locale constraints, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file contains user-facing instructions exclusively in Chinese, which can amount to a language/locale policy violation under the stated rules when no opt-in or alternative language is provided. The file does not indicate that the template is region-specific or that users may choose another language.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.