Back to skill

Security audit

🏨 IHG积分房查找

Security checks for vulnerabilities and agentic risk

Overview

This hotel-search skill is not clearly malicious, but its main executable is missing from the reviewed package and some maintenance scripts can replace live skill code without strong safeguards.

Install only after reviewing the external /home/node/.openclaw/scripts/ihg-monitor-python/query.py implementation or after the publisher bundles query.py and hotels.json inside the skill. Avoid running rollback.sh on untrusted backup labels or backup directories until it validates paths and verifies file integrity.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Error
Location
simple_skills.json:19
Finding

Core Skill Behavior Depends on an Unbundled and Unverified Python Executable

Content
View full analysis

Vulnerability Details

File Locations:

  • skills.json:73-79
  • simple_skills.json:19-25
  • scripts/health_check.py:11-17
  • SKILL.md:78-81

Vulnerability Type: Unverified external executable dependency and local module substitution
Risk Level: High

Vulnerable Code

skills.json:73-79:

json
"exec": {
  "command": "python3",
  "args": [
    "./scripts/query.py",
    "{{query}}"
  ],
  "env": {
    "PYTHONUNBUFFERED": "1"
  }
}

simple_skills.json:19-25:

json
"exec": {
  "command": "python3",
  "args": [
    "/home/node/.openclaw/scripts/ihg-monitor-python/query.py",
    "{{query}}"
  ]
}

scripts/health_check.py:11-17:

python
sys.path.insert(0, '/home/node/.openclaw/scripts/ihg-monitor-python')

try:
    from query import execute_query
except ImportError as e:
    print(f"❌ Import failed: {e}")
    sys.exit(1)

SKILL.md:78-81:

bash
python3 /home/node/.openclaw/scripts/ihg-monitor-python/query.py "Shanghai surroundings"
python3 /home/node/.openclaw/scripts/ihg-monitor-python/query.py "promotion information"

Technical Analysis

The reviewed package does not contain scripts/query.py or scripts/hotels.json. Nevertheless, the primary manifest attempts to execute the missing relative script, while the alternate manifest and operational documentation execute /home/node/.openclaw/scripts/ihg-monitor-python/query.py outside the reviewed package.

The health checker adds that external directory to the beginning of sys.path and imports query. Importing a Python module executes its top-level code immediately. No cryptographic digest, signature, canonical-path check, ownership check, or permission check is performed before execution.

Consequently, the effective Skill implementation is not represented by the audited artifact. Its behavior depends on whichever query.py happens to exist at runtime. This creates ...[truncated 2149 chars]

Remediation
View remediation

Remediation Suggestions

  1. Bundle query.py and hotels.json within the published Skill artifact.
  2. Use one authoritative manifest and a package-relative executable path resolved from the manifest or script directory, not the current working directory.
  3. Remove the conflicting simple_skills.json manifest unless it is strictly required.
  4. Before execution, resolve the executable with realpath and verify that it remains inside the immutable Skill directory.
  5. Reject symbolic links and files writable by untrusted users or groups.
  6. If an external executable is unavoidable, publish an authenticated manifest containing its SHA-256 digest and verify that digest before every invocation.
  7. Do not prepend a mutable external directory to sys.path. Load a verified module from a fixed path or import the bundled package normally.
  8. Apply least-privilege permissions so only the deployment identity can replace executable Skill files.
  9. Add installation and CI checks that fail when any declared executable or permitted data file is absent.

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/rollback.sh:8
Finding

Unsanitized Backup Version Paths and Unverified Rollback Content Can Replace Live Skill Code

Content
View full analysis

Vulnerability Details

File Locations:

  • scripts/backup.sh:7-23
  • scripts/rollback.sh:8-39

Vulnerability Type: Path traversal and unsafe restoration of unverified executable content
Risk Level: High

Vulnerable Code

scripts/backup.sh:7-23:

