Back to skill

Security audit

vedic-destiny

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Chinese Vedic chart-analysis helper, but it needs Review because it can create persistent local HTML reports from sensitive personal data and the HTML renderer has a real unsafe-link issue.

Install only if you want a Chinese Vedic astrology workflow that may process sensitive birth and life-context data. Before using report mode, choose a dedicated output folder, confirm file creation explicitly, and avoid opening or clicking links in generated HTML made from untrusted markdown until link scheme filtering is fixed.

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

Warning
Location
scripts/build_report_html.py:895
Finding
Unsafe Markdown Link Schemes Permit JavaScript Execution in Generated Reports<![CDATA[ ## Vulnerability Details **File Location**: `scripts/build_report_html.py`, lines 895–899 **Vulnerability Type**: Unsafe URI scheme handling in Markdown links **Risk Level**: Medium ### Vulnerable Code ```python text = stash( re.compile(r"\[([^\]]+)\]\(([^)]+)\)"), text, lambda match: f'<a href="{escape(match.group(2), quote=True)}">{escape(match.group(1))}</a>', ) ``` ### Technical Analysis The Markdown renderer places a user-controlled link destination directly into an HTML `href` attribute. Although `escape(..., quote=True)` prevents HTML attribute breakout, it does not validate the URI scheme. Consequently, dangerous schemes such as `javascript:`, `data:`, `vbscript:`, or `file:` can survive HTML rendering. For example, the following Markdown contains a JavaScript URL that does not require parentheses: ```markdown [Open report details](javascript:document.body.textContent='Report modified') ``` It is rendered as: ```html <a href="javascript:document.body.textContent='Report modified'">Open report details</a> ``` When a reader clicks the link, the browser evaluates the JavaScript in the generated report's document context. This is a scheme-validation flaw rather than an HTML-escaping flaw: encoding special characters does not neutralize a syntactically valid dangerous URI. The vulnerable data flow is: 1. Markdown is read from a file under the report's `sections/` directory. 2. `render_markdown()` processes the section. 3. `render_inline()` recognizes Markdown links. 4. The destination is HTML-escaped but not parsed or allowlisted. 5. The resulting unsafe link is written to `dist/report.html`. ### Attack Path 1. An attacker causes crafted Markdown to be included in a report section. This may occur through externally supplied report content, chart-related text incorporated into a generated section, or modification of a section file before report generation. 2. The attacker includes a link with a dangerous destination, such ...[truncated 1331 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Parse each destination before rendering it and enforce an explicit scheme allowlist. 1. Permit only necessary schemes, such as: - `https` - `http` - `mailto`, if required 2. Permit relative paths and fragment identifiers only if the report format needs them. 3. Reject or render as plain text all other schemes, including: - `javascript` - `data` - `vbscript` - `file` 4. Normalize and inspect the destination before validation: - Strip leading and trailing whitespace. - Reject embedded control characters. - Compare schemes case-insensitively. - Account for percent-encoded and HTML-entity-obfuscated schemes. 5. Add `rel="noopener noreferrer"` to external links. 6. Add a restrictive Content Security Policy as defense in depth, including `script-src 'none'`. Scheme allowlisting should remain the primary control. 7. Add regression tests for mixed-case schemes, leading whitespace, control characters, percent encoding, HTML entities, protocol-relative URLs, and valid relative links. A hardened implementation can use `urllib.parse.urlsplit`: ```python from urllib.parse import urlsplit ALLOWED_SCHEMES = {"http", "https", "mailto"} def safe_href(raw: str) -> str | None: value = raw.strip() if any(ord(char) < 0x20 or ord(char) == 0x7F for char in value): return None parsed = urlsplit(value) if parsed.scheme and parsed.scheme.lower() not in ALLOWED_SCHEMES: return None if value.startswith("//"): return None return value ``` The renderer should emit a normal anchor only when `safe_href()` returns a value; otherwise, it should render the label as escaped plain text. ]]>
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 (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
声明描述的是“占星分析/拆盘”能力与相关触发场景;而代码并没有执行任何命盘计算、占星推断、PDF/截图解析、事件回看、出生时间校验、事业婚姻分析或地点/时间窗口比较。它只是把已存在的报告内容组装成 HTML 展示页。虽然界面文案和命名围绕吠陀命盘报告,但主功能是报告渲染而非命盘分析,属于 materially different primary purpose。

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
描述强调的是面向终端用户的综合吠陀占星分析与拆盘能力,但代码并不进行任何解释性占星输出,也没有事业、婚姻、时间窗口、地点比较、事件校时等分析逻辑。它的核心作用是对结构化命盘数据做 sanity check 和规则验证,属于后台校验工具而非“完整命盘分析入口”。虽然代码确实与吠陀占星领域相关,并包含 Navamsha、nakshatra、dasha 等校验,说明它可作为该技能的辅助组件,但就该代码块本身而言,其实际行为与声明的主要用途存在明显差异。此外,声明提到可基于 PDF、截图或文本命盘数据进行系统拆盘,而此代码只直接处理 JSON 或 markdown(通过桥接函数),没有展示 PDF/截图解析能力。因此应判定为描述与代码行为不匹配。

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
声明描述的是高层占星分析能力与多种用户触发场景,而代码仅是底层数据摄取/解析工具。它解析 JHora 导出的 HTML/markdown 表格,识别星座、宿、分盘、Shadbala、Vimsottari、Ashtakavarga 等字段,最终输出结构化 payload。虽然这些数据可作为后续吠陀占星分析的支持输入,因此与领域相关,但就该代码块本身而言,其主要目的不是“完整命盘分析入口”,而是“JHora 导出解析器/转换器”。此外,声明中提到支持 PDF、截图、文本命盘数据,代码中并无 PDF/OCR/图像处理实现。因此描述与实际行为存在实质性不匹配。

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
This markdown file contains natural-language requirements such as '70% 白话', '术语必翻译', and specific Chinese-language output constraints. Because the policy applies to all file types, forcing a language/locale style without documenting user choice or justified locale scope is a policy violation.

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill instructs the agent to read and write local files and invoke helper scripts, but it declares no explicit tool scope or permissions boundary. That creates an authorization gap: in environments where the orchestrator relies on manifest-declared scopes, the skill may gain broader filesystem capabilities than a user would expect, increasing the risk of unintended file access or report generation side effects.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The skill uses very broad trigger phrases such as general life, career, relationship, time-window, and location questions, making accidental invocation likely across common conversations. Over-broad activation is dangerous in context because this skill also directs file/script use and structured data handling, so unintended routing could cause unnecessary collection of sensitive personal data or unexpected local file operations.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file describes itself as a '中文入口' and states '这是一套中文总入口 skill', but does not offer the user a language choice or explain that Chinese-only behavior is a justified regional constraint. This creates a locale-policy issue because the skill appears to impose a specific language by default.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The entire skill file is written as Chinese-only operational guidance and does not indicate that the user may choose another language or locale. Under the policy rule for natural-language violations, forcing a specific language without opt-in is in scope unless the regional constraint is explicit and justified.

Description-Behavior Mismatch

Medium
Confidence
90% confidence
Finding
The skill instructs the agent to proactively generate `report.html` when output reaches report scale, which expands behavior from conversational analysis into filesystem side effects. Unscoped file generation can create or overwrite artifacts in the runtime environment, increasing the risk of unintended data exposure, clobbering existing files, or enabling downstream misuse if other components trust or publish generated HTML.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
Line L019 says each major section must begin with 2 to 4 sentences of "普通话", which imposes a specific language requirement. The document does not offer an alternative language option or describe this as a justified region-specific constraint, so it creates a natural-language locale policy concern.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This code enforces a specific locale by setting `meta["lang"] = "cn"` whenever the input metadata does not specify a language. The policy requires avoiding forced language or locale selection unless the user is given a choice or the constraint is clearly justified.

Context-Inappropriate Capability

Low
Confidence
78% confidence
Finding
The directive to generate `report.html` adds an output capability not clearly necessary for a chart-analysis entry skill, violating least privilege. Even if not overtly malicious, unnecessary file-writing behavior broadens the attack surface and can be chained with other agent capabilities or consuming systems that automatically open, render, or distribute generated HTML.

Static analysis

No suspicious patterns detected.