Back to skill

Security audit

clawec-ozon-product-hot-ranking

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed read-only integration that queries ClawEC's Ozon product-ranking API using the user's API key.

Install only if you intend to use ClawEC's API and are comfortable sending Ozon query parameters to clawec.com with your CLAWEC_API_KEY. Avoid passing untrusted filtersJson because it can override documented request fields; rely on server-side limits and monitor API quota usage.

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

T09 · Insecure Skill Coding Practices

Note
Location
scripts/query.sh:25
Finding

Unrestricted JSON Filter Merging Allows Request Constraint Bypass

Content
View full analysis

Vulnerability Details

File Location: scripts/query.sh, lines 25–29
Vulnerability Type: Unvalidated request-field override
Risk Level: Low

python
if len(sys.argv) > 8 and sys.argv[8]:
    extra = json.loads(sys.argv[8])
    if not isinstance(extra, dict):
        raise SystemExit("filtersJson must be a JSON object")
    body.update(extra)

Technical Analysis

The script constructs core request fields from positional arguments, including level1CategoryId, pageNo, pageSize, period, sortField, and sortDirection. It then parses caller-provided filtersJson and merges it into the request with body.update(extra).

Although the code verifies that the supplied JSON is an object, it does not restrict its keys or validate their values. Python's dict.update() replaces existing values when duplicate keys are present. Consequently, the additional filter object can override core request fields after their initial conversion and can introduce fields not documented by the skill.

For example, the following filter object overrides fields that are supposed to be controlled by dedicated positional parameters:

json
{
  "pageSize": 100000,
  "level1CategoryId": 999999999,
  "period": "UNSUPPORTED_VALUE",
  "unexpectedField": "value"
}

This undermines the documented restriction that pageSize must not exceed 15 and bypasses the script's intended request structure. The remote API may independently reject invalid values, but the local script does not enforce the stated policy.

This behavior does not provide local command execution: the JSON is passed to Python as a quoted argument, parsed with json.loads(), serialized with json.dumps(), and passed to curl as quoted data.

Attack Path

  1. An attacker or untrusted caller gains the ability to invoke scripts/query.sh or influence its eighth argument.
  2. The caller supplies apparently valid positional parameters.

...[truncated 1212 chars]

Remediation
View remediation

Remediation Suggestions

  1. Define an explicit allowlist containing only supported optional filter fields:

    python
    allowed_filters = {
        "minSales", "maxSales",
        "minGmv", "maxGmv",
        "minPrice", "maxPrice",
        "minCreateDate", "maxCreateDate",
        "deliveryModes",
        "crossBorderSalePermission",
        "productType",
        "salesLevel",
    }
    
  2. Reject unknown keys and attempts to override core request fields:

    python
    unknown = set(extra) - allowed_filters
    if unknown:
        raise SystemExit(
            "Unsupported or protected filter fields: " + ", ".join(sorted(unknown))
        )
    body.update(extra)
    
  3. Validate all fields after constructing the final request:

    • Require pageNo to be between 1 and 10000.
    • Require pageSize to be between 1 and 15.
    • Restrict period, sortField, and sortDirection to documented enumerations.
    • Validate numeric ranges and ensure minimum values do not exceed maximum values.
    • Restrict deliveryModes to documented values.
    • Validate date and accounting-period formats.
    • Reject unexpected JSON value types.
  4. Keep protected fields such as level1CategoryId, pagination, period, and sorting exclusively controlled by their dedicated positional parameters.

  5. Retain server-side validation because client-side validation alone cannot prevent callers from making direct API requests.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill includes executable shell usage examples and references a local script, but it does not declare any tool scope or allowed-tools restrictions. In an agent environment, this can lead to over-broad execution privileges or ambiguity about whether shell access is intended, increasing the risk of unintended command execution or misuse of local environment secrets.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

调用

bash
curl -s -X POST "https://www.clawec.com/api/aigc/ec/ozon/data/product/hot-ranking" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CLAWEC_API_KEY" \
  -d '{"level1CategoryId":17027489,"period":"TWENTY_EIGHT_DAY","pageNo":1,"pageSize":15,"sortField":"SALES","sortDirection":"DESC"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/query.sh (reported line 34)May include surrounding context.

sh
print(json.dumps(body))
' "$LEVEL1_CATEGORY_ID" "$PERIOD" "$PAGE_NO" "$PAGE_SIZE" "$SORT_FIELD" "$SORT_DIRECTION" "$UPDATE_PERIOD" "$FILTERS_JSON")

curl -s -X POST "https://www.clawec.com/api/aigc/ec/ozon/data/product/hot-ranking" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "$PAYLOAD"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This shell script performs an HTTP POST to an external service and includes both a bearer token from an environment variable and potentially user-supplied JSON data in the request body. While the operation is visible in code, there is no confirmation prompt, comment, or user-facing notice explaining that data will be transmitted off-system.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The markdown explicitly states '默认中文报告', which imposes a specific language for responses. Under the policy, language constraints should either offer user choice or be clearly justified as region-specific; neither is stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all instructions and field explanations only in Chinese, including the title, schema descriptions, and parsing guidance. Under the policy for natural-language issues, forcing a specific language without user opt-in can be a locale/language policy violation when no alternative or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The usage and error strings are hard-coded in Chinese, which imposes a specific language on users without opt-in or documented justification. This is a natural-language policy concern because the skill does not provide a language choice or explain that it is intended only for a Chinese-speaking context.

Content

No source excerpt is available for this finding.