Back to skill

Security audit

Yufluent Clawhub Publish Yufluentcn Ad Optimize

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches a cloud ads-optimization purpose, but it needs Review because it can send the API key and business ad data to an unvalidated configurable endpoint, including non-HTTPS URLs.

Install only if you trust Yufluent and can verify the API endpoint you configure. Treat TOKENAPI_KEY as a sensitive secret, avoid putting confidential ad-account or customer data in prompts unless needed, and do not set TOKENAPI_BASE_URL to an untrusted or plaintext non-local endpoint.

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

Error
Location
scripts/yufluent_api.py:19
Finding

Bearer Credential and Business Data Can Be Sent to an Arbitrary Insecure Endpoint

Content
View full analysis

Vulnerability Details

File Location: scripts/yufluent_api.py:19-24, 49-61, 126-140, 218-221
Vulnerability Type: Arbitrary endpoint selection and plaintext transmission of sensitive data
Risk Level: High

Complete Code Snippet

python
def normalize_api_root(base_url: str) -> str:
    base = (base_url or "").strip().rstrip("/")
    if not base:
        base = "http://localhost:8080/v1"
    if base.endswith("/v1"):
        return base
    return f"{base}/v1"
python
def _auth_headers(api_key: str) -> dict[str, str]:
    return {
        "Authorization": f"Bearer {api_key}",
        "Accept": "application/json",
    }


def _json_headers(api_key: str) -> dict[str, str]:
    return {**_auth_headers(api_key), "Content-Type": "application/json"}
python
def _post_json(
    url: str,
    *,
    api_key: str,
    body: dict[str, Any] | None = None,
    timeout: float,
) -> requests.Response:
    kwargs: dict[str, Any] = {
        "headers": _json_headers(api_key) if body is not None else _auth_headers(api_key),
        "timeout": timeout,
    }
    if body is not None:
        kwargs["json"] = body
    return requests.post(url, **kwargs)
python
root = base_url or os.getenv("TOKENAPI_BASE_URL", "")
url = skill_run_url(root, skill_id)
try:
    resp = _post_json(url, api_key=key, body=payload, timeout=timeout)

Technical Analysis

The client obtains its destination from the caller-controlled base_url argument or the TOKENAPI_BASE_URL environment variable. It accepts any host and scheme without requiring TLS, restricting destinations to an approved service, or validating redirect destinations.

The same request includes the TOKENAPI_KEY as a bearer credential and sends the complete optimization payload. That payload may contain campaign metrics, product information, target markets, advertising goals, and additional business context.

