Back to skill

Security audit

ynu-papergraphgeneration-qclaw

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its paper-diagram purpose, but it includes unsafe generated-code execution and sends manuscript content to configurable external services without strong user controls.

Review before installing. Use this only with papers you are allowed to send to the configured LLM and image services, verify the API endpoints, and avoid invoking the generated-code chart execution path unless it is sandboxed. The skill should be tightened with explicit upload consent, endpoint validation, bounded image downloads, and replacement of executable chart code with structured plotting data.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/chart_generator.py:111
Finding

Unsandboxed Execution of Generated Python Chart Code

Content
View full analysis
tuple: """ Execute generated Matplotlib code and return (success, output_path, error). """ import os, sys, tempfile try: output_dir = os.path.join( os.path.expanduser("~"), ".qclaw", "workspace", "outputs" ) os.makedirs(output_dir, exist_ok=True) # Write code into a temporary file and execute it code_path = os.path.join(output_dir, "_temp_chart.py") with open(code_path, "w", encoding="utf-8") as f: f.write(code) import subprocess result = subprocess.run( ["python", code_path], capture_output=True, text=True, timeout=60, cwd=output_dir ) os.remove(code_path) ``` ### Technical Analysis The function accepts an unrestricted string, writes it as a Python program, and executes it with the normal privileges of the Skill process. No validation limits the program to Matplotlib operations. There is no AST allowlist, import restriction, filesystem isolation, network isolation, operating-system sandbox, or dedicated low-privilege account. The surrounding module is designed to ask an LLM to produce chart code. If an integration passes an LLM response to this executor, malicious content in a paper or a compromised model response can become executable Python. A timeout only limits runtime; it does not prevent immediate file access, command execution, network requests, credential theft, or process creation. Repository-wide reference analysis did not identify a current call from the primary `draw.py` workflow. The vulnerability is therefore a packaged, callable capability rather than an automatically reached path in the ...[truncated 1794 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/draw.py:97
Finding

Potentially Confidential Paper Content Is Sent to Configurable External Endpoints Without Explicit Upload Consent

Content
View full analysis
MAX_CHARS: # Prefer the beginning (abstract and introduction) and ending head = raw_text[:6000] tail = raw_text[-6000:] paper_body = ( head + "\n...\n[Middle content truncated due to length limit]...\n" + tail ) system_prompt = textwrap.dedent("""\ You are an academic-paper visualization consultant. ... """).strip() user_prompt = f"Analyze the following paper text and output a JSON array:\n\n{paper_body}" print("\nCalling the LLM to analyze the paper structure...") try: response = call_llm( prompt=f"{system_prompt}\n\n{user_prompt}", api_url=api_url, api_key=api_key, model=model, timeout=120, ) except Exception as e: print(f"LLM call failed: {e}; falling back to keyword scanning") return scan_paper_fallback(raw_text) ``` The request implementation sends the prompt in an authenticated HTTP POST: ```python payload = json.dumps({ "model": model, "messages": [{"role": "user", "content": prompt}], "temperature": 0.2, "max_tokens": 2048, }).encode("utf-8") req = urllib.request.Request( api_url, data=payload, headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", }, method="POST", ) with urllib.request.urlopen(req, timeout=timeout) as resp: data = json.loads(resp.read().decode("utf-8")) ``` ### Technical Analysis The Skill transmits up to 12,000 characters from an input paper to a remote LLM endpoint. For long documents, it sends the first 6,000 and last 6,000 characters, which are likely to contain abstracts, author information, c ...[truncated 2146 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/image_generator.py:142
Finding

