Back to skill

Security audit

技术宣发助手

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its advertised purpose, but it should go to Review because it installs packages automatically, grants broad network shell access, and can send report-derived prompts to third-party image APIs.

Review before installing, especially for confidential reports. Use --no-image unless you intend to share derived image prompts with a third-party provider, avoid running it on untrusted PDF paths, and prefer a pinned isolated environment over automatic pip installation.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:55
Finding

Shell Command Injection Through an Interpolated PDF Path

Content
View full analysis
" "./output/extracted" ``` ### Technical Analysis The workflow instructs the agent to substitute the user-provided PDF path directly into a shell command. Although the path is enclosed in double quotes, no shell-safe encoding or validation of shell metacharacters is required. A filename containing a double quote can terminate the quoted argument. Subsequent shell operators can then introduce additional commands. Merely checking that the original path exists does not make it safe to interpolate into a shell command. For example, a path containing a sequence conceptually equivalent to: ```text /tmp/report"; id; #.pdf ``` could cause the generated shell command to be interpreted as multiple commands rather than as one Python invocation. The PDF extraction may fail, but the injected command can still execute. The flaw arises in the agent-facing workflow rather than in `extract_pdf.py`, which reads its path from `sys.argv` without invoking a shell. ### Attack Path 1. An attacker creates or supplies a PDF whose path contains a quotation mark and shell-control characters. 2. The attacker invokes the Skill with that path as the first non-option argument. 3. The workflow verifies that the attacker-controlled path exists. 4. The agent substitutes the path into the documented Bash command without shell-safe encoding. 5. The embedded quotation mark terminates the intended argument. 6. The shell interprets the remaining text as additional commands. 7. The injected commands execute with the same operating-system privileges and environment available to the agent. ### Impact Assessment Successful exploitation permits arbitrary command execution under the account running the agent. Depending on that acco ...[truncated 528 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
SKILL.md:50
Finding

Automatic Installation of Unpinned Third-Party Dependencies

Content
View full analysis
/dev/null || pip install -r ${CLAUDE_SKILL_DIR}/scripts/requirements.txt ``` From `scripts/requirements.txt`: ```text # PDF 解析 pdfplumber>=0.10.0 PyMuPDF>=1.23.0 # HTTP 请求 (图片生成 API) requests>=2.31.0 # 图片处理 Pillow>=10.0.0 ``` ### Technical Analysis The Skill automatically invokes `pip install` whenever either PDF dependency cannot be imported. The requirements file specifies only lower version bounds and contains neither exact version pins nor package hashes. Consequently, future invocations can install package versions that did not exist when the Skill was reviewed. Resolution may also select varying transitive dependencies. Python package installation can run build-system or installation-related code, so compromise of an accepted package release or one of its dependencies can result in code execution during installation. The use of the default package index is not itself evidence of an active malicious package. The security issue is that the installation is automatic and not reproducible, while the accepted dependency set is open-ended. ### Attack Path 1. One or more required imports are unavailable in the runtime environment. 2. The dependency check returns a nonzero status. 3. The shell automatically executes `pip install` without requesting separate user approval. 4. Pip resolves the newest versions satisfying the open-ended `>=` constraints, including transitive dependencies. 5. A compromised or unexpectedly changed accepted release is downloaded. 6. Package build or installation code executes with the privileges of the agent account. 7. The installed code is subsequently imported by the PDF extraction or image-generation scripts. ### Impact As ...[truncated 673 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:9
Finding

Unnecessary Unrestricted Curl Permission Violates Least Privilege

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (42)

Tainted flow: 'headers' from os.environ.get (line 201, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_image.py (reported line 83)May include surrounding context.

python
}

    # 创建预测任务
    resp = requests.post(REPLICATE_API_URL, json=payload, headers=headers, timeout=30)
    resp.raise_for_status()
    prediction = resp.json()