bash
VERSION=${1:-"v2.2-$(date +%Y%m%d)"}
BACKUP_ROOT="/home/node/.openclaw/backups"
SKILLS_DIR="/home/node/.openclaw/skills/find-ihg"
SCRIPTS_DIR="/home/node/.openclaw/scripts/ihg-monitor-python"
BACKUP_DIR="$BACKUP_ROOT/find-ihg-$VERSION"

echo "💾 Starting backup version: $VERSION"

# Create backup directories
mkdir -p "$BACKUP_DIR/skills"
mkdir -p "$BACKUP_DIR/scripts"

echo "📥 Backing up Skill files..."
cp -r "$SKILLS_DIR/"* "$BACKUP_DIR/skills/" 2>/dev/null || true

echo "📥 Backing up script files..."
cp -r "$SCRIPTS_DIR/"* "$BACKUP_DIR/scripts/" 2>/dev/null || true

scripts/rollback.sh:8-39:

bash
VERSION=${1:-"v2.1"}
BACKUP_ROOT="/home/node/.openclaw/backups"
SKILLS_DIR="/home/node/.openclaw/skills/find-ihg"
SCRIPTS_DIR="/home/node/.openclaw/scripts/ihg-monitor-python"
BACKUP_DIR="$BACKUP_ROOT/find-ihg-$VERSION"

echo "🔄 Starting rollback to version $VERSION..."

# Check whether the backup exists
if [ ! -d "$BACKUP_DIR" ]; then
    echo "❌ Backup directory does not exist: $BACKUP_DIR"
    exit 1
fi

echo "📦 Backup directory contents:"
ls -la "$BACKUP_DIR"

# Request confirmation
read -p "⚠️ Confirm rollback to version $VERSION? (y/N): " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
    echo "❌ User cancelled rollback"
    exit 0
fi

# Perform rollback
echo "📤 Restoring Skill files..."
cp -r "$BACKUP_DIR/skills/"* "$SKILLS_DIR/" 2>/dev/null || true

echo "📤 Restoring script files..."
cp -r "$BACKUP_DIR/scripts/"* "$SCRIPTS_DIR/" 2>/dev/null || true

Technical Analysis

Both scripts concatenate the caller-controlled VERSION argument into BACKUP_DIR without validatin ...[truncated 3253 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate version labels against a strict allowlist, such as:
    bash
    if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-[A-Za-z0-9._-]+)?$ ]]; then
        echo "Invalid version label" >&2
        exit 1
    fi
    
  2. Resolve both BACKUP_ROOT and BACKUP_DIR to canonical paths and reject the operation unless the selected directory is a direct child of the backup root.
  3. Reject absolute paths, slash characters, .. components, control characters, and symbolic links in version labels and restoration sources.
  4. Generate a backup manifest containing relative file names, ownership metadata, and SHA-256 hashes.
  5. Sign or authenticate the manifest and verify every file before restoration.
  6. Restore only an explicit allowlist of expected files rather than recursively copying every entry.
  7. Stage restored files in a newly created private directory, validate them, and atomically replace the live version only after all checks pass.
  8. Remove 2>/dev/null || true; terminate on any copy failure and report the rollback as failed.
  9. Run backup and rollback under a dedicated least-privileged deployment identity.
  10. Log the canonical source path, verified manifest identity, operator identity, and resulting file hashes.
  11. After restoration, verify the executable digest before allowing the Skill or health checker to run.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (18)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation examples use very broad natural-language triggers such as generic hotel recommendation phrases without a strong invocation boundary beyond conversational wording. In an agent environment, this can cause accidental or contextually inappropriate skill activation when a user is discussing travel generally, leading to unintended data access, action routing, or overreach by the skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The keyword-to-parameter mappings convert common travel terms like '商务出行', '设计', '休闲', and city names directly into execution parameters, which is ambiguous and prone to over-triggering. This increases the risk that unrelated or partially related user input is silently reinterpreted as structured commands, causing unauthorized or unintended skill behavior.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · GOGO_INSTRUCTIONS.md (reported line 370)May include surrounding context.

