Back to skill

Security audit

英语词汇闪卡 Lite

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate Chinese-localized flashcard image generator, with ordinary dependency-installation risks users should manage carefully.

Install it in a virtual environment, avoid --allow-global and root execution, and review or update the pinned dependencies before using it on important systems. Be aware that generated cards may include Chinese text and that any baike_url in your input will be encoded into a QR image.

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

Warning
Location
scripts/setup.sh:42
Finding

Dependency installation lacks cryptographic integrity verification

Content
View full analysis

Vulnerability Details

File Location: scripts/setup.sh, lines 42-65; dependency declarations in requirements.txt, lines 3-5
Vulnerability Type: Supply-chain integrity weakness
Risk Level: Medium

Vulnerable Code

bash
if [ -n "$VENV_DIR" ]; then
    echo "   创建虚拟环境: $VENV_DIR"
    python3 -m venv "$VENV_DIR"
    # shellcheck disable=SC1091
    source "$VENV_DIR/bin/activate"
    echo "   虚拟环境中安装依赖..."
    python3 -m pip install -r requirements.txt
    echo "   完成(venv: $VENV_DIR)。后续使用: source $VENV_DIR/bin/activate"
    exit 0
fi

if [ -n "${VIRTUAL_ENV:-}" ] || [ -f ".venv/bin/activate" ]; then
    echo "   检测到虚拟环境,直接安装..."
    if [ -n "${VIRTUAL_ENV:-}" ]; then
        "$PIP_CMD" install -r requirements.txt
    else
        # shellcheck disable=SC1091
        source .venv/bin/activate
        python3 -m pip install -r requirements.txt
    fi
    echo "   完成。"
    exit 0
fi

if "$PIP_CMD" install -r requirements.txt 2>/tmp/vocab_pip_err.txt; then
    echo "   依赖安装完成。"
else
    if grep -qi "externally-managed-environment" /tmp/vocab_pip_err.txt; then
        if [ "$ALLOW_GLOBAL" -eq 1 ]; then
            echo "   用户显式确认(--allow-global),绕过 PEP 668 安装到系统 Python..."
            "$PIP_CMD" install --break-system-packages -r requirements.txt

The installed dependencies are version-pinned but not hash-pinned:

text
pillow==11.3.0
fonttools==4.63.0
qrcode[pil]==8.2

Technical Analysis

Exact version pins provide reproducibility only if the retrieved artifacts are trustworthy. They do not authenticate package contents. Every installation path invokes pip install without --require-hashes, and the project does not provide expected hashes for wheels or source distributions.

Pip uses the index and mirror configuration of the invoking environment. If an upstream repository, configured mirror, DNS/network path, or local pip configuration is comp ...[truncated 1841 chars]

Remediation
View remediation

Remediation Suggestions

  1. Generate a fully resolved lock file containing SHA-256 hashes for every permitted wheel or source artifact.
  2. Install with hash enforcement, for example:
    bash
    python3 -m pip install --require-hashes -r requirements.lock
    
  3. Restrict installation to an explicitly documented trusted index and avoid adding untrusted extra indexes.
  4. Prefer platform-specific, pre-reviewed wheels and prohibit unexpected source builds where practical, such as with --only-binary=:all:.
  5. Retain virtual environments as the default and consider removing the --allow-global path entirely.
  6. Perform dependency vulnerability and provenance checks whenever locked artifacts are updated.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup.sh:57
Finding

Predictable shared temporary file enables symlink-based file clobbering

Content
View full analysis

Vulnerability Details

File Location: scripts/setup.sh, lines 57-85
Vulnerability Type: Unsafe temporary-file handling
Risk Level: Medium

Vulnerable Code

bash
if "$PIP_CMD" install -r requirements.txt 2>/tmp/vocab_pip_err.txt; then
    echo "   依赖安装完成。"
else
    if grep -qi "externally-managed-environment" /tmp/vocab_pip_err.txt; then
        if [ "$ALLOW_GLOBAL" -eq 1 ]; then
            echo "   用户显式确认(--allow-global),绕过 PEP 668 安装到系统 Python..."
            "$PIP_CMD" install --break-system-packages -r requirements.txt
        else
            echo ""
            echo "!! 系统 Python 受 PEP 668 保护(externally-managed-environment),禁止直接安装。"
            echo "   为保护你的系统环境,本脚本不会自动绕过该保护。请选择以下任一方式:"
            echo ""
            echo "   A. 推荐: 使用虚拟环境"
            echo "      bash setup.sh --venv .venv"
            echo "      或: python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt"
            echo ""
            echo "   B. 自担风险: 显式允许安装到系统 Python"
            echo "      bash setup.sh --allow-global"
            echo "      (等效于 pip install --break-system-packages -r requirements.txt)"
            echo ""
            exit 1
        fi
    else
        echo "!! 安装失败,错误信息:"
        cat /tmp/vocab_pip_err.txt
        exit 1
    fi
fi

Technical Analysis

