Back to skill

Security audit

Yufluent Clawhub Publish Yufluentcn Comp Scrape

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate cloud competitor-analysis skill, but it can upload sensitive business data and an API token to a configurable endpoint without enough transport or file-scope safeguards.

Review before installing. Use this only for data you intend to send to Yufluent, keep TOKENAPI_KEY private, set TOKENAPI_BASE_URL only to a trusted HTTPS service unless you are deliberately using localhost for development, and check every file path passed to the CLI so unrelated secrets or private files are not uploaded.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
scripts/yufluent_api.py:213
Finding

Bearer Token and User Dataset Can Be Transmitted Over Plaintext HTTP

Content
View full analysis
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" ``` The API key is placed in a bearer authorization header: ```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"} ``` The bearer token and JSON body are then submitted to the configured URL without validating its scheme: ```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) ``` The affected call passes the complete skill payload: ```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) except requests.RequestException as exc: raise YufluentApiError(f"Request failed: {exc}") from exc ``` The insecure HTTP configuration is also presented in project documentation: ```powershell $env:TOKENAPI_BASE_URL = "http://localhost:8080/v1" ``` ### Technical Analysis The skill legitimately requires network access because its decl ...[truncated 2667 chars]
Remediation
View remediation
None: parsed = urlparse(url) loopback_hosts = {"localhost", "127.0.0.1", "::1"} if parsed.scheme == "https": return if parsed.scheme == "http" and parsed.hostname in loopback_hosts: return raise ValueError("TOKENAPI_BASE_URL must use HTTPS for non-loopback endpoints") ``` 2. Prefer an HTTPS production URL as the documented/default cloud endpoint. If local HTTP is required for development, make it an explicit development-only opt-in. 3. Disable cross-origin redirects for authenticated POST requests, or validate every redirect destination before forwarding credentials. 4. Never forward the bearer token to a host different from the explicitly approved API host. 5. Add a clear pre-upload disclosure stating that the complete competitor dataset and optional listing are transmitted to the configured service. 6. Add automated tests proving that: - Remote HTTP endpoints are rejected. - Loopback exceptions are narrowly scoped. - Credentials are not forwarded across host-changing redirects. 7. Encourage token rotation and provide narrowly scoped, short-lived API credentials where supported. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/cloud_cli.py:13
Finding

Unrestricted File Argument Allows Upload of Any User-Readable File

Content
View full analysis
str: raw = (value or "").strip() if not raw: return "" path = Path(raw) if path.is_file(): return path.read_text(encoding="utf-8") return raw ``` The returned content is inserted directly into the cloud request payload: ```python payload: dict = { "platform": args.platform, "lang": args.lang, "our_product": args.our_product.strip(), "competitor_data": read_text_arg(args.competitor_data), "source_type": args.source_type, } if args.our_listing: payload["our_listing"] = read_text_arg(args.our_listing) ``` The full payload is then transmitted through `run_skill`: ```python try: data = run_skill(SKILL_API_ID, payload, timeout=180.0) except YufluentApiError as exc: print(f"Error: {exc}", file=sys.stderr) return 1 if exc.status != 402 else 2 ``` ### Technical Analysis The declared functionality requires reading user-selected CSV, text, or authorized API snapshot files. Local file access is therefore necessary, but the implementation grants a broader effective capability than the task requires. `read_text_arg` treats every string naming an existing file as a file input. It does not enforce the documented `.csv`, `.txt`, or snapshot JSON formats, does not constrain files to an approved workspace, and does not ask for upload confirmation. Consequently, any UTF-8 file readable by the process can become `competitor_data` or `our_listing` and be uploaded to the configured API. This becomes especially relevant when an AI agent or automation constructs command-line arguments on the user's behalf. A manipulated instructi ...[truncated 2048 chars]
Remediation
View remediation
Path: root = root.resolve(strict=True) path = Path(value).expanduser().resolve(strict=True) if not path.is_file(): raise ValueError("Input must be a regular file") if not path.is_relative_to(root): raise ValueError("Input file is outside the approved workspace") return path ``` 4. Reject symlinks where they are unnecessary, or validate the resolved target rather than only the user-supplied path. 5. Enforce a conservative maximum file size before reading the file. 6. Validate CSV or JSON structure before upload and reject content that does not match the selected source type. 7. Before network transmission, display the resolved path, destination hostname, and byte count, and require explicit confirmation in interactive or agent-mediated workflows. 8. Redact known credential patterns where feasible and warn users not to upload secrets or unrelated personal data. 9. Document server-side retention, logging, and deletion behavior for uploaded datasets. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (19)

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

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The client allows the destination base URL to be sourced from TOKENAPI_BASE_URL and then sends both the request payload and Bearer API key to that computed URL. If an attacker can influence the environment or configuration, this becomes credential exfiltration and arbitrary outbound data transmission to an attacker-controlled endpoint, which is especially sensitive because this skill handles uploaded CSV/API snapshot data.

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 12)May include surrounding context.

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

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The naming and invocation of a remote comp-scrape capability conflicts with repeated claims that the skill is not a scraper, creating ambiguity about whether remote collection or scraping occurs server-side. This kind of branding and behavior inconsistency is risky because it can conceal prohibited data acquisition or unauthorized third-party requests behind a benign-looking local wrapper.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The naming and invocation of a remote comp-scrape capability conflicts with repeated claims that the skill is not a scraper, creating ambiguity about whether remote collection or scraping occurs server-side. This kind of branding and behavior inconsistency is risky because it can conceal prohibited data acquisition or unauthorized third-party requests behind a benign-looking local wrapper.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The naming and invocation of a remote comp-scrape capability conflicts with repeated claims that the skill is not a scraper, creating ambiguity about whether remote collection or scraping occurs server-side. This kind of branding and behavior inconsistency is risky because it can conceal prohibited data acquisition or unauthorized third-party requests behind a benign-looking local wrapper.

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 28)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
83% confidence
Finding