md
openclaw skills list | grep ihg-monitor

# 检查脚本权限
ls -la /home/node/.openclaw/scripts/ihg-monitor-python/query.py

# 测试直接调用
cd /home/node/.openclaw/scripts/ihg-monitor-python

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The entire skill documentation, invocation examples, and output format are presented only in Chinese, and the usage section explicitly models Chinese-language calls without mentioning any user opt-in or alternative locale. Under SQP-3, this is a natural-language locale policy concern because the skill appears to require a specific language rather than offering a choice or documenting a justified regional-only constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language trigger examples are very broad and could cause the agent to invoke this skill on loosely related user requests without strong confirmation or scoping. In an agent system, over-broad activation can lead to unintended tool use, disclosure of internal capabilities, or actions based on inferred intent rather than explicit user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

SQP-3 applies to all file types and covers language or locale policy violations. The document presents the skill interface, examples, parameters, and support guidance exclusively in Chinese, and does not indicate that users may choose another language or that the Chinese-only constraint is an intentional, justified regional requirement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example trigger phrases are broad enough to match generic travel or promotions queries, which can cause the agent to invoke this skill outside the user's intended scope. In an agent environment, overbroad routing can lead to incorrect tool selection, irrelevant responses, or untrusted skill execution when a user did not explicitly ask for this IHG-specific function.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script's natural-language comments and interactive messages are entirely in Chinese, including usage instructions and the confirmation prompt. The file does not offer any language choice or document that the skill is intentionally limited to a Chinese-speaking or region-specific environment, which creates a locale policy violation under the stated rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The module docstring and all user-facing messages are written exclusively in Chinese, indicating a fixed language/locale choice. Under the policy, forcing a specific language without user opt-in or a documented region-specific rationale is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill name, description, example, and input description are all specified only in Chinese, which effectively constrains usage to a single language without stating that this is an opt-in or region-specific skill. Under the policy for natural-language violations, forcing a specific language without user choice or justification is a reportable issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The user-facing description and examples are entirely in Chinese, and the input descriptions continue this assumption without offering a language choice or stating that the skill is intentionally region-specific from a locale-policy standpoint. Under SQP-3, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The pattern "^IHG.*优惠.*活动?$" can match a wide range of everyday promotion-related queries about IHG, many of which may fall outside this skill’s stated purpose of finding regional IHG points hotels. The manifest does not provide negative examples or additional constraints to distinguish hotel-availability searches from generic marketing or loyalty questions.

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 is natural-language content, and all user-facing text is presented only in Chinese. Under the policy rule for language or locale constraints, forcing a single language without user opt-in or documented justification can be a policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This JSON file contains natural-language fields such as check names and details entirely in Chinese, but does not document any locale constraint, region-specific purpose, or user opt-in for that language. Under the policy rule for language/locale, forcing a specific language without opt-in can be a violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

All user-facing comments and status messages in the script are in Chinese, which imposes a specific language on users without any opt-in or indication that the skill is intended only for a Chinese-speaking environment. The policy allows locale constraints only when they are explicitly justified or optional, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

This Python file contains natural-language descriptions and console output exclusively in Chinese, including the module docstring and user-facing status messages. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This code performs a file write to references/audit_report.json, which falls under operations that can affect user data or workspace state. Although the script later prints where the report was saved, there is no warning or explanatory comment/docstring near the write operation itself indicating that running the audit will create or overwrite a file.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This manifest applies to SQP-1, and the example phrase "IHG有什么优惠活动" is broad enough to match many ordinary requests about IHG promotions, not specifically the skill’s stated Jiangsu/Zhejiang/Shanghai points-hotel discovery workflow. Because the manifest does not provide exclusion conditions or clarify whether general promotions versus hotel search requests should invoke the skill, it could cause unintended activation.

Content

No source excerpt is available for this finding.