Back to skill

Security audit

pinyin-box

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent worksheet-generation purpose, but its install and command examples introduce review-worthy execution risks.

Install only in a dedicated virtual environment or sandbox, and prefer a reviewed, exactly pinned, hash-verified dependency source. Treat uploaded images as potentially sensitive because the skill extracts text from them, and ensure any implementation invokes the CLI with structured arguments rather than building a shell command string from user text.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Error
Location
requirements.txt:1
Finding

Unpinned and Unverified Remote Python Dependency

Content
View full analysis

Vulnerability Details

File Location: requirements.txt, lines 1-2
Vulnerability Type: Software supply-chain exposure through an unpinned package and an unverified remote wheel
Risk Level: High

text
pinyin-box>=1.0.0
https://github.com/yanglinzhen/pinyin-box/releases/download/v1.0.0/pinyin_box-1.0.0-py3-none-any.whl

Technical Analysis

The dependency file permits any version of pinyin-box at or above version 1.0.0 while also installing a wheel directly from a GitHub release. Neither dependency is protected by a cryptographic hash. The project consequently relies on executable package content fetched from external package infrastructure without verifying that the downloaded artifacts match reviewed versions.

Python package installation can execute package installation or build logic, and the installed CLI subsequently executes package code at runtime. The broad version constraint allows a later PyPI release to be selected. The direct URL also depends on the continued integrity of the external repository, release asset, repository owner account, and delivery infrastructure.

The package implementation is not included in the audited project, so its behavior could not be independently reviewed. Listing the same distribution through two different requirement forms also creates avoidable provenance and dependency-resolution ambiguity.

Attack Path

  1. An attacker compromises the relevant PyPI publisher account, GitHub account, repository, release asset, or another dependency in the package graph.
  2. The attacker publishes or substitutes a malicious package version accepted by pinyin-box>=1.0.0, or modifies the externally hosted wheel.
  3. A user follows the installation instructions and runs pip install -r requirements.txt.
  4. Pip downloads the attacker-controlled artifact because no approved hash is enforced.
  5. Malicious package logic executes during installation, import, or later invocati ...[truncated 561 chars]
Remediation
View remediation

Remediation Suggestions

  • Select one approved package source rather than declaring the same distribution through both a broad package constraint and a direct URL.
  • Pin every direct and transitive dependency to an exact reviewed version.
  • Generate and enforce cryptographic hashes using a lock file or pip install --require-hashes.
  • Prefer an internally mirrored or vendored artifact whose source and build process have been reviewed.
  • Verify release signatures or attestations where the publisher provides them.
  • Install the package in a dedicated virtual environment or sandbox under a non-privileged account.
  • Add automated dependency scanning and require review before updating the lock file or artifact hashes.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:62
Finding

Potential Shell Command Injection Through User-Controlled Worksheet Text

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 62
Vulnerability Type: Shell command injection through unsafe interpolation of user or OCR-derived text
Risk Level: High

The documented command has the following structure, with the original non-English placeholder represented here as USER_TEXT:

bash
pinyin-box -t "USER_TEXT" -s medium -o ~/.openclaw/workspace/pinyin-box/output/pinyin_img1.png

Technical Analysis

The workflow instructs the agent to accept direct user text or extract text from an image and then supply that content to the -t command-line argument. If an implementation constructs this command as a string and evaluates it through a shell, the input crosses a command-execution boundary without a documented escaping or argument-separation mechanism.

Double quotes are not a sufficient defense. Shell command substitution and some expansions remain active inside double quotes, while an embedded quote can terminate the intended argument and introduce shell operators. OCR-derived text must also be treated as untrusted because an attacker can place command-like content in an uploaded image.

The repository contains documentation rather than the command-execution implementation, so exploitation depends on the agent or integration invoking the example through a shell. The documented pattern nevertheless creates a direct unsafe implementation path.

Attack Path

  1. An attacker submits crafted text directly or embeds it in an image processed by OCR.
  2. The crafted content contains shell syntax, such as command substitution or a quote followed by a command separator.
  3. The agent inserts the extracted content into the documented command template.
  4. The integration passes the resulting command string to a shell instead of invoking the executable with a structured argument array.
  5. The shell interprets the injected syntax and executes the attacker-selected command under the agent's operat ...[truncated 507 chars]
Remediation
View remediation

Remediation Suggestions

  • Never concatenate user-supplied or OCR-derived text into a shell command string.

  • Invoke the executable with a structured argument array and disable shell evaluation, for example:

    python
    subprocess.run(
        ["pinyin-box", "-t", user_text, "-s", "medium", "-o", output_path],
        shell=False,
        check=True,
    )
    
  • If supported by the CLI, place long input in a securely created file and pass its path as a separate argument.

  • Constrain output paths to a dedicated directory and reject traversal outside that directory.

  • Validate output format and size, but do not rely on character filtering as the primary command-injection defense.

  • Run document generation in a sandbox under a minimally privileged account with restricted filesystem and network access.

  • Update the skill instructions to explicitly prohibit shell interpolation and provide only the safe argument-array invocation pattern.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger scope is overly broad because it claims the skill should be used when converting 'any content' into pinyin or practice-grid format. In an agentic environment, vague routing criteria can cause the skill to be invoked on inappropriate or sensitive inputs, increasing the chance of accidental data exposure, misrouting, or unexpected processing of content outside the intended Chinese-text practice use case.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The image OCR flow instructs the system to extract text from uploaded images but does not require a user-facing notice or confirmation that image contents will be processed. This is risky because users may upload screenshots or documents containing personal, confidential, or incidental third-party data, and the skill normalizes extracting and transforming that text without any privacy warning or consent checkpoint.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
94% confidence
Finding

The dependency specification uses a lower-bound range (>=1.0.0) rather than pinning to an exact version, which allows future package releases to be installed without review. In a skill execution environment, this creates supply-chain risk because a later compromised or breaking release of the package could be pulled automatically and executed.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pinyin-box>=1.0.0
https://github.com/yanglinzhen/pinyin-box/releases/download/v1.0.0/pinyin_box-1.0.0-py3-none-any.whl