The script redirects pip error output to the fixed path /tmp/vocab_pip_err.txt. Shared temporary directories are writable by other local users, and the shell opens the redirection target before starting pip. On systems without effective symlink and protected-regular-file defenses, an attacker can pre-create this predictable path as a symbolic link to another file.

When the script is subsequently run by an account that can write the symlink target, the redirection truncates and writes to that target. The file is neither created atomically nor checked for ownership and type. It is ...[truncated 1360 chars]

Remediation
View remediation

Remediation Suggestions

  1. Create a private temporary file atomically with mktemp:
    bash
    PIP_ERR_FILE="$(mktemp "${TMPDIR:-/tmp}/vocab_pip_err.XXXXXX")"
    trap 'rm -f -- "$PIP_ERR_FILE"' EXIT
    
  2. Redirect, search, and display errors only through the quoted generated path:
    bash
    if "$PIP_CMD" install -r requirements.txt 2>"$PIP_ERR_FILE"; then
        :
    elif grep -qi "externally-managed-environment" "$PIP_ERR_FILE"; then
        :
    else
        cat -- "$PIP_ERR_FILE"
    fi
    
  3. Ensure restrictive permissions with umask 077 before creating temporary files.
  4. Avoid running the setup script as root; use a dedicated virtual environment under an unprivileged account.
  5. Remove the temporary file on normal exit, errors, and signals through an exit trap.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (17)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `requirements.txt` | Python 依赖清单(pillow / fonttools / qrcode[pil]) |