Tainted flow: 'headers' from os.environ.get (line 201, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

At this line, an Authorization header containing the Replicate token is sent to a poll URL obtained from network input rather than a constant trusted endpoint. If an attacker can influence that URL through a compromised API response, redirect, or man-in-the-middle in a broken trust environment, the credential could be exfiltrated to an attacker-controlled server.

Content

Scanner excerpt · scripts/generate_image.py (reported line 96)May include surrounding context.

python
waited += 3
        if waited > max_wait:
            raise TimeoutError(f"Image generation timed out after {max_wait}s")
        prediction = requests.get(poll_url, headers=headers, timeout=30).json()

    if prediction["status"] != "succeeded":
        error = prediction.get("error", "Unknown error")

Tainted flow: 'headers' from os.environ.get (line 201, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_image.py (reported line 159)May include surrounding context.

python
"response_format": "url",
    }

    resp = requests.post(OPENAI_API_URL, json=payload, headers=headers, timeout=120)
    resp.raise_for_status()
    result = resp.json()

Tainted flow: 'headers' from os.environ.get (line 201, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_image.py (reported line 214)May include surrounding context.

python
"size": size,
    }

    resp = requests.post(ARK_API_URL, json=payload, headers=headers, timeout=120)
    resp.raise_for_status()
    result = resp.json()

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个面向技术报告的社媒宣传生成器,但给出的代码块是独立的 PDF 提取脚本。它检查 pdfplumber/PyMuPDF 依赖,读取 PDF,提取文本、表格和嵌入图片,推断元数据、摘要、章节和关键指标,最后写出 extracted_content.json 和 figures 目录。虽然这类提取功能可能是上游支撑模块,但就该代码块实际行为而言,核心能力与声明的最终用户功能明显不一致:没有任何 LLM/模板生成社媒内容的逻辑,没有平台适配,没有宣传文案输出,也没有 AI 生成图片功能。因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill makes outbound network calls to multiple third-party APIs, but this capability is not covered by declared permissions in the provided context. In an agent environment, undeclared networking is risky because user content may be transmitted externally without informed consent or policy enforcement.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill makes outbound network calls to multiple third-party APIs, but this capability is not covered by declared permissions in the provided context. In an agent environment, undeclared networking is risky because user content may be transmitted externally without informed consent or policy enforcement.

Content

No source excerpt is available for this finding.

External Model or Provider Selection

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

Skill selects an external model or provider that may use a different account or billing plan than the operator expects. Undisclosed model switches can cause unexpected cost or quota consumption.

Content

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

md
disable-model-invocation: true
allowed-tools: Read Bash(python *) Bash(curl *) Bash(pip *) Glob Grep Write Edit
argument-hint: <pdf_path> [--platform all] [--no-image]
model: opus
effort: high
---

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill accesses API credentials from environment variables without clearly warning users that their local environment will be inspected to decide on external-service behavior. This can surprise users and increase privacy and account-usage risk, especially when the skill may automatically select a provider based on available secrets.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill instructs checking multiple environment variables for third-party image-generation API credentials, expanding credential access beyond the core PDF-processing task. Even if only presence is checked, this normalizes credential discovery and can lead to unintended use of sensitive provider accounts or data transfer to external services without explicit user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill may send report-derived prompts and content to external image-generation services when API keys are present, but the description does not clearly inform users about third-party data transmission. If the PDF contains confidential or unpublished research details, derived prompts could leak sensitive information outside the local environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The language rules require X Thread output to be entirely in English, while other platforms must be entirely in Chinese. This is a natural-language locale restriction presented as mandatory behavior, and the skill does not offer opt-in, override options, or a documented justification for forcing a specific output language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all user-facing content in a single forced language, Chinese, with no indication that the user can opt into another language or that the skill is intended only for a Chinese-language audience. The policy specifically calls for flagging language or locale constraints when they are imposed without user choice or clear justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file presents all user-facing content in a single language and does not indicate that the skill is region-specific or that users can opt into Chinese output. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file presents all guidance exclusively in Chinese, which can amount to a language policy violation when no user opt-in or alternative language option is provided. The document also does not state that it is intended only for a Chinese-language or region-specific audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language docstrings and console messages primarily in Chinese, which imposes a specific language on users without any opt-in or indication that the tool is intended only for a Chinese-speaking or region-specific context. The policy for SQP-3 applies to natural-language content in all file types, including code comments, docstrings, and string literals.

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 · scripts/generate_image.py (reported line 39)May include surrounding context.

python
# Provider: Replicate (Seedream 5.0 Lite)
# =============================================================================

REPLICATE_API_URL = "https://api.replicate.com/v1/predictions"
REPLICATE_MODEL = "bytedance/seedream-5-lite"

# 比例映射: 我们的标准比例 -> Replicate API 接受的比例

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends user-supplied prompts to external image-generation providers but does not present an explicit warning in code or usage text that prompt contents will be shared with third parties. In this skill's context, prompts may derive from proprietary technical reports, making silent external transmission materially more sensitive.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This line transmits prompt payloads to Replicate, an external third-party service. In this skill, prompts may be derived from report content and could contain sensitive or proprietary information, so the external transmission is security-relevant even if intentional.

Content

Scanner excerpt · scripts/generate_image.py (reported line 83)May include surrounding context.

python
}

    # 创建预测任务
    resp = requests.post(REPLICATE_API_URL, json=payload, headers=headers, timeout=30)
    resp.raise_for_status()
    prediction = resp.json()