Although transmitting these inputs to a cloud service is consistent with the Skill ...[truncated 2124 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require https:// for every non-loopback endpoint. Permit plaintext HTTP only for explicit development mode and only for loopback addresses such as 127.0.0.1, ::1, or a strictly validated localhost.
  2. Allowlist the documented production API hostname and reject arbitrary hosts by default.
  3. Parse URLs with a standard URL parser and reject unsupported schemes, embedded credentials, malformed ports, fragments, and ambiguous host representations.
  4. Disable automatic redirects for authenticated requests, or manually follow redirects only after verifying that the destination remains HTTPS and belongs to the approved hostname set.
  5. Never forward the Authorization header across origins.
  6. Separate production and development endpoint configuration. Avoid silently defaulting security-sensitive production use to an HTTP URL.
  7. Display or log the selected destination without exposing the token, allowing users to verify where sensitive data will be sent.
  8. Apply narrowly scoped, revocable, and short-lived API tokens where supported. Server-side authorization should constrain each token to only the operations required by this Skill.
  9. Document that campaign metrics and business context are transmitted to the cloud service and obtain user confirmation before transmitting especially sensitive inputs.
  10. Add tests covering malicious environment values, non-HTTPS destinations, cross-origin redirects, URL parsing edge cases, and authorization-header stripping.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (18)

Tainted flow: 'url' from os.getenv (line 271, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The client allows the destination base URL to come from an environment variable and defaults to plain HTTP for localhost, then sends a bearer token and arbitrary payload to that URL with requests.post. If an attacker can influence TOKENAPI_BASE_URL or deployment environment, they can redirect requests to an attacker-controlled endpoint and exfiltrate API credentials and user data; the skill context increases risk because this code is explicitly designed to transmit authenticated skill inputs to a remote service.

Content

Scanner excerpt · scripts/yufluent_api.py (reported line 150)May include surrounding context.

python
}
    if body is not None:
        kwargs["json"] = body
    return requests.post(url, **kwargs)


def _raise_for_status(resp: requests.Response) -> None:

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 · README.md (reported line 10)May include surrounding context.

powershell
cd skills\yufluentcn-ad-optimize
pip install -r requirements.txt
copy .env.example .env
# 编辑 TOKENAPI_KEY = "tk-***"

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a specific ads optimization tool, but detected behavior suggests it can invoke arbitrary remote skills/endpoints and submit telemetry/outcomes through a generic authenticated cloud API. That broad remote-execution/orchestration capability significantly expands the trust boundary: a user expecting a fixed-function coach may instead grant a generic cloud agent access using their API key.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill is presented as a specific ads optimization tool, but detected behavior suggests it can invoke arbitrary remote skills/endpoints and submit telemetry/outcomes through a generic authenticated cloud API. That broad remote-execution/orchestration capability significantly expands the trust boundary: a user expecting a fixed-function coach may instead grant a generic cloud agent access using their API key.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill is presented as a specific ads optimization tool, but detected behavior suggests it can invoke arbitrary remote skills/endpoints and submit telemetry/outcomes through a generic authenticated cloud API. That broad remote-execution/orchestration capability significantly expands the trust boundary: a user expecting a fixed-function coach may instead grant a generic cloud agent access using their API key.

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 · SKILL.md (reported line 26)May include surrounding context.

md
## 快速开始(3 步,60 秒)

1. **注册获取 API 密钥** → https://claw.changzhiai.com/login (新用户即送体验积分,无需绑卡)
2. **设置环境变量**:export TOKENAPI_KEY=*** 或写入 .env 文件
3. **运行**:参照下方 Examples 示例执行 python scripts/run.py ...

> 还没注册?前往 https://claw.changzhiai.com/login 免费获取密钥。

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares execution-related capabilities through OpenClaw metadata (env requirement and pip install) and operational instructions that rely on local execution plus network access, but it does not define an explicit tool/permission scope. That creates an authorization gap: consumers may not understand what resources the skill can access, making review and sandboxing harder and increasing the chance of over-broad execution privileges.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file’s natural-language instructions indicate behavior in Chinese, such as the module docstring and function comments describing shared CLI behavior in Chinese. This can reflect a language/locale constraint without any visible user choice or opt-in, which matches the policy rule for forced language behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The CLI collects user-supplied campaign details, metrics, market, and context and sends them to a remote cloud API via run_skill(...), but this file does not provide any explicit user-facing notice, consent prompt, or data-handling warning. In an advertising optimization skill, these fields can contain commercially sensitive performance data, targeting strategy, or customer/business information, so silent transmission to a third-party service creates a real confidentiality and privacy risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
74% confidence
Finding

Natural-language strings and comments indicate the skill is designed around Chinese-language usage, and the constructed agent message explicitly instructs execution in Chinese without any opt-in or alternative locale. Under the policy, forcing a specific language without user choice can be a locale-policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code defaults the API root to an HTTP endpoint and later sends payload data and a bearer token through requests.post calls. While the module has internal comments and error handling, there is no user-facing warning, confirmation, or disclosure in this code that user/system data and credentials will be transmitted over the network.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

On 500/502 from the dedicated skill endpoint, the code falls back to a general /agent/turn orchestration endpoint and constructs a natural-language instruction asking the agent to execute the skill. This broadens the execution surface from a narrow API to a more general agent interface, which can behave differently, process prompt-like content in payload values, or trigger unintended orchestration behavior; that is more dangerous in this skill because payload fields are converted directly into instruction text.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a coaching skill for cross-border paid ads optimization, but this client also exposes a separate record_outcome capability that posts arbitrary payloads to /v1/agent/outcomes. That is broader than merely invoking the optimization coach and introduces telemetry/effect recording behavior not disclosed in the manifest description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The markdown instructs users to copy a .env file and set TOKENAPI_KEY, but it does not include any warning that this credential is sensitive, should not be committed, shared, or exposed in logs. Because the skill description explicitly involves handling an API key, a brief user-facing warning about secret management is expected under the markdown missing-warning criterion.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency is specified with a lower bound only (requests>=2.31.0), which makes builds non-reproducible and allows installation of different versions over time. This increases supply-chain and maintenance risk because a later incompatible or vulnerable release could be pulled in without review, and it also makes it difficult to verify whether known advisories affect the deployed version.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
requests>=2.31.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

Because requests is not pinned, the manifest does not establish which concrete version will be installed, so the package may resolve to a release affected by one or more known advisories. In a skill that likely performs outbound network calls to cloud services or ad-platform APIs, using an unverifiable HTTP client version increases the risk of credential leakage, TLS/verification issues, or other client-side security flaws depending on the resolved version.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file’s natural-language text is written exclusively in Chinese, including the top-level docstring and function docstrings/comments, without any indication that the skill is region-specific or that users may choose another language. This can violate language/locale policy when a specific language is imposed without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
70% confidence
Finding

The skill's stated purpose is ad optimization coaching, but the implementation also depends on reading TOKENAPI_KEY and TOKENAPI_BASE_URL from the process environment. While common for infrastructure, this is not a direct capability implied by the business purpose described in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.