Back to skill

Security audit

ClawHub Retry & Fallback

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly fits its retry and fallback purpose, but its audit export behavior, unpinned install dependencies, and unsupported security claims need review before installation.

Install only after reviewing the operational risk: use a virtual environment, pin and hash dependencies, restrict who can configure fallback tools, treat audit logs and exports as potentially sensitive, and avoid opening CSV/XLSX exports from untrusted task data until formula neutralization is added.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/audit_logger.py:291
Finding
Spreadsheet Formula Injection in Audit Log Exports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/audit_logger.py:291-309` and `scripts/audit_logger.py:333-348` **Vulnerability Type**: CSV/XLSX formula injection **Risk Level**: Medium ### Vulnerable Code ```python def _export_csv(self, logs: List[LogEntry], filepath: Path): """Export as CSV""" if not logs: return with open(filepath, 'w', newline='', encoding='utf-8') as f: # Collect all possible fields all_keys = set() for log in logs: all_keys.update(log.to_dict().keys()) all_keys.update(log.details.keys()) fieldnames = ['timestamp', 'datetime', 'operation', 'task_id'] + sorted( all_keys - { 'timestamp', 'datetime', 'operation', 'task_id', 'details' } ) writer = csv.DictWriter(f, fieldnames=fieldnames) writer.writeheader() for log in logs: row = log.to_dict() row.update(log.details) row.pop('details', None) writer.writerow(row) ``` ```python # Data for log in logs: row = [ datetime.fromtimestamp(log.timestamp).strftime('%Y-%m-%d %H:%M:%S'), log.operation, log.task_id, json.dumps(log.details, ensure_ascii=False) ] ws.append(row) # Adjust column widths ws.column_dimensions['A'].width = 20 ws.column_dimensions['B'].width = 15 ws.column_dimensions['C'].width = 30 ws.column_dimensions['D'].width = 60 wb.save(filepath) ``` ### Technical Analysis The audit APIs accept caller-controlled strings, including task identifiers, exception messages, error messages, failed-step names, and tool names. These values are exported directly to CSV or XLSX files without neutralizing spreadsheet formula prefixes. Spreadsheet programs may interpret cells beginning with `=`, `+`, `-`, or `@` as formulas rather than plain text. In the XLSX path, `log.task_id` is inserted directly into a worksheet cell. In the CSV path, all ...[truncated 1780 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Sanitize every value before writing it to CSV or XLSX. 2. Convert values to strings and prefix values beginning with `=`, `+`, `-`, or `@` with a single quote. 3. Account for leading whitespace, tabs, carriage returns, and line feeds before checking the first effective character. 4. For XLSX exports, explicitly store untrusted values as strings rather than formulas. 5. Apply sanitization to both top-level fields and values serialized from `log.details`. 6. Add automated tests for every dangerous prefix and for values containing leading whitespace. Example defensive helper: ```python def _spreadsheet_safe(value: Any) -> str: text = "" if value is None else str(value) effective = text.lstrip(" \t\r\n") if effective.startswith(("=", "+", "-", "@")): return "'" + text return text ``` Apply this helper to every CSV field: ```python safe_row = { key: self._spreadsheet_safe(value) for key, value in row.items() } writer.writerow(safe_row) ``` For XLSX, sanitize each string before appending and explicitly set cells to string values where practical. Do not rely solely on spreadsheet-client warnings. ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Unpinned and Unhashed Third-Party Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:1-3` **Vulnerability Type**: Non-reproducible dependency resolution and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```text retry>=0.9.1 pyyaml>=6.0 python-json-logger>=2.0.0 ``` The documented installation command in `SKILL.md:37-40` is: ```bash pip install -r requirements.txt ``` ### Technical Analysis Every dependency uses an open-ended lower-bound constraint. Consequently, two installations performed at different times may resolve to different package versions, including future releases that were not part of this audit. The dependency manifest also contains no package hashes. Package authenticity therefore depends entirely on the configured Python package index, TLS trust, and package-account integrity at installation time. No evidence was found that the currently named packages are malicious. The issue is that the effective installed code is not reproducibly constrained to reviewed artifacts. A compromised upstream release, dependency account, package index, or resolver environment could introduce unreviewed code. ### Attack Path 1. A user follows the documented `pip install -r requirements.txt` instruction. 2. Pip resolves the newest available versions satisfying the open-ended `>=` constraints. 3. An upstream package release or distribution artifact has changed since the Skill was reviewed. 4. Pip downloads and installs that unreviewed artifact without comparing it against a repository-maintained hash. 5. Package installation or subsequent import executes the dependency code with the privileges of the user or service installing and running the Skill. ### Impact Assessment The maximum impact depends on the account performing installation or executing the application. A compromised dependency could operate with that account's privileges and potentially: - Read files and environment variables accessible to the process. - Alter application behavior or d ...[truncated 376 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin each direct dependency to an exact, reviewed version using `==`. 2. Generate and commit a lock file that includes resolved transitive dependencies. 3. Record cryptographic hashes for every distribution artifact. 4. Install with hash enforcement, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 5. Generate the locked manifest with a controlled tool such as `pip-compile --generate-hashes`. 6. Use a trusted internal package mirror where appropriate. 7. Scan locked versions for known vulnerabilities and licenses in CI. 8. Update dependencies through a deliberate review process rather than permitting automatic resolution to arbitrary future versions. 9. Run installation and the Skill under a least-privileged virtual environment or container rather than a privileged system account. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill is presented as broad ClawHub automatic retry/fallback handling, but the behavior appears to be a generic fallback manager lacking the promised platform-specific integration and retry implementation. Such overclaiming can lead to unsafe deployment decisions, especially where operators rely on the description to understand execution scope and automation triggers.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill is presented as broad ClawHub automatic retry/fallback handling, but the behavior appears to be a generic fallback manager lacking the promised platform-specific integration and retry implementation. Such overclaiming can lead to unsafe deployment decisions, especially where operators rely on the description to understand execution scope and automation triggers.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The skill is presented as broad ClawHub automatic retry/fallback handling, but the behavior appears to be a generic fallback manager lacking the promised platform-specific integration and retry implementation. Such overclaiming can lead to unsafe deployment decisions, especially where operators rely on the description to understand execution scope and automation triggers.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The automatic backup-tool switching feature does not warn users that the same task data and parameters may be sent to a different tool, provider, or trust boundary when fallback occurs. In an agent environment this can silently expand data exposure, create compliance issues, or violate user expectations about where inputs are processed.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The audit logging and export features describe recording retry events, exceptions, task data, and parameter mappings, but do not warn that these records may contain sensitive information and may be exported to portable files like Excel or PDF. In an agent platform, this increases the risk of unintended data retention, insider exposure, and leakage through exported reports.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The README claims audit logs are 'tamper-proof', but the documented implementation only shows normal local logging, querying, and export operations without integrity controls such as append-only storage, signatures, hashes, or remote write-once retention. This can create a false security assumption for operators who may rely on the logs as forensic evidence even though an attacker or insider could alter or delete them.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The README asserts a built-in risk-control mechanism that blocks malicious high-frequency calls, but the described skill behavior is limited to retry, fallback, degradation, and logging. Overstating security controls is dangerous because users may assume abuse prevention exists and deploy the skill in contexts where rate limiting or anti-abuse protection is actually absent.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill documentation advertises capabilities that imply file access, persistent logging, and network use, but it declares no explicit tool scope or permission boundaries. In an agent setting, this weakens least-privilege controls and can cause the skill to be invoked with broader capabilities than users or reviewers expect.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The primary instructional content is presented in Chinese and the document does not offer a language selection or state that the skill is region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