Unvalidated API-Supplied Image URL Enables SSRF and Unbounded File Download

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (51)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a broad end-to-end paper visualization engine with multimodal paper understanding, multiple scholarly figure types, caption generation, self-verification, and a PDF→Text tool. The supplied code does not implement those core behaviors. Instead, it focuses narrowly on one subfeature: prompting for Matplotlib chart code from already-structured experimental data and then executing that code to produce PNG charts. While 'Matplotlib result plotting' is explicitly mentioned in the description and does align with part of the code, the chunk lacks most of the stated primary functionality. Additionally, the code executes generated Python in a subprocess, which is a meaningful capability not reflected in the description. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a broad end-to-end paper visualization system with document ingestion, content analysis, multiple output formats, verification, and plotting. The supplied code does not implement those functions. It only generates prompts and calls a remote image-generation API to create and download an image. While image generation for academic diagrams is one subset of the declared purpose, the actual code is substantially narrower and also relies on external network/API access and credentials, which are not declared in permissions. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code is a narrow routing component, not the described end-to-end visualization engine. Its actual functions are: define figure categories, classify one category via an LLM call, and construct a JSON-oriented extraction prompt targeting specific sections of paper text. That is consistent with a submodule for figure-type selection and content extraction, but materially short of the declared description, which claims automatic academic illustration generation, PDF extraction, self-checking, caption export, and precise plotting. No undeclared dangerous behavior is visible, but the declared description significantly overstates what this code chunk actually does.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/chart_generator.py (reported line 54)May include surrounding context.

python
请直接输出完整的 Python 代码:
"""
    return prompt


def generate_line_chart_code(extraction_result: str) -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/chart_generator.py (reported line 76)May include surrounding context.

python
请直接输出完整的 Python 代码:
"""
    return prompt


def generate_line_chart_code(extraction_result: str) -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

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

python
请直接输出完整的 Python 代码:
"""
    return prompt


def generate_line_chart_code(extraction_result: str) -> str:

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This module goes beyond preparing chart code and actually runs arbitrary generated Python, which creates an unnecessary code-execution boundary for a diagramming skill. In this context, paper text or extracted experimental data can contain adversarial instructions that steer the model to emit payloads, leading to arbitrary command execution when execute_chart_code runs them.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
90% confidence
Finding

The function directly interpolates untrusted extraction_result content into a high-privilege LLM prompt and returns it for downstream use. If extraction_result contains prompt-injection text or Mermaid-breaking payloads from a PDF/paper, it can override instructions, induce unsafe output, or propagate malicious content into later rendering stages.

Content

Scanner excerpt · scripts/topology_extractor.py (reported line 36)May include surrounding context.

python
## 提取的信息
{extraction_result}
"""
    return prompt


def build_architecture_topology(extraction_result: str, style: str = "academic") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
91% confidence
Finding

This architecture prompt embeds attacker-controlled extraction_result directly into the instruction context, creating a classic prompt-injection surface. In this skill, papers/PDFs are external inputs, so adversarial content can manipulate the model into generating malformed Mermaid, hidden content, or instructions that may affect downstream consumers or renderers.

Content

Scanner excerpt · scripts/topology_extractor.py (reported line 71)May include surrounding context.

python
请直接输出 Mermaid 代码:
"""
    return prompt


def build_flowchart_topology(extraction_result: str, style: str = "academic") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
91% confidence
Finding

Returning a prompt built from raw algorithm-step text allows any hostile text in extraction_result to become part of the LLM's effective instructions. Because this skill processes arbitrary academic documents, that context makes the issue more dangerous: malicious papers can intentionally seed prompt-injection strings that alter generated diagrams or poison subsequent automation.

Content

Scanner excerpt · scripts/topology_extractor.py (reported line 94)May include surrounding context.

python
请直接输出 Mermaid 代码:
"""
    return prompt


def build_environment_topology(extraction_result: str, style: str = "academic") -> str:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
90% confidence
Finding

The environment-topology builder also returns a prompt containing untrusted extracted text verbatim, enabling instruction injection and output manipulation. While the code itself does not execute Mermaid, untrusted diagram content may still impact downstream LLM behavior, break parsers, or feed unsafe markup into render/export pipelines.

Content

Scanner excerpt · scripts/topology_extractor.py (reported line 120)May include surrounding context.

