Back to skill

Security audit

Scientific Figure Analysis Pipeline

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent scientific figure analysis workflow that openly uses a third-party vision API, with privacy and dependency cautions but no evidence of hidden or malicious behavior.

Use this skill only on papers and figures you are allowed to send to Moonshot/Kimi. For confidential, unpublished, licensed, patient-related, or proprietary documents, use the text-only/local path or obtain approval first. Install dependencies in a virtual environment, consider pinning versions, avoid optional sudo OCR setup unless needed, and protect the MOONSHOT_API_KEY.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Warning
Location
README.md:40
Finding
Unpinned Third-Party Dependencies Create a Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `README.md:40-48` **Additional Locations**: `SKILL.md:65-74`, `references/kimi-k2.6-vision-api.md:132-136` **Vulnerability Type**: Unpinned and unverifiable third-party dependencies **Risk Level**: Medium ### Complete Code Snippet ```bash pip install pymupdf opencv-python pdfplumber openai ``` Optional system-level installation: ```bash sudo apt install tesseract-ocr ``` The API reference also recommends: ```bash python3 -m pip install 'openai>=1.0' ``` ### Technical Analysis The installation instructions retrieve packages without exact version constraints, package hashes, a lockfile, or a documented trusted package index. The broad `openai>=1.0` constraint is particularly permissive because it automatically accepts future releases that have not been reviewed by the Skill author. Python packages can execute installation and runtime code with the permissions of the user running `pip`. If a selected package release or its dependency chain is compromised, malicious code could execute when the package is installed or imported. The recommendation to invoke `sudo apt install` is legitimate for installing Tesseract and does not by itself constitute privilege escalation. However, system-wide dependency installation exceeds the privileges needed by the document-analysis process itself and should be clearly separated from ordinary Skill execution. No evidence was found that the named packages are currently malicious, that the Skill uses typosquatted package names, or that it configures an untrusted package repository. The finding concerns the absence of reproducible dependency controls. ### Attack Path 1. An attacker compromises a future release of one of the named packages or a transitive dependency. 2. A user follows the documented installation command without reviewing the resolved versions. 3. `pip` downloads the compromised release because no exact version or hash restricts package selection. 4. Mal ...[truncated 994 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Provide a reviewed dependency manifest with exact versions, such as: ```text pymupdf==<reviewed-version> opencv-python==<reviewed-version> pdfplumber==<reviewed-version> openai==<reviewed-version> ``` 2. Generate and publish cryptographic hashes for all direct and transitive dependencies, then require hash verification during installation: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Use a lockfile generated by a reproducible dependency-management tool. 4. Test dependency updates before changing the locked versions. 5. Recommend installation inside a dedicated virtual environment or container running without elevated privileges. 6. Document the expected package index and discourage unreviewed mirrors. 7. Separate optional operating-system setup from Skill execution and explain that the Skill itself does not require continuing administrator privileges. 8. Add automated dependency and vulnerability scanning to the release process. ]]>

other

