Back to skill

Security audit

周易智慧顾问

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly does what it claims, but its report generator can write to arbitrary paths and places unescaped user text into HTML reports.

Review before installing. Use only with explicit Zhouyi/I Ching requests, keep generated reports in a safe dedicated directory, avoid custom --output paths that could overwrite important files, and do not open or share reports generated from untrusted question text until HTML escaping and overwrite protections are added. Expect Chinese-language output.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/zhouyi.py:1076
Finding

Stored HTML and JavaScript Injection Through the Divination Question

Content
View full analysis

🗺️ 决策参考

占问主题:{question_text}

``` The affected value originates from the command-line argument at line 1354: ```python parser.add_argument("--question", default="", help="占问问题") ``` It is passed to the HTML generator at line 1409 and written to disk at lines 1425-1426: ```python html = generate_divination_html(method_name, yaos, ben_gua, bian_gua, args.question) with open(output_path, "w", encoding="utf-8") as f: f.write(html) ``` ### Technical Analysis The `--question` argument is attacker-controlled input. The application interpolates this value directly into an HTML element without applying HTML entity encoding or contextual output escaping. Because the generated report is intended to be opened in a web browser, an attacker can terminate the existing paragraph and inject arbitrary HTML elements, event handlers, or script blocks. The resulting payload is stored in the generated report, making this a stored HTML/JavaScript injection vulnerability. For example, the following input would produce an executable script element in the report: ```text

``` The vulnerability is especially relevant when an AI Agent invokes the script using question text obtained from an untrusted user. The user who supplied the question may influence a report that is subsequently opened or shared by another person. ### Attack Path 1. An attacker supplies a malicious value through `--question`, directly or through an Agent that maps an untrusted prompt to this argument. 2. `m ...[truncated 1575 chars]

Remediation
View remediation
``` 5. Add regression tests confirming that the following inputs are rendered as literal text and never interpreted as markup: ```text

" onmouseover="alert(1) ``` 6. Validate the final generated document with an HTML parser and verify that user input cannot introduce additional elements, attributes, or executable content. ]]>

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill advertises code-capable behavior that can write files by generating an HTML report, but it does not declare any explicit tool scope or permissions boundaries. In an agent environment, undeclared file-write capability weakens least-privilege controls and can allow unintended or unauthorized writes if the runtime infers or grants broader access than the skill metadata communicates.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill states it activates on matching keywords or 'intent' without defining a strict decision boundary, making invocation dependent on vague semantic interpretation. Ambiguous activation is risky because it can spuriously engage the skill in contexts the user did not intend, especially when the workflow includes follow-up questioning and optional report generation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad, everyday phrases like asking for advice or '帮我看看这件事/给点建议/这个决定怎么样', which can cause the skill to activate in unrelated conversations. Overbroad activation increases the chance that a file-writing, HTML-generating skill runs unexpectedly, potentially exposing user context to unnecessary processing or causing unintended side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file consists wholly of Chinese-language instructional content and does not indicate that the user can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. The policy for natural-language content requires either user opt-in for a specific language/locale or a clearly documented justification for the constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file is entirely written as normative guidance in Chinese for how the skill should present its ethics framing and standard declaration. Because no user language choice or opt-in is mentioned, this may amount to a language/locale policy violation if the skill is used in broader contexts where users have not requested Chinese.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script accepts a user-supplied --output path and writes HTML to it with no restriction to a safe output directory, no path normalization checks, and no confirmation before overwrite. In an agent or automation context, this can overwrite arbitrary files the process can access, including sensitive web-served locations or user files, making it a genuine file-write risk rather than just a usability issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file presents all instructional content in a single language and does not indicate that the user can choose another language. Under the policy criteria, 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
80% confidence
Finding

The generated report is fixed to Chinese via and all user-facing text is emitted in Chinese, with no option to select another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale policy issue unless the constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.