Back to skill

Security audit

腾讯云混元文生图像生成

Security checks for vulnerabilities and agentic risk

Overview

This looks like a real Tencent Cloud image-generation skill, but its setup and data-handling guidance are under-contained for a tool that uses cloud credentials and sends prompts and image URLs to a third party.

Install only if you are comfortable sending prompts and any reference image URLs to Tencent Cloud and using Tencent Cloud credentials on this machine. Prefer a dedicated virtual environment, avoid the documented --break-system-packages fallback, pin dependencies, and use narrowly scoped Tencent Cloud credentials that can be rotated.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:52
Finding

Unpinned Dependency Installation with Unsafe System-Python Fallback

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 52–68
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code Snippet:

bash
cd ~/.claude/skills/huny-img
python3 -m venv ~/.pyenv/versions/py312-huny-img
source ~/.pyenv/versions/py312-huny-img/bin/activate
pip install python-dotenv
cp .env.example .env
# Edit .env and provide TENCENTCLOUD_SECRET_ID and TENCENTCLOUD_SECRET_KEY
bash
pip install python-dotenv --break-system-packages
python3 ./scripts/hunyuan3-text-to-image.py ...

Technical Analysis

The setup instructions install python-dotenv without pinning an audited version or verifying an integrity hash. Consequently, the package contents resolved at installation time can differ from those reviewed during this audit.

The fallback command uses --break-system-packages, bypassing Python's externally managed environment protections and allowing the dependency to be installed into the system Python environment. This expands the potential effect of a compromised package beyond an isolated virtual environment.

The installed package is imported by scripts/hunyuan3-text-to-image.py before Tencent Cloud credentials are loaded. Python executes module initialization code during import, so a malicious or compromised dependency could access process environment variables, local files available to the user, and network resources.

The named python-dotenv package is not itself shown to be malicious. The vulnerability is the mutable, unverified dependency resolution process and the unsafe system-environment fallback.

Attack Path

  1. An attacker compromises a package release, package index, configured mirror, DNS/network dependency path, or another relevant package-resolution component.
  2. A user follows the documented setup instructions and runs the unpinned pip install python-dotenv command.
  3. Pip installs the attacker-co ...[truncated 1449 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin python-dotenv to a specifically reviewed version in a requirements file.

  2. Record and enforce cryptographic hashes:

    text
    python-dotenv==AUDITED_VERSION --hash=sha256:EXPECTED_PACKAGE_HASH
    

    Install it with:

    bash
    python3 -m pip install --require-hashes -r requirements.txt
    
  3. Generate and review a lock file so dependency updates occur only through an explicit audit process.

  4. Require installation inside a dedicated virtual environment.

  5. Remove the --break-system-packages fallback and fail safely when the isolated environment is unavailable.

  6. Use a trusted, explicitly configured package index and avoid unverified mirrors.

  7. Run dependency vulnerability and provenance checks as part of release validation.

  8. Restrict Tencent Cloud credentials to only the API actions and resources required for image generation, rotate them regularly, and avoid exposing them to unrelated processes.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (8)

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

python3 -m venv ~/.pyenv/versions/py312-huny-img source ~/.pyenv/versions/py312-huny-img/bin/activate pip install python-dotenv cp .env.example .env

编辑 .env,填入 TENCENTCLOUD_SECRET_ID 和 TENCENTCLOUD_SECRET_KEY

text

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 · scripts/hunyuan3-text-to-image.py (reported line 225)May include surrounding context.

python
python3 -m venv ~/.pyenv/versions/py312-huny-img
source ~/.pyenv/versions/py312-huny-img/bin/activate
pip install python-dotenv
cp .env.example .env
# 编辑 .env,填入 TENCENTCLOUD_SECRET_ID 和 TENCENTCLOUD_SECRET_KEY
```

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The script makes outbound network requests to Tencent Cloud APIs and accepts user-supplied image URLs that are sent to the remote service, but this network capability is not covered by declared permissions. In an agent skill, undeclared network access is security-relevant because it enables data egress and remote interaction outside an auditable permission boundary.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The script makes outbound network requests to Tencent Cloud APIs and accepts user-supplied image URLs that are sent to the remote service, but this network capability is not covered by declared permissions. In an agent skill, undeclared network access is security-relevant because it enables data egress and remote interaction outside an auditable permission boundary.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger description is broad enough that the skill may activate for loosely related user requests involving Tencent/Hunyuan image generation. In an agent environment, overbroad invocation can cause unintended external API calls and unnecessary disclosure of user prompts or image URLs to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill explains functionality but does not prominently warn that prompts and reference image URLs are transmitted to Tencent Cloud for processing. This can lead users or invoking agents to send sensitive text, private URLs, or internal resource links to an external service without informed consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

模块说明和命令行描述都将该脚本定位为“文生图”,但代码在 submit_job 中接受 images 参数并在命令行暴露 --images,实际会向 SubmitTextToImageJob 传入参考图列表以执行图生图/参考图生成。虽然技能总描述提到同时支持文生图和图生图,但该具体文件的自述与实际行为不一致。

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

ArgumentParser 的 description 写的是“腾讯混元生图 3.0 - 文生图”,但同一帮助文本又提供了 --images 参考图 URL 列表并给出带参考图的示例,这意味着代码行为超出“仅文生图”的表述。这里不是单纯文档不全,而是“仅文生图”的说明与实际支持参考图生成相冲突。

Content

No source excerpt is available for this finding.