Back to skill

Security audit

姓名五格数理测算

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Chinese name-numerology skill, with notable but disclosed behavior around automatic dictionary downloads, local caching, and broad name-related triggers.

Install this only if you are comfortable with a Chinese Wuge numerology tool that converts names to Traditional Chinese for calculations, may contact GitHub/CDN for a larger stroke dictionary, and caches that data locally. For privacy-sensitive or locked-down use, avoid automatic downloads or use a vetted local cache; treat generated name scores as entertainment or cultural reference, not authoritative advice.

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/name_wuge.py:53
Finding

Unverified Download from a Mutable Upstream Source

Content
View full analysis

Vulnerability Details

File Location: scripts/name_wuge.py:53-61, 256-273
Vulnerability Type: Unpinned and integrity-unverified remote dependency
Risk Level: Medium

Vulnerable Code

python
# Full Kangxi dictionary CSV download URLs (primary + fallback mirror)
_CSV_URLS = [
    # Primary: jsDelivr CDN (master branch)
    "https://cdn.jsdelivr.net/gh/breezyreeds/kangxi-strokecount@master/kangxi-strokecount.csv",
    # Fallback: GitHub Raw (master branch)
    "https://raw.githubusercontent.com/breezyreeds/kangxi-strokecount/master/kangxi-strokecount.csv",
]

# CSV SHA-256 checksum (verification is skipped when empty)
_CSV_SHA256 = ""
python
with urllib.request.urlopen(req, timeout=_DOWNLOAD_TIMEOUT) as resp:
    data = resp.read()
tmp = dest.with_suffix(".tmp")
tmp.write_bytes(data)
if _CSV_SHA256:
    actual = hashlib.sha256(data).hexdigest()
    if actual != _CSV_SHA256:
        print(f"  [kangxi] SHA256 mismatch, skipping this source")
        tmp.unlink(missing_ok=True)
        break
tmp.rename(dest)

Technical Analysis

The Kangxi stroke-count dataset is downloaded from URLs referencing the mutable master branch. The _CSV_SHA256 value is empty, so the conditional integrity check is never performed. As a result, the application trusts whichever dataset is currently returned by the upstream repository or CDN.

HTTPS provides transport protection and server authentication, but it does not guarantee that upstream content remains identical to the version reviewed by the Skill author. A compromised upstream repository, CDN, maintainer account, or release process could modify the CSV after publication.

The downloaded file is parsed as CSV and converted to a persistent JSON cache. The reviewed parser only extracts character and integer fields; it does not execute the downloaded content. Therefore, this issue enables data and result manipulation rather than arbitrary code execution.