External Transmission

Medium
Category
Data Exfiltration
Content
@handler.with_retry(max_attempts=3, backoff_strategy='exponential')
def my_api_call():
    # 你的API调用
    return requests.get('https://api.example.com/data')

# 自动重试执行
result = my_api_call()
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
@handler.with_retry(max_attempts=3, backoff_strategy='exponential')
def my_api_call():
    # 你的API调用
    return requests.get('https://api.example.com/data')

# 自动重试执行
result = my_api_call()
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
@handler.with_retry(max_attempts=3, backoff_strategy='exponential')
def my_api_call():
    # 你的API调用
    return requests.get('https://api.example.com/data')

# 自动重试执行
result = my_api_call()
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This Python file contains pervasive user-facing strings, comments, and console output in Chinese, including the title, example labels, status messages, and final execution output. Because the skill does not offer any user opt-in or alternative locale choice, it appears to enforce a specific language, which matches the natural-language locale policy violation criteria.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module docstring, class docstrings, comments, and user-facing labels are written in Chinese throughout, including exported Excel headers and descriptive text. This imposes a specific language/locale without any opt-in, alternative, or documented region-specific justification, which matches the policy-violation category for forced language choice.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The AuditLogger docstring lists '支持导出Excel/PDF格式' and '实时状态同步通知'. However, export_logs only supports json/csv/excel and raises an error for other formats, while notification callbacks are only declared and never used, so the documentation actively overstates implemented behavior.