Tainted flow: 'poll_url' from requests.post (line 88, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
72% confidence
Finding

The polling URL is taken from the initial API response and then requested with the same Authorization header. If that URL were altered to point to an attacker-controlled host, the script could leak the API token to that host and make unintended outbound requests.

Content

Scanner excerpt · scripts/generate_image.py (reported line 96)May include surrounding context.

python
waited += 3
        if waited > max_wait:
            raise TimeoutError(f"Image generation timed out after {max_wait}s")
        prediction = requests.get(poll_url, headers=headers, timeout=30).json()

    if prediction["status"] != "succeeded":
        error = prediction.get("error", "Unknown error")

Tainted flow: 'image_url' from requests.post (line 105, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
81% confidence
Finding

The script downloads a URL returned by the Replicate API without validating the scheme, hostname, or content length/type. If the upstream API, model output, or a compromised provider response returns an unexpected URL, this could enable server-side request forgery to arbitrary hosts or retrieval of maliciously large/unexpected content.

Content

Scanner excerpt · scripts/generate_image.py (reported line 107)May include surrounding context.

python
if isinstance(image_url, list):
        image_url = image_url[0]

    img_data = requests.get(image_url, timeout=60).content
    os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)
    with open(output_path, "wb") as f:
        f.write(img_data)

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 · scripts/generate_image.py (reported line 119)May include surrounding context.

python
# Provider: OpenAI (DALL-E 3)
# =============================================================================

OPENAI_API_URL = "https://api.openai.com/v1/images/generations"

# DALL-E 3 支持的尺寸
OPENAI_SIZES = {

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The OpenAI image-generation request sends user-derived prompt data to an external API. Because this skill processes technical reports for publicity materials, the transmitted prompt may reveal confidential report details if users are not warned or if redaction is not performed.

Content

Scanner excerpt · scripts/generate_image.py (reported line 159)May include surrounding context.

python
"response_format": "url",
    }

    resp = requests.post(OPENAI_API_URL, json=payload, headers=headers, timeout=120)
    resp.raise_for_status()
    result = resp.json()

Tainted flow: 'image_url' from requests.post (line 105, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
81% confidence
Finding

The code trusts the image URL returned by the OpenAI API and fetches it directly. Without URL validation, the script may be abused to make unintended outbound requests or download unsafe content if the response is malformed, compromised, or redirected to an attacker-controlled location.

Content

Scanner excerpt · scripts/generate_image.py (reported line 164)May include surrounding context.

python
result = resp.json()

    image_url = result["data"][0]["url"]
    img_data = requests.get(image_url, timeout=60).content
    os.makedirs(os.path.dirname(output_path) or ".", exist_ok=True)
    with open(output_path, "wb") as f:
        f.write(img_data)

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This line sends prompt data to the Ark external API. The transmission is intentional product behavior, but in a security review of an agent skill it is still a true data-exposure risk because third-party sharing is involved and the input may originate from sensitive technical materials.

Content

Scanner excerpt · scripts/generate_image.py (reported line 214)May include surrounding context.

python
"size": size,
    }

    resp = requests.post(ARK_API_URL, json=payload, headers=headers, timeout=120)
    resp.raise_for_status()
    result = resp.json()