Warning
Location
README.md:68
Finding
Scientific Figures Are Transmitted to an External AI Provider Without a Mandatory Privacy Gate<![CDATA[ ## Vulnerability Details **File Location**: `README.md:68-93` **Additional Locations**: `SKILL.md:151-166`, `references/kimi-k2.6-vision-api.md:21-49`, `references/kimi-k2.6-vision-api.md:63-85` **Vulnerability Type**: External disclosure of potentially confidential document content **Risk Level**: Medium ### Complete Code Snippet ```python client = OpenAI( api_key=os.environ.get("MOONSHOT_API_KEY"), base_url="https://api.moonshot.cn/v1", ) with open("figures_output/page03_img00.jpeg", "rb") as f: image_data = f.read() ext = "jpeg" image_url = f"data:image/{ext};base64,{base64.b64encode(image_data).decode('utf-8')}" completion = client.chat.completions.create( model="kimi-k2.6", messages=[{ "role": "user", "content": [ {"type": "image_url", "image_url": {"url": image_url}}, {"type": "text", "text": "Please describe this scientific figure, including all visible values, labels, and trends."}, ], }], extra_body={"thinking": {"type": "disabled"}}, max_tokens=4096, ) print(completion.choices[0].message.content) ``` ### Technical Analysis The workflow reads an extracted figure from local storage, converts the complete image bytes into a base64 data URI, and submits that data through the OpenAI-compatible client configured for `https://api.moonshot.cn/v1`. Base64 is an encoding mechanism, not encryption. It does not protect the image from the API provider. The transport endpoint uses HTTPS, but the remote service necessarily receives the decoded image content to perform visual analysis. This transmission is directly related to the declared vision-analysis functionality and is openly documented. Therefore, the flagged base64 behavior is not a covert exfiltration channel, hidden obfuscation mechanism, or unrelated privilege request. Reading the selected image and connecting to the declared vision provider are functionally necessary when the user chooses the external visi ...[truncated 2428 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit confirmation before transmitting any document content to an external provider. 2. Display the exact destination hostname and identify which files or figures will be uploaded. 3. Make local or text-only processing the default for documents that have not been classified. 4. Add a confidential-data warning covering unpublished research, protected health information, personally identifiable information, and proprietary content. 5. Provide a mandatory data-classification step, such as: - Public: external processing permitted. - Internal: require organizational approval. - Confidential or regulated: local processing only unless a suitable provider agreement exists. 6. Allow users to preview and approve each image before transmission. 7. Crop or redact identifiers and unrelated panels before upload, and submit only the minimum content required for analysis. 8. Document the provider's retention, deletion, training-use, geographic-processing, and subprocessors policies. 9. Support a configurable provider endpoint so organizations can use an approved private deployment. 10. Avoid recording data URIs, request bodies, or API keys in application logs. 11. Validate file type and impose size limits before encoding to reduce accidental oversized submissions and denial-of-service risk. 12. Clearly state that base64 does not anonymize or encrypt the underlying figure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (16)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
Optional (OCR):
```bash
sudo apt install tesseract-ocr
```

## Quick Start
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example clearly base64-encodes extracted figure images and sends them to a third-party endpoint (api.moonshot.cn), but the README does not prominently warn users that paper content, figures, and potentially sensitive text are transmitted off-host for analysis. In scientific and enterprise contexts, PDFs may contain unpublished data, licensed material, or regulated information, so lack of disclosure can lead to unintended data exfiltration and policy violations.

External Transmission

Medium
Category
Data Exfiltration
Content
# 2. Vision analysis with Kimi K2.6
client = OpenAI(
    api_key=os.environ.get("MOONSHOT_API_KEY"),
    base_url="https://api.moonshot.cn/v1",
)

with open("figures_output/page03_img00.jpeg", "rb") as f:
Confidence
96% confidence
Finding
The skill is designed to send extracted figure data to an external API endpoint, which is a real security-relevant behavior because it transmits potentially sensitive research content outside the local environment. While external API use is expected for a hosted multimodal model, the danger depends on the sensitivity of analyzed PDFs and whether users understand and approve the transmission.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill description and operational instructions are presented entirely in Chinese, indicating a fixed language/locale expectation for using the skill. The file does not offer user opt-in or alternative language support, nor does it document that the skill is intentionally restricted to a Chinese-speaking context.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
| pdfplumber | 表格/文本提取 | `pip install pdfplumber` |
| OpenCV | 图像处理/分割 | `pip install opencv-python` |
| LayoutParser | 布局检测 | `pip install layoutparser` |
| Tesseract OCR | 图片文字识别 | `sudo apt install tesseract-ocr` |
| YOLO | 布局检测(GPU加速) | — |

#### PyMuPDF 提取流水线(已验证)
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly routes scientific figures and possibly extracted caption/body text to a third-party vision API, but it does not warn users that document content leaves the local environment. This creates a real confidentiality and privacy risk, especially for unpublished manuscripts, licensed PDFs, or sensitive research data that users may assume are processed locally.

External Transmission

Medium
Category
Data Exfiltration
Content
```
核心参数:
  model: "kimi-k2.6"
  base_url: "https://api.moonshot.cn/v1"
  auth: MOONSHOT_API_KEY 环境变量
  图片: base64 data URI
  思考: extra_body={"thinking": {"type": "disabled"}}
Confidence
96% confidence
Finding
The skill is designed to send base64-encoded images and related analysis inputs to an external endpoint at api.moonshot.cn. In the context of scientific paper analysis, this can expose proprietary figures, unpublished results, or copyrighted content to a third-party service, making the external transmission materially risky when not tightly controlled and disclosed.

Ae4

Medium
Category
analysis-evasion
Confidence
80% confidence
Finding
Suspicious Unicode normalization or mixed-script content

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The case study documents a 'text-only fallback' but still prescribes calling Kimi vision for supplemental analysis, which conflicts with the skill's declared restriction against pure-text reading workflows. This can cause policy drift: an agent may invoke external multimodal analysis in scenarios the manifest says should be rejected, expanding data exposure and bypassing intended scope controls.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The document instructs users to send scientific figures to a third-party vision API but does not clearly warn that image contents are transmitted off-system for external processing. In this skill context, figures extracted from papers may contain unpublished data, licensed material, or sensitive annotations, so the omission can lead to unintentional data disclosure.

External Transmission

Medium
Category
Data Exfiltration
Content
| 属性 | 值 |
|------|-----|
| **模型** | `kimi-k2.6` |
| **API Base** | `https://api.moonshot.cn/v1` |
| **兼容性** | 完全兼容 OpenAI SDK |
| **视觉能力** | 图片 + 视频 |
| **上下文** | 256K tokens |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| 属性 | 值 |
|------|-----|
| **模型** | `kimi-k2.6` |
| **API Base** | `https://api.moonshot.cn/v1` |
| **兼容性** | 完全兼容 OpenAI SDK |
| **视觉能力** | 图片 + 视频 |
| **上下文** | 256K tokens |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
| 属性 | 值 |
|------|-----|
| **模型** | `kimi-k2.6` |
| **API Base** | `https://api.moonshot.cn/v1` |
| **兼容性** | 完全兼容 OpenAI SDK |
| **视觉能力** | 图片 + 视频 |
| **上下文** | 256K tokens |
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Natural-Language Policy Violations

Low
Confidence
98% confidence
Finding
The example prompt is written in Chinese and instructs the model in that language, with no indication that language is configurable or user-selected. This can violate language/locale policy expectations when a skill implicitly forces a specific language without opt-in.

Description-Behavior Mismatch

Low
Confidence
77% confidence
Finding
The document goes beyond figure analysis into structured knowledge extraction and automated literature mining from full text, materially broadening the skill's operational scope. That expansion increases the chance an agent processes more document content than intended, potentially sending unnecessary full-text scientific PDFs to external models or acting on tasks outside the reviewed threat model.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The API key section explains how to export and test credentials but does not warn against leaking keys via shell history, shared terminals, logs, screenshots, or committed config files. This increases the chance of accidental credential exposure, which could allow unauthorized API usage and billing abuse.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
references/kimi-k2.6-vision-api.md:94