Back to skill

Security audit

标准语料分类器

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does the advertised PDF organization work, but it needs review because its file-moving and report-generation behavior can damage a corpus or make a generated report unsafe with untrusted inputs.

Review before installing. Use this only on a backed-up or copied corpus, run --dry first, check for duplicate PDF filenames, and avoid untrusted custom CSV/domain registry inputs before generating HTML reports. Treat WebSearch source discovery as optional and only use it when sharing those lookup terms externally is acceptable.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/make_report.py:30
Finding

Stored HTML Attribute Injection in Generated Reports

Content
View full analysis
", ">")) def color_for(i): return PALETTE[i % len(PALETTE)] def domain_bars(by_domain): items = by_domain.most_common() maxn = items[0][1] if items else 1 out = [] for i, (dom, n) in enumerate(items): w = pct(n, maxn) c = color_for(i) out.append( f'
' f'
{esc(dom)}
' f'
' f'{n}
' f'
' ) ``` ### Technical Analysis The custom `esc()` function encodes ampersands and angle brackets but does not encode quotation marks. The escaped domain value is subsequently inserted into a double-quoted `title` attribute. A malicious domain value containing a double quote can terminate the intended attribute and introduce another attribute, including an event handler. For example: ```text x" onmouseover="alert(document.domain) ``` This produces markup equivalent to: ```html
``` The domain value can originate from a supplied CSV file or from a custom domain registry, both of which are accepted inputs in the documented workflow. Escaping angle brackets alone therefore does not prevent execution because the payload is injected into an existing HTML tag. Other report fields generally pass through the same incomplete escaping function. Most are inserted into text contexts, but future use in attribute contexts could introduce additional injection points. ### Attack Path 1. An attacker supplies or modifies a st ...[truncated 1041 chars]
Remediation
View remediation
``` 5. Add regression tests using domain values containing `"`, `'`, `<`, `>`, and event-handler payloads. Verify that generated markup contains encoded forms such as `"` and does not create additional attributes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/classify_standards.py:135
Finding

Silent PDF Data Loss Through Destination Filename Collisions

Content
View full analysis
Remediation
View remediation
{final_path}" ) else: shutil.move(str(fpath), str(final_path)) ``` 5. Generate the complete move plan and validate it for duplicate destinations before modifying any files. 6. Consider transactional behavior: retain a move journal and roll back completed moves if a later operation fails. 7. Add tests with identical basenames in different source directories and verify that no existing file is replaced silently. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims to classify and package PDFs but actually performs only post hoc validation changes the trust model for users and reviewers. Even without overtly malicious code, this discrepancy can bypass informed consent, lead to incorrect operational assumptions, and mask the true file access pattern of the shipped scripts.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

A skill that claims to classify and package PDFs but actually performs only post hoc validation changes the trust model for users and reviewers. Even without overtly malicious code, this discrepancy can bypass informed consent, lead to incorrect operational assumptions, and mask the true file access pattern of the shipped scripts.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims to classify and package PDFs but actually performs only post hoc validation changes the trust model for users and reviewers. Even without overtly malicious code, this discrepancy can bypass informed consent, lead to incorrect operational assumptions, and mask the true file access pattern of the shipped scripts.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims to classify and package PDFs but actually performs only post hoc validation changes the trust model for users and reviewers. Even without overtly malicious code, this discrepancy can bypass informed consent, lead to incorrect operational assumptions, and mask the true file access pattern of the shipped scripts.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises file-reading and file-writing behavior but does not declare any explicit tool scope or permissions boundary. In an agent environment, missing scope declarations can cause overbroad execution or make it unclear to users and orchestrators which filesystem operations are expected, increasing the chance of unintended file access or modification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is primarily written in Chinese and all example invocations are Chinese-centric, which signals a language/locale constraint for using the skill. The file does not offer an English or user-selectable language option, nor does it justify why Chinese-only interaction is required as an explicit regional compliance constraint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation claims offline/no-network operation while also describing a live WebSearch-based discovery workflow. This inconsistency can defeat user expectations and policy controls in restricted environments, and may result in unintended external queries that leak the existence or context of locally processed standards corpora.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Adding an undeclared WebSearch-based source-discovery capability broadens the attack surface beyond local PDF classification. Even if used for convenience, it introduces unnecessary network interaction and potential data leakage that is not essential to the primary task of organizing local files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The trigger phrase "标准分类" is very broad and can match ordinary user requests that are not clearly asking to invoke this specific skill. In an agent environment, overly generic triggers can cause unintended activation, pulling unrelated files into processing or invoking document-handling logic when the user only meant a general conversation or lightweight assistance.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The download-related triggers (e.g. requests to download by category, year, or standard number) are ambiguous because they imply file retrieval actions without clearly scoping source, authorization, or corpus boundaries. This can lead the agent to over-trigger on generic download requests and potentially package or expose documents beyond what the user intended, especially in a skill that inventories and exports document collections.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language metadata on L002 is written entirely in Chinese and describes the taxonomy without indicating that the skill is region-specific or that users may choose another language or locale. Under the policy for natural-language content, forcing a specific language without opt-in can be a locale-policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The _meta string explicitly defines this taxonomy as a dedicated meteorological-domain resource written only in Chinese, with no indication that language selection is optional. Because SQP-3 applies to all file types and covers language/locale policy violations, this is a natural-language policy concern unless the locale restriction is clearly documented and justified for users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This JSON manifest-like file contains its primary descriptive metadata entirely in Chinese in the _meta field, with no indication that other languages are supported or that the Chinese locale is an explicit user choice. 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
93% confidence
Finding

The module docstring, usage instructions, argparse descriptions, and user-facing print messages are all written exclusively in Chinese. This imposes a fixed language on users without any opt-in, fallback, or documented justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains natural-language descriptions, usage examples, help text, and output messages exclusively in Chinese, which effectively forces a specific language for users. Under the policy, language constraints should either be optional/opt-in or clearly justified as region-specific; neither is present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains its primary documentation, usage text, and runtime output entirely in Chinese, with no indication that the skill is region-specific or that users can choose another language. The policy explicitly flags language/locale constraints when a skill forces a specific language without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The usage section says the script recursively scans PDFs, moves misplaced files into categorized folders, and generates CSV output. Although a dry-run option is documented, the description does not include an explicit warning that real execution will reorganize files and write outputs into the corpus directory, which could affect user data layout.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module docstring frames the script as only doing local cataloging/classification, which suggests a single local reorganization flow. However, when --year-folders is enabled, the code additionally creates a parallel by_year directory tree and hard-links or copies files there, which is a broader output behavior than the docstring describes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest and module docstring describe classification by level × domain, CSV catalog output, and HTML/report-oriented organization, but this script also supports a separate --year-folders mode that creates an additional by_year/YYYY/ hierarchy with hard links or copied files. That extra year-based materialization is a real file-organization capability beyond the described core behavior of placing PDFs into domain subfolders.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.