Back to skill

Security audit

Xiang miles | Space2.world

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small avatar/habitat generator with disclosed local file output and remote image references, with minor safety caveats around generated Markdown.

Install only if you are comfortable with the skill creating a visible s2_matrix_data JSON file in the current directory and with pasted Markdown loading images from spacesq.org. Avoid entering untrusted HTML-like text as the agent name, and prefer Markdown viewers that sanitize raw HTML or block remote resources by default.

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
skill.py:84
Finding

Unsanitized Agent Name Allows HTML Injection into Generated Markdown

Content
View full analysis
{AVATARS[avatar_choice]}

[ {agent_name} ]

{AVATARS[avatar_choice]}

``` ### Technical Analysis The skill accepts an arbitrary agent name through `input()` and performs only whitespace trimming and uppercase conversion. It does not validate the permitted character set, restrict the input length, or HTML-escape the value. The value is then interpolated into an `

` element in the generated Markdown. Because the output intentionally contains raw HTML and users are instructed to copy it into Markdown-capable applications, a crafted name can close the existing element and introduce additional attacker-controlled HTML. For example, an input conceptually shaped like the following can introduce a remote resource: ```html

``` Calling `.upper()` does not neutralize HTML because tag and attribute names are generally case-insensitive in HTML. The precise behavior depends on the destination Markdown renderer: some remove unsafe HTML, while permissive renderers may load injected remote resources or allow other active content. ### Attack Path 1. An attacker persuades a user to enter a specially crafted agent name or supplies the value in an automated execution environment. 2. The skill accepts the value without validation or output encoding. 3. The value is inserted into the raw HTML section of `md_output`. 4. The skill instructs the user to copy the generated Mark ...[truncated 880 chars]

Remediation
View remediation
[ {safe_agent_name} ] ``` 2. Apply strict allowlist validation if agent names are intended to be identifiers rather than free-form text: ```python import re if not re.fullmatch(r"[A-Z0-9_-]{1,64}", agent_name): raise ValueError( "Agent names may contain only letters, digits, underscores, and hyphens." ) ``` 3. Enforce a reasonable maximum length to prevent oversized or disruptive generated documents. 4. Prefer standard Markdown text over raw HTML where possible. If raw HTML is unnecessary, generate a heading such as: ```python ### [safe identifier] ``` 5. Clearly warn users that generated documents contain remote image references, and recommend Markdown renderers that sanitize raw HTML and block untrusted remote content by default. 6. Add regression tests using payloads containing angle brackets, closing tags, quotes, image elements, and event-handler attributes. Verify that these values are rejected or rendered only as inert text. ]]>
Vulnerability Patterns
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Natural-language prompts and instructions are presented in Chinese, and the skill does not offer an opt-in or alternative language selection. This can violate a language/locale policy when skills force a specific language without user choice or documented justification.

Content

No source excerpt is available for this finding.

Tainted flow: 'state_file' from input (line 58, user input) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · skill.py (reported line 74)May include surrounding context.

python
heartbeat_status = ""
    try:
        with open(state_file, 'w', encoding='utf-8') as f:
            json.dump(state_data, f, ensure_ascii=False, indent=2)
        heartbeat_status = f"✅ [本地神经元链接成功] 心跳档案已写入当前目录: ./s2_matrix_data/{pod_id}.json"
    except Exception as e:

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill writes a state JSON file to the local filesystem automatically, without obtaining explicit user consent or clearly warning beforehand. While the data written is not highly sensitive, unexpected local writes can violate user expectations, clutter workspaces, or become more risky when executed in privileged or shared directories.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.