Back to skill

Security audit

公文写作

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Chinese official-document drafting tool, but its optional font workflow downloads mutable font binaries without integrity checks and installs them persistently for the user.

Review this skill before installing if you plan to use the font scripts. Prefer using already trusted local fonts, or verify downloaded font hashes yourself before running install_fonts.sh. The drafting/export functions appear purpose-aligned, but implicit activation and the curl-based font workflow should be treated carefully.

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/download_fonts.sh:13
Finding

Unverified Mutable Font Downloads Are Persistently Installed

Content
View full analysis

Vulnerability Details

File Location: scripts/download_fonts.sh:13-16, 20-41; scripts/install_fonts.sh:7, 24-32
Vulnerability Type: Unverified third-party binary dependency retrieval
Risk Level: Medium

Vulnerable Code

From scripts/download_fonts.sh:

bash
download() {
  local url="$1"
  local output="$2"
  echo "[INFO] Downloading ${output}"
  curl -fsSL "${url}" -o "${FONT_DIR}/${output}"
}
bash
download_noto_cjk_minimal() {
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Serif/SubsetOTF/SC/NotoSerifSC-Bold.otf" "NotoSerifSC-Bold.otf"
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Serif/SubsetOTF/SC/NotoSerifSC-Regular.otf" "NotoSerifSC-Regular.otf"
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/SubsetOTF/SC/NotoSansSC-Bold.otf" "NotoSansSC-Bold.otf"
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/SubsetOTF/SC/NotoSansSC-Regular.otf" "NotoSansSC-Regular.otf"
}

download_noto_cjk_all() {
  download_noto_cjk_minimal
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Serif/SubsetOTF/SC/NotoSerifSC-Medium.otf" "NotoSerifSC-Medium.otf"
  download "https://raw.githubusercontent.com/notofonts/noto-cjk/main/Sans/SubsetOTF/SC/NotoSansSC-Medium.otf" "NotoSansSC-Medium.otf"
}

download_fandol_minimal() {
  download "https://tug.ctan.org/fonts/fandol/FandolFang-Regular.otf" "FandolFang-Regular.otf"
  download "https://tug.ctan.org/fonts/fandol/FandolSong-Regular.otf" "FandolSong-Regular.otf"
}

download_fandol_all() {
  download_fandol_minimal
  download "https://tug.ctan.org/fonts/fandol/FandolHei-Regular.otf" "FandolHei-Regular.otf"
  download "https://tug.ctan.org/fonts/fandol/FandolHei-Bold.otf" "FandolHei-Bold.otf"
  download "https://tug.ctan.org/fonts/fandol/FandolSong-Bold.otf" "FandolSong-Bold.otf"
}

From scripts/install_fonts.sh:

bash
TARGET_DIR="${HOME}/.local/share/fonts/official-document-draftin
...[truncated 2962 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin GitHub downloads to an immutable reviewed commit hash or a versioned release rather than the mutable main branch.
  2. Pin CTAN artifacts to a stable, versioned source where possible.
  3. Maintain trusted SHA-256 or stronger hashes for every supported artifact and verify each download before installation.
  4. Prefer signed release artifacts and validate upstream signatures when the publishers provide them.
  5. Download to a securely created temporary file, validate it, and atomically rename it only after all checks pass.
  6. Validate the expected file type, font structure, filename, and reasonable minimum and maximum file size before installation.
  7. Delete temporary or invalid files and abort the operation if any verification fails.
  8. Make install_fonts.sh accept only a manifest of verified files rather than every file matching a font extension in assets/fonts.
  9. Record installed versions and provide an uninstall or rollback command.
  10. Document that fonts are persistent user-level components and should only be installed after integrity verification.

A checksum-based download function could follow this pattern:

bash
download_verified() {
  local url="$1"
  local output="$2"
  local expected_sha256="$3"
  local temporary

  temporary="$(mktemp "${FONT_DIR}/.${output}.XXXXXX")"
  trap 'rm -f "${temporary}"' RETURN

  curl --fail --show-error --location \
    --proto '=https' --tlsv1.2 \
    "${url}" -o "${temporary}"

  printf '%s  %s\n' "${expected_sha256}" "${temporary}" | sha256sum --check -
  mv -f "${temporary}" "${FONT_DIR}/${output}"
  trap - RETURN
}

The checksum values must be obtained independently from reviewed, immutable upstream releases and stored in a version-controlled manifest.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (86)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill requires curl in metadata and discusses docx export workflows, while its declared purpose is drafting official documents. If the broader implementation fetches remote fonts or assets from external sites during normal operation, that introduces network exposure and supply-chain risk unrelated to core drafting, especially for potentially sensitive government-style content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README encourages broad triggering in agent environments by stating users can '直接输入:总结当前热点新闻并且形成报告', which overlaps with ordinary writing requests rather than a narrowly scoped skill invocation. In hosts that support implicit skill loading, this can cause the skill to activate unexpectedly and steer user tasks into file-writing or formal-document workflows the user did not explicitly request.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 45)May include surrounding context.