The skill advertises code-relevant capabilities via metadata (env install requirements and a cloud API workflow) but does not declare explicit tool restrictions such as permitted network or filesystem access. In agent environments, missing scope declarations can let a skill exercise broader file, environment, and network access than users expect, increasing the risk of data exfiltration or unsafe side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger phrases include broad, ordinary-user language like '这些竞品帮我分析' and 'competitor batch', which can cause accidental invocation in contexts where the user did not intend to send files or data to this external service. Overbroad triggers are dangerous in agent ecosystems because they increase the chance of surprising tool activation and unintended data disclosure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script reads potentially sensitive competitor CSV exports and product/listing content, then sends them to a remote cloud API via run_skill() without any explicit runtime warning, confirmation, or consent gate. In this skill's context, the cloud execution model is mentioned in metadata, but the code itself provides no in-band notice to the operator, increasing the risk of unintended disclosure of proprietary business data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Multiple user-facing strings and the generated agent prompt are written only in Chinese, including an instruction that shapes downstream interaction. There is no indication that the skill is region-specific or that users can opt into another language, which creates a locale policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The docstring says the fallback path uses /agent/turn as an in-process run_skill equivalent, implying actual skill execution. But _normalize_agent_turn_response explicitly accepts type == "message" and returns it as a fallback result with _agent_turn_fallback markers at L116-L130, while only rejecting empty messages, so the fallback may succeed without the skill actually running.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

This code posts user-supplied payload data to remote endpoints using an Authorization bearer token, but there is no confirmation prompt, print/log disclosure, or comment warning that request contents are sent to a cloud service. The same pattern appears in the main skill execution and outcome-recording paths, so users invoking the skill from code may not be explicitly informed that their data leaves the local environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a skill for bulk competitor comparison analysis based on uploaded CSV exports or authorized API snapshots, executed via Yufluent's cloud harness. This file additionally implements record_outcome, which posts arbitrary payloads to /v1/agent/outcomes to register harness outcomes; that telemetry/reporting capability is not part of the stated end-user analysis purpose and is not justified by the manifest description.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
95% confidence
Finding

The dependency is specified as requests>=2.31.0, which allows any future major or minor release and makes builds non-reproducible. This can unintentionally introduce vulnerable or breaking versions into the skill at install time, which is a real supply-chain risk even though it is indirect and low severity in this file alone.

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
89% confidence
Finding

Because the manifest does not pin requests to a specific version, it is impossible to verify whether installation will resolve to a release affected by one of the known advisories. In a cloud-executed scraping/comparison skill that likely performs outbound HTTP requests, use of a vulnerable requests version could increase exposure to credential leakage, TLS/request validation issues, or other client-side request handling 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
89% confidence
Finding

The module docstring and function docstrings/comments are written exclusively in Chinese, which imposes a specific language/locale on maintainers or users reading skill guidance without offering a language choice. The stated policy calls for flagging language or locale constraints unless they are optional or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language strings in the module and function docstrings are written only in Chinese, which imposes a specific language on users or maintainers without offering any language choice or documenting a justified locale restriction. This matches the language/locale policy violation category because the file provides no opt-in or alternative locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The --lang argument defaults to zh, which imposes a specific language choice when the user does not explicitly select one. This is a natural-language policy concern because the skill does not prompt for or otherwise obtain user opt-in before choosing the locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The code reads TOKENAPI_KEY from the environment to authenticate requests, which is a sensitive credential access path. Although the metadata declares the environment variable requirement, this Python file itself does not include a warning or disclosure around credential use or transmission.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.