python
请直接输出 Mermaid 代码:
"""
    return prompt


def convert_to_topology(figure_type: str, extraction_result: str, style: str = "academic") -> str:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
82% confidence
Finding

The --skip-check option disables the self-verification step intended to compare generated topology against the source paper. While not an exploit primitive by itself, it weakens an integrity control and can increase the risk of producing inaccurate or misleading figures from untrusted or ambiguous input, especially if later consumed as authoritative academic content.

Content

Scanner excerpt · skill.md (reported line 106)May include surrounding context.

md
| `--api-url` | 生图 API 地址 | 环境变量 |
| `--api-key` | 生图 API 密钥 | 环境变量 |
| `--style` | 学术风格: `cvpr` `neurips` `icml` `nature` | `cvpr` |
| `--skip-check` | 跳过自校核 | False |
| `--section-ref` | 对应论文章节(如 `Section 3.1`) | — |

### 环境变量

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README describes sending user-supplied paper text through OpenClaw and then to external image-generation services, but it does not warn users that their content may leave the local environment. For research papers, this can expose unpublished methods, proprietary data, or confidential text to third-party processors without informed consent, creating a real confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow explicitly says it generates a 'pure English Prompt,' which imposes a language constraint. There is no indication that users can opt into this behavior, choose another language, or that English is a necessary documented requirement for a region- or tool-specific reason.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module-level documentation presents this file as a code-generation path for drawing result figures, emphasizing conversion of data into Matplotlib code. However, the file also contains an execution path that persists code to disk, launches a Python subprocess, and searches for generated image files, which is broader than the documented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The natural-language prompt hard-codes a language policy by requiring English labels and stating that absolutely no Chinese characters may appear. This is a locale/language constraint presented as mandatory behavior, with no opt-in or user choice, which fits the language policy violation category.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This prompt requires that all text be in English and prohibits Chinese characters, imposing a fixed language choice. Because no user selection or justified locale limitation is provided, it constitutes 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
88% confidence
Finding

The instruction '所有文字英文' requires a specific output language for chart text. Since the file does not offer user opt-in or explain a justified regional/compliance need, this is a language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module writes generated code to disk and executes it without any user-facing warning, approval, or safety gate. While the primary risk is still arbitrary code execution, the lack of confirmation materially increases exploitability because untrusted model output can be run automatically and silently.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

The function executes dynamically generated Python code by writing it to disk and invoking a new Python interpreter on it. Because the generated code is derived from prompt output that incorporates extraction_result, any prompt-injection or malformed model output can become arbitrary code execution with the current user's filesystem and network privileges.

Content

Scanner excerpt · scripts/chart_generator.py (reported line 127)May include surrounding context.

python
f.write(code)

        import subprocess
        result = subprocess.run(
            ["python", code_path],
            capture_output=True,
            text=True,

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/draw.py (reported line 36)May include surrounding context.

python
if api_url is None:
        api_url = os.environ.get(
            "BANANA2_API_URL",
            "https://api.acedata.cloud/nano-banana/chat"
        )
    if api_key is None:
        api_key = os.environ.get("BANANA2_API_KEY",

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/draw.py (reported line 543)May include surrounding context.

python
if api_url is None:
        api_url = os.environ.get(
            "BANANA2_API_URL",
            "https://api.acedata.cloud/nano-banana/chat"
        )
    if api_key is None:
        api_key = os.environ.get("BANANA2_API_KEY",

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/draw.py (reported line 616)May include surrounding context.

python
if api_url is None:
        api_url = os.environ.get(
            "BANANA2_API_URL",
            "https://api.acedata.cloud/nano-banana/chat"
        )
    if api_key is None:
        api_key = os.environ.get("BANANA2_API_KEY",

Ssd 1

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code places both control instructions and untrusted document text into a single user message, so the remote LLM has no reliable boundary between task definition and attacker-controlled content. This is a classic semantic prompt injection pattern: malicious text embedded in a paper can override or distort the intended analysis and contaminate subsequent automated actions.

Content

No source excerpt is available for this finding.