Attack Path

  1. An attacker compromi ...[truncated 1315 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace master in both download URLs with a specific immutable commit hash or a cryptographically verified release artifact.
  2. Populate _CSV_SHA256 with the expected SHA-256 digest and make verification mandatory. An absent digest should cause a fail-closed response rather than silently disabling verification.
  3. Verify the digest before moving the temporary download into its final cache location or parsing any records.
  4. Validate the CSV schema, expected row count, permitted character format, and reasonable stroke-count bounds before accepting the dataset.
  5. Store the verified source commit and digest alongside the JSON cache. Revalidate cached data before loading it, or authenticate it using a trusted manifest.
  6. Use a unique temporary filename created securely, then perform an atomic replacement only after all integrity and schema checks pass.
  7. Provide a safe offline fallback to the built-in dictionary when verification fails, and report the failure without consuming untrusted data.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (15)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description says the skill triggers when users ask for fortune-telling, name evaluation, stroke analysis, or even directly send a name. This ambiguous matching can capture routine messages that merely contain a Chinese name, making the skill overbroad and increasing the chance of accidental invocation outside the user's intended task.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill enforces mandatory conversion to Traditional Chinese for processing and requires dual-script output without user opt-in. While not directly a code-execution issue, forced transformation of user input can alter meaning, reduce user control, and create integrity or privacy concerns if users did not intend normalization or script conversion.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger section allows activation from very broad, low-specificity phrases such as sending only a name or generic requests like '帮我想名字' and '测一下这个名字好不好'. In an agent environment, this can cause unintended skill invocation on ordinary conversation, leading to surprise execution, incorrect routing, and downstream side effects such as unnecessary data processing or auto-download behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The module banner and surrounding descriptions present the skill exclusively in Chinese and for Chinese personal/company naming, but there is no user-facing statement that this skill is intentionally locale-specific or any option to choose another language/locale. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The docstring for run_random_names states require_all_ji=False means '只保总格为吉' (keep only names with auspicious total grid). However, the function passes require_all_ji directly into generate_names, where False skips all fortune filtering entirely rather than checking zong only. This is an active contradiction between documented intent and actual behavior.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

When require_all_ji is False, the function labels the mode as 总格为吉 in both failure and success output. But no code checks get_81_info(z)['jixiong'] or otherwise filters by total-grid auspiciousness before adding names to all_results. The output therefore misrepresents the nature of the generated results.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file repeatedly states as a hard rule that all name and company-name calculations must first be converted to Traditional Chinese, and the code enforces that behavior unconditionally. This is a language/locale policy concern because the skill forces a specific script/locale handling choice rather than offering the user an option or clearly justified regional constraint.

Content

No source excerpt is available for this finding.

Tainted flow: '_CACHE_FILE' from os.environ.get (line 66, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
83% confidence
Finding

The cache file path is derived from the SKILL_CACHE_DIR environment variable and then used for file writes without validation. If an attacker can influence the process environment, they can redirect writes into unintended filesystem locations, potentially overwriting files accessible to the running user or planting data in sensitive paths.

Content

Scanner excerpt · scripts/name_wuge.py (reported line 305)May include surrounding context.

python
def _save_cache(data: dict):
    _CACHE_DIR.mkdir(parents=True, exist_ok=True)
    with open(_CACHE_FILE, "w", encoding="utf-8") as f:
        json.dump(data, f, ensure_ascii=False, separators=(",", ":"))

def _load_cache() -> Optional[dict]:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill may initiate outbound network requests automatically during normal execution to fetch dictionary data, without explicit user consent at the call site. In restricted or privacy-sensitive environments, this can violate network-use expectations, leak operational metadata such as IP/user agent/access timing, and expand the attack surface to remote content delivery and availability failures.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The run() docstring says surname/given inputs are like "zhang", "ouyang", and "wei", and its examples call run() with those values. But calc_wuge() converts the inputs with OpenCC and then iterates each character for Kangxi stroke lookup, which only makes sense for Chinese Han characters; Latin letters would not be found and would trigger the missing-character error path.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring says chars can be values like "zhangwei" and shows a return shape like {"zhang": 11, "wei": 6}, implying tokenized transliterations. In reality, the function loops over each character in the input string and passes each single character to get_kangxi_strokes(), so it would process 'z', 'h', 'a', etc., not Chinese-name syllables.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger examples include very broad natural-language phrases such as “帮我看看这个名字好不好”, which can match ordinary conversation rather than an explicit tool invocation. In an agent environment, overly permissive triggers increase the chance of accidental skill activation and unintended processing of user content, especially when users are discussing names casually rather than requesting this specific capability.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The batch-generation section uses broad prompts like “帮我想名字”, which are common conversational requests and not tightly scoped to this skill. That makes accidental invocation more likely, potentially causing the agent to route unrelated naming or brainstorming requests into this specific skill without the user clearly opting in.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The quick reference table further normalizes highly generic templates such as “姓名”, “帮我想好听的名字”, and similar short patterns without any explicit boundary markers. In a multi-skill or assistant setting, these patterns can overmatch common user utterances, creating invocation ambiguity and increasing the risk of unintended skill execution.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

整个技能教程与触发方式均默认使用中文,且未说明是否仅面向中文用户或是否支持其他语言/locale 选择。按规则,若技能强制特定语言而未提供用户 opt-in 或明确、合理的地域性说明,属于自然语言政策风险。

Content

No source excerpt is available for this finding.