Back to skill

Security audit

software-copyright

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but its helper script can automatically run an unpinned package install without clear user approval.

Review before installing or running this skill. Its document templates are purpose-aligned for Chinese software copyright filings, but run the generator only in an isolated environment or after removing the automatic pip install behavior and installing reviewed dependencies explicitly.

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
scripts/generate_docs.py:14
Finding

Unpinned Third-Party Package Installation at Runtime

Content
View full analysis

Vulnerability Details

File Location: scripts/generate_docs.py, lines 14–22
Vulnerability Type: Unpinned runtime dependency installation
Risk Level: Medium

python
try:
    from docx import Document
    from docx.shared import Inches, Pt, Cm
    from docx.enum.text import WD_ALIGN_PARAGRAPH
    from docx.enum.table import WD_TABLE_ALIGNMENT
except ImportError:
    print("Error: python-docx not installed. Installing...")
    os.system("pip install python-docx")
    from docx import Document
    from docx.shared import Inches, Pt, Cm
    from docx.enum.text import WD_ALIGN_PARAGRAPH
    from docx.enum.table import WD_TABLE_ALIGNMENT

Technical Analysis

If any import in the try block raises ImportError, the script automatically invokes a shell to install python-docx. The dependency is not pinned to an audited version, verified with cryptographic hashes, or installed from a trusted, explicitly configured source. The installation also occurs without explicit user approval or environment isolation.

Python package installation can execute package-controlled build and installation logic. Consequently, compromise of the package, one of its transitive dependencies, or the configured package index could result in attacker-controlled code execution. The broad ImportError handler may also initiate installation when python-docx is already present but an internal import fails for another reason.

The command itself contains no user-controlled interpolation, so direct shell command injection is not established. The confirmed risk is unsafe supply-chain resolution and execution.

Attack Path

  1. An Agent or user executes scripts/generate_docs.py in an environment where one of the guarded imports raises ImportError.
  2. The exception handler executes pip install python-docx through os.system.
  3. Pip resolves an unpinned package and its dependencies using the environment's configured index, mirrors, proxy, and trust settings.
  4. A ...[truncated 943 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic dependency installation from application runtime code. On a missing dependency, terminate with a clear error explaining the separate installation procedure.
  2. Declare python-docx and all required transitive dependencies in a lockfile or requirements file using reviewed, exact versions.
  3. Use cryptographic package hashes and enforce them during installation, such as with pip install --require-hashes -r requirements.txt.
  4. Perform dependency installation as an explicit setup step in an isolated virtual environment rather than modifying the Agent's global Python environment.
  5. Configure an approved HTTPS package index or internal artifact repository and disable untrusted extra indexes.
  6. Run dependency vulnerability and integrity checks as part of the release process.
  7. Catch only the specific missing-module condition if graceful handling is required; do not treat every ImportError inside the import block as proof that installation is necessary.
  8. Avoid shell invocation. Administrative setup tooling should use the active interpreter explicitly, for example sys.executable -m pip, with a fixed argument list and only after user approval.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

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

md
---
AIGC:
    ContentProducer: Minimax Agent AI
    ContentPropagator: Minimax Agent AI
    Label: AIGC
    ProduceID: "00000000000000000000000000000000"
    PropagateID: "00000000000000000000000000000000"
    ReservedCode1: 3045022100a70e78206634567e54fee9d619987355bdfcea327183788e464e47800ce855120220320e8d71db238ee5f5e8fb7d1a35d132ebb6a3b5427632ced482c8dd8e913b29
    ReservedCode2: 3046022100c7fe6b9bcb083e2d49e8c2488f7eab567a2a90c31ea4f56d9897e6dc89f25044022100cecf3a7acb78b84bec8238819c483026073a589ebfb73f19c2f6ca4db57efeae
description: 用于生成软件著作权申请相关文档的工具。当用户需要填写软件著作权登记表、生成软件说明书、创建技术文档、准备软著申请材料时使用。支持中国软件著作权登记所需的各类文档模板和信息收集。
name: software-

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Automatically installing dependencies during normal execution is unrelated to generating copyright documents and expands the script's behavior into package management and shell execution. In an agent/skill context, this is more dangerous because running the skill may trigger unexpected network access and execution of third-party code without operator review or consent.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
97% confidence
Finding

The script invokes a shell command at runtime to install a dependency, causing code execution outside the document generator's stated purpose. Even though the command string is constant, it still executes arbitrary external package installation through the system shell, which can introduce unreviewed code, fail unpredictably, or be subverted through environment/PATH/pip configuration manipulation.

Content

Scanner excerpt · scripts/generate_docs.py (reported line 20)May include surrounding context.

python
from docx.enum.table import WD_TABLE_ALIGNMENT
except ImportError:
    print("Error: python-docx not installed. Installing...")
    os.system("pip install python-docx")
    from docx import Document
    from docx.shared import Inches, Pt, Cm
    from docx.enum.text import WD_ALIGN_PARAGRAPH

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
72% confidence
Finding

The skill advertises document generation behavior and output files, while static analysis detected code-capable behaviors (file_write, shell) without any declared tool scope or permissions boundary. This creates an authorization and transparency gap: an agent may invoke higher-risk capabilities than users or reviewers expect, increasing the chance of unintended file modification or command execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description states the tool is for generating Chinese software copyright application documents, and the rest of the file consistently requires Chinese-form application materials and wording. There is no user opt-in or language/locale choice, which is a natural-language locale policy concern unless clearly documented as a justified region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The document template is entirely written in Chinese and all required section headings and placeholders assume Chinese-language authoring. This imposes a specific language/locale on users without any opt-in or explanation that the template is intended only for a Chinese-language or region-specific context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script installs a package via shell command without prior warning or confirmation, violating user expectations and enabling side effects such as environment modification, network access, and execution of package install hooks. While not clearly malicious, this is unsafe operational behavior, especially for a tool whose expected function is only local document generation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description is written entirely in Chinese and does not state that the skill is Chinese-only, region-specific, or configurable based on user preference. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Line L17 states that the software full name '应当使用中文', which imposes a specific language requirement in natural language. The file does not provide user choice or explain a limited regional/compliance context within the document itself, so this appears to be a locale/language policy constraint without opt-in.

Content

No source excerpt is available for this finding.