如需从本地复制:

bash
mkdir -p ~/.codex/skills
cp -R ./official-document-drafting ~/.codex/skills/

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · README.md (reported line 322)May include surrounding context.

如需从本地复制:

bash
mkdir -p ~/.codex/skills
cp -R ./official-document-drafting ~/.codex/skills/

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 45)May include surrounding context.

如需从本地复制:

bash
mkdir -p ~/.codex/skills
cp -R ./official-document-drafting ~/.codex/skills/

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 45)May include surrounding context.

如需从本地复制:

bash
mkdir -p ~/.codex/skills
cp -R ./official-document-drafting ~/.codex/skills/

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Labeling a single natural-language phrase as the '唯一推荐样例' without trigger boundaries makes the skill easy to invoke from commonplace user intent, especially because the phrase is indistinguishable from a normal summarization request. In an agent setting with implicit invocation enabled, this increases the chance of unintended delegation, prompt-scope creep, and unrequested file generation behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill metadata declares required binaries (bash, python3, curl) and the instructions include reading and writing files plus invoking an export script, but it does not define an explicit tool/permission scope. That creates unnecessary ambient authority: a caller or runtime may permit shell, file, and network operations broader than needed, increasing the blast radius if downstream prompts or scripts are abused.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description says the skill is for drafting and exporting Chinese official documents, which constrains output language to Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified as region-specific; this file does not clearly provide that justification or an opt-in path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The '语言与输出' section defines the writing style entirely around Chinese official-writing conventions and does not indicate that users may choose another language or locale. Because this is a natural-language instruction affecting all uses of the skill, it constitutes a language policy issue absent explicit opt-in or a clearly justified region-specific limitation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This Python file includes user-facing natural-language output in Chinese, such as the string returned by format_chars, and many later exception and rendered prompt strings are also Chinese-only. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not evident in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI descriptions, task labels, and generated prompt content are hardcoded in Chinese, which imposes a specific language/locale on users. Under the policy, this is a natural-language locale constraint and there is no visible opt-in or justification that this skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The display and default prompt hard-code Chinese formal-document output without stating that this is conditional on user preference. If auto-selected, the skill can override the user's expected language or writing mode, leading to integrity issues in assistant behavior and potentially causing confusing or unusable outputs in multilingual or non-government-document contexts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation with no visible trigger constraints, so the platform may auto-activate it for broadly related requests. Because this skill is specialized for formal Chinese government-style drafting, ambiguous activation can cause unintended routing, surprise transformations of user intent, or unrequested use of a domain-specific formatter that changes output language and style.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire README is written only in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-only audience for a documented regional or compliance reason. 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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The template content is entirely written in Chinese, including the title and section headings, and there is no indication that the skill is region-specific or that users may choose another language. Under the policy, fixed language requirements without opt-in can constitute a locale/language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template content, headings, and placeholders are entirely in Chinese, which imposes a specific language by default. Under the policy criteria, forcing a language without offering user opt-in or documenting a justified locale-specific constraint 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
91% confidence
Finding

The entire template is written in Chinese and provides no indication that other languages are supported or that Chinese is required for a specific regional or compliance context. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.