Back to skill

Security audit

合规咨询

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed China-listed-company compliance assistant that relies on a configured hegui MCP database, with no evidence of hidden execution, exfiltration, destructive behavior, or persistence beyond normal installation.

Install only if you intend to use the hegui MCP service for Chinese listed-company compliance research and are comfortable placing its token in your Claude or project MCP config. Treat outputs as database-backed research assistance, not final legal advice, and be alert to the documented fallback that may use official sources if you explicitly authorize it.

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

Ambiguous Article Matching Can Falsely Validate Incorrect Legal Quotations

Content
View full analysis

Vulnerability Details

File Location: scripts/validate_clause_completeness.py, lines 53–68 and 103
Vulnerability Type: Unanchored and prefix-ambiguous legal article matching
Risk Level: Medium

Vulnerable Code

python
def locate_clause(source: str, article: str):
    """在源全文中截取 [目标条号, 下一条同级条号) 之间的完整条文。"""
    esc = re.escape(article)
    m = re.search(esc, source)
    if not m:
        return None, False
    start = m.start()
    level = same_level_pattern(article)
    next_found = False
    end = len(source)
    for nm in level.finditer(source, m.end()):
        if nm.group(0) == article:
            continue
        end = nm.start()
        next_found = True
        break
    return source[start:end].strip(), next_found
python
result["starts_with_article_number"] = norm(args.article) in na

Technical Analysis

The validator searches for article identifiers as unanchored substrings rather than structurally validating an article heading.

For dotted identifiers, a requested article such as 6.2.1 can match the beginning of 6.2.11. For Chinese identifiers, 第六条 can match the prefix of 第六条之一. The search for the next same-level article is also not restricted to paragraph or line boundaries, so an article identifier appearing inside the clause as a cross-reference may be incorrectly treated as the start of the next clause.

The starts_with_article_number field does not verify that the quoted block begins with the requested heading. It only checks whether the normalized article identifier occurs anywhere in the complete answer. Moreover, this field does not participate in the exit-code decision:

python
return 0 if (result["complete_match"] and not result["ellipsis_detected"]) else 1

Consequently, the script can return a successful exit code after selecting the wrong clause or an incorrectly truncated clause.

Attack Path

  1. An attacker ...[truncated 1694 chars]
Remediation
View remediation

Remediation Suggestions

  1. Require article identifiers to occur at normalized paragraph or line starts rather than anywhere in the source text.
  2. Add exact trailing boundaries:
    • For dotted identifiers, require a delimiter after the identifier so 6.2.1 cannot match 6.2.11.
    • For Chinese identifiers, prevent 第六条 from matching 第六条之一.
  3. Match longer and more specific identifier forms before shorter prefix-compatible forms.
  4. Detect the next article only when the identifier is a genuine heading at the expected structural boundary.
  5. Require the relevant quotation block in the answer—not merely the entire answer—to begin with the exact requested article heading.
  6. Include starts_with_article_number and next_article_found in the success condition, except where the source has been independently confirmed to end with the target article.
  7. Reject multiple ambiguous matches unless the caller selects a uniquely identified occurrence.
  8. Add regression tests for:
    • 6.2.1 versus 6.2.11;
    • 第六条 versus 第六条之一;
    • Article identifiers in cross-references within clause text;
    • Repeated article identifiers;
    • Last-article handling;
    • Answers that contain the article number outside the quoted block.
  9. Where source formats preserve structure, parse paragraph styles or document nodes instead of relying exclusively on regular expressions.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to deliver authoritative listed-company compliance advice based on verified current regulations, announcement databases, and official templates, but the implementation described by the finding does not actually perform those retrieval and verification steps. In a legal/compliance context, this mismatch can cause users to rely on unsupported or incomplete conclusions, creating material disclosure, governance, qualification, or regulatory-risk errors.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file explicitly allows, in item 9 of the downgrade sequence, use of 'official data sources' after user authorization, which conflicts with the skill manifest's hard prohibition on independent online search or supplementing regulations and announcements outside the hegui workflow. In a compliance/legal skill, this can cause provenance drift, inconsistent or outdated authority sources, and bypass the tool-bound evidence controls the skill is supposed to enforce.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file presents all instructions and operational descriptions only in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking or China-specific user base. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% 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 · INSTALL.md (reported line 8)May include surrounding context.

md
- 个人级(所有项目可用):`~/.claude/skills/hegui-consult/`
- 项目级(仅当前项目):`<你的项目>/.claude/skills/hegui-consult/`

放好后目录应是 `…/skills/hegui-consult/SKILL.md`(外层不要再多一层)。

## 2. 连上 hegui MCP(skill 依赖它取数据)
在 `~/.claude.json`(个人级)或项目根 `.mcp.json` 里加:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installation guide says the skill will 'automatically trigger' for a wide range of topics such as listed-company compliance, disclosure, qualifications, and exchange rules, but it does not define specific trigger phrases, scope limits, or negative examples. This ambiguity could cause unintended invocation during ordinary discussion of related topics.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The instructions throughout the output contract require a fixed Chinese-language answer structure and all user-facing guidance is written as mandatory Chinese output behavior, but the skill does not state that users may choose another language. This creates a natural-language locale policy issue because the skill appears to impose a specific language by default without opt-in or justification as a region-specific constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The display name, description, and default prompt are all written to require Chinese-language operation, and the prompt directs a specific response style without any user opt-in for language or locale. Under the policy rule, a forced language/locale is a violation unless the skill explicitly offers a choice or clearly documents a justified regional constraint.

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 skill file is written as mandatory Chinese-language operating instructions and does not indicate that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The title and core instruction establish a mandatory Chinese-language answer contract (e.g., '最终答复必须…') and the entire document prescribes response behavior only in Chinese. This is a natural-language locale policy constraint with no indication that the user may choose another language or opt in to Chinese-only output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire skill guidance and evaluation content is written exclusively in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-language or region-specific audience. Under the stated policy, forcing a specific language without 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
95% confidence
Finding

The entire skill document is written as mandatory operational guidance in Chinese, with no indication that language choice is optional or user-selected. Under the policy rule, forcing a specific language or locale without opt-in is a natural-language policy violation unless clearly documented as region-specific and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The entire routing contract is written as a mandatory Chinese-language specification, including required field semantics and user-facing handling instructions, but it does not state that the skill is China-region-specific or that users may opt into this 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.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This Python file contains all user-facing documentation and argument help text exclusively in Chinese, which imposes a language choice on users. Under the policy, language constraints should offer user opt-in or be clearly justified as region-specific; no such choice or justification appears here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.