Description-Behavior Mismatch

Medium
Confidence
91% confidence
Finding
The manifest describes a skill for automatic retry and fallback handling of ClawHub task failures. In this file, the code adds persistent audit logging, multi-format export, and report generation capabilities, which are ancillary operational features rather than the retry/fallback handling behavior the skill claims as its core purpose.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The module title, class docstrings, and user-facing warning messages are written in Chinese, and the file provides no indication that language is selectable or that the skill is intentionally region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Description-Behavior Mismatch

Medium
Confidence
86% confidence
Finding
The manifest describes a skill for automatic retry and fallback handling of ClawHub tool-call failures, which implies managing runtime retry behavior. This file also persists configuration to disk via save_config, adding a configuration-writing capability beyond merely handling retries/fallback at execution time.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This Python file uses Chinese-only natural-language descriptions such as the module title and comments, and does not indicate that language selection is optional or limited to a region-specific use case. Under the policy rule, forcing a specific language/locale without user opt-in is a natural-language policy violation.

Intent-Code Divergence

Medium
Confidence
87% confidence
Finding
The description for MEDIUM says '保留已完成结果,输出核心内容', implying the handler emits core content after degradation. In the actual logic, when a critical step fails from NONE state, the code only preserves already completed results and breaks execution at L133-L140; there is no separate behavior that identifies or outputs 'core content'.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The module title and surrounding natural-language documentation are written exclusively in Chinese, and the rest of the file continues this pattern in docstrings and recommendation strings. Under the stated policy, forcing a specific language or locale without offering user choice or documenting a justified regional constraint is a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
This YAML file contains user-facing descriptions and comments primarily in Chinese, such as the header comments and policy descriptions. Under the policy rule for natural-language violations, forcing a specific language without opt-in or justification can be a locale-policy issue.

Unpinned Dependencies

Low
Category
Supply Chain
Content
retry>=0.9.1
pyyaml>=6.0
python-json-logger>=2.0.0
Confidence
95% confidence
Finding
The dependency is specified with a lower-bound range instead of an exact pinned version, which makes builds non-reproducible and can introduce unexpected vulnerable or incompatible releases during installation. In a retry/fallback skill, this is not directly exploitable by itself, but it increases supply-chain risk because the installed package version may vary across environments.

Unpinned Dependencies

Low
Category
Supply Chain
Content
retry>=0.9.1
pyyaml>=6.0
python-json-logger>=2.0.0
Confidence
99% confidence
Finding
PyYAML is unpinned, so deployments may resolve to different versions, including ones with known security advisories depending on the environment and timing of installation. This is more concerning than a generic unpinned package because YAML parsers have a history of unsafe parsing issues, so version drift can materially affect exploitability if the skill ever processes untrusted YAML.

Unverifiable Dependency: pyyaml has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
98% confidence
Finding
The manifest includes PyYAML without pinning a version, while PyYAML has multiple known advisories across historical releases. Because the resolved version is unknown, there is no assurance that deployments avoid affected versions; if the skill parses attacker-controlled YAML, this could enable unsafe deserialization or other parser-related attacks.

Static analysis

No suspicious patterns detected.