Known Vulnerable Dependency: pillow==11.3.0 — 16 advisory(ies): CVE-2026-55379 (Pillow `BdfFontFile`: `Image.new()` called without `_decompression_bomb_check()`); CVE-2026-55798 (Pillow: WindowsViewer.get_command() OS command injection via unescaped shell pat); CVE-2026-54060 (Pillow: `FontFile.compile()`: `Image.new()` called without `_decompression_bomb_) +13 more

High
Category
Supply Chain
Confidence
92% confidence
Finding

The file pins Pillow to version 11.3.0, and the static analysis indicates multiple known advisories affecting that version. In this skill's context, Pillow processes image/font content to generate printable flashcard PNGs, so malformed or attacker-controlled inputs could potentially trigger denial of service, memory exhaustion, or other image-parsing flaws; if any vulnerable code paths are reachable, risk is materially increased because the skill likely handles untrusted JSON/text/font-related rendering inputs.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · CHANGELOG.md (reported line 33)May include surrounding context.

md
### 🔴 P0 结构性修复(均有实测证据)

- **重写 setup.sh 校验逻辑**(发布阻断):v1.0.5 的 setup.sh 仍校验已被删除的 `NotoSansCJK-Lite-*.ttf`,导致**任何新用户跑安装必然在第一步中断**。v2.0.0 改为:校验实际存在的 2 个包内 IPA 字体 + 检测系统 CJK/DejaVu 字体,缺失时打印中文安装指引(`sudo apt install fonts-noto-cjk fonts-dejavu` 等)。
- **动态画布高度**:主卡/副卡不再固定 1700px 截断内容。两遍渲染(先测量、再绘制),按内容动态加高(最低 1700px,上限 3200px,超限打印 WARN 并截断)。修复"例句多/释义长时内容被静默截断"。
- **输入字段校验**:新增 `validate_item()`。只有 `word` 必填;其余字段缺失自动补默认值并打印 `HINT` 中文提示;缺 `word` 的条目打印 `SKIP` 原因后跳过,不再出现难懂的 `KeyError: 'ipa_uk'`。
- **slugify 空值兜底**:纯中文或特殊字符单词不再产出 `.png` 非法文件名,自动生成 `word_<md5前8位>.png`;同批数据 slug 撞车时自动追加 `_2`、`_3` 序号,避免互相覆盖。

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
### 🔴 P0 结构性修复(均有实测证据)

- **重写 setup.sh 校验逻辑**(发布阻断):v1.0.5 的 setup.sh 仍校验已被删除的 `NotoSansCJK-Lite-*.ttf`,导致**任何新用户跑安装必然在第一步中断**。v2.0.0 改为:校验实际存在的 2 个包内 IPA 字体 + 检测系统 CJK/DejaVu 字体,缺失时打印中文安装指引(`sudo apt install fonts-noto-cjk fonts-dejavu` 等)。
- **动态画布高度**:主卡/副卡不再固定 1700px 截断内容。两遍渲染(先测量、再绘制),按内容动态加高(最低 1700px,上限 3200px,超限打印 WARN 并截断)。修复"例句多/释义长时内容被静默截断"。
- **输入字段校验**:新增 `validate_item()`。只有 `word` 必填;其余字段缺失自动补默认值并打印 `HINT` 中文提示;缺 `word` 的条目打印 `SKIP` 原因后跳过,不再出现难懂的 `KeyError: 'ipa_uk'`。
- **slugify 空值兜底**:纯中文或特殊字符单词不再产出 `.png` 非法文件名,自动生成 `word_<md5前8位>.png`;同批数据 slug 撞车时自动追加 `_2`、`_3` 序号,避免互相覆盖。

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/setup.sh (reported line 145)May include surrounding context.

sh
### 🔴 P0 结构性修复(均有实测证据)

- **重写 setup.sh 校验逻辑**(发布阻断):v1.0.5 的 setup.sh 仍校验已被删除的 `NotoSansCJK-Lite-*.ttf`,导致**任何新用户跑安装必然在第一步中断**。v2.0.0 改为:校验实际存在的 2 个包内 IPA 字体 + 检测系统 CJK/DejaVu 字体,缺失时打印中文安装指引(`sudo apt install fonts-noto-cjk fonts-dejavu` 等)。
- **动态画布高度**:主卡/副卡不再固定 1700px 截断内容。两遍渲染(先测量、再绘制),按内容动态加高(最低 1700px,上限 3200px,超限打印 WARN 并截断)。修复"例句多/释义长时内容被静默截断"。
- **输入字段校验**:新增 `validate_item()`。只有 `word` 必填;其余字段缺失自动补默认值并打印 `HINT` 中文提示;缺 `word` 的条目打印 `SKIP` 原因后跳过,不再出现难懂的 `KeyError: 'ipa_uk'`。
- **slugify 空值兜底**:纯中文或特殊字符单词不再产出 `.png` 非法文件名,自动生成 `word_<md5前8位>.png`;同批数据 slug 撞车时自动追加 `_2`、`_3` 序号,避免互相覆盖。

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/setup.sh (reported line 146)May include surrounding context.

sh
### 🔴 P0 结构性修复(均有实测证据)

- **重写 setup.sh 校验逻辑**(发布阻断):v1.0.5 的 setup.sh 仍校验已被删除的 `NotoSansCJK-Lite-*.ttf`,导致**任何新用户跑安装必然在第一步中断**。v2.0.0 改为:校验实际存在的 2 个包内 IPA 字体 + 检测系统 CJK/DejaVu 字体,缺失时打印中文安装指引(`sudo apt install fonts-noto-cjk fonts-dejavu` 等)。
- **动态画布高度**:主卡/副卡不再固定 1700px 截断内容。两遍渲染(先测量、再绘制),按内容动态加高(最低 1700px,上限 3200px,超限打印 WARN 并截断)。修复"例句多/释义长时内容被静默截断"。
- **输入字段校验**:新增 `validate_item()`。只有 `word` 必填;其余字段缺失自动补默认值并打印 `HINT` 中文提示;缺 `word` 的条目打印 `SKIP` 原因后跳过,不再出现难懂的 `KeyError: 'ipa_uk'`。
- **slugify 空值兜底**:纯中文或特殊字符单词不再产出 `.png` 非法文件名,自动生成 `word_<md5前8位>.png`;同批数据 slug 撞车时自动追加 `_2`、`_3` 序号,避免互相覆盖。

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file contains natural-language descriptions that the skill emits Chinese-language guidance and status messages. Forcing a specific language in user-facing output without offering a language choice can violate language/locale policy unless clearly justified as region-specific, which is not documented here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The entry says missing file and invalid JSON conditions produce Chinese prompts. That indicates user-facing language is fixed to Chinese, and this file does not show any opt-in, user choice, or region-specific rationale that would make the restriction compliant.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documentation is entirely in Chinese and presents the tool as an English-vocabulary card generator with Chinese explanations, but it does not offer an alternative language option or state that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list includes very broad everyday terms such as '英文单词' and '闪卡', which can cause the skill to activate in conversations that are only generally about English words or flashcards rather than image generation. In an agentic environment, overbroad activation increases the chance of unintended tool use, confusing outputs, and accidental processing of user data in contexts where this skill is not the best fit.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's comments, usage text, and runtime echo messages are entirely in Chinese, which imposes a specific language on users. Under the policy rule, a forced language choice without opt-in or documented locale justification is 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
96% confidence
Finding

The file-level description, help text, warnings, and runtime messages are written exclusively in Chinese, and the script prints __doc__ for usage output. There is no indication that users can choose another language or that the locale restriction is intentionally scoped to a Chinese-only audience.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The activation guidance still relies heavily on keyword matching, even though anti-triggers are present, and does not require a strong intent check for image generation/output files. This makes accidental activation plausible, but the surrounding constraints and narrow functional scope reduce the severity compared with a more dangerous skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This JSON includes multiple content fields in Chinese, such as "cn", Chinese example translations, and Chinese notes/tips, but the file provides no indication that the user can choose or opt into this locale. Under the policy rule for natural-language violations, forcing a specific language without documented choice can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file presents all descriptive content in Chinese, including usage-oriented reference text, with no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The only natural-language content in this file is written in Chinese, with no indication that language choice is optional or justified by a region-specific constraint. Per the policy, forcing a specific language or locale without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The code automatically generates a QR-card whenever baike_url is present, embedding that external destination into the produced PNG. While the module docstring mentions Baidu Baike QR codes in general, this execution path lacks a localized user disclosure or confirmation that external URLs from input data will be encoded into deliverable files.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.