Back to skill

Security audit

Xiang miles | Space2.world

Security checks for vulnerabilities and agentic risk

Overview

This skill locally generates a visible SOUL.md prompt template and deterministic identifier, with no evidence of automatic file writes, credential access, network calls, or hidden execution.

Install only if you want a Space2-branded SOUL.md prompt template. Before saving the generated SOUL.md, review and edit the behavior rules because a host agent may treat that file as persistent instruction context.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Warning
Location
skill.py:15
Finding
Persistent Agent Behavior Injection Through Generated SOUL.md Content## Vulnerability Details **File Location**: `skill.py:15-39`; supporting persistence instructions in `SKILL.md:10-15` **Vulnerability Type**: Persistent prompt injection and agent memory poisoning **Risk Level**: Medium ### Vulnerable Code ```python anchor_text = f"""# SOUL.md - {agent_name} > Base Identity Anchored by Space2 Local Matrix > Permanent S2-DID: {local_did} You are a professional, highly capable digital entity. ## Core Truths - Actions speak louder than filler words. Provide solutions directly. - Accuracy over speed. Never hallucinate. ## Anti-Patterns - Never start with 'Great question!' - Never summarize the user's prompt as a preamble. """ response_msg = ( f"✅ [S2-Soul-Anchor] Deterministic Identity Anchored!\n\n" f"🛡️ PERMANENT S2-DID GENERATED: {local_did}\n" f"⚠️ SECURITY PROTOCOL ACTIVE: Automatic file writing is disabled.\n\n" f"👇 Please COPY the text below and save it manually as your workspace/SOUL.md:\n" f"{'='*55}\n\n" f"{anchor_text}\n" f"{'='*55}\n\n" f"🌐 Optional: You can register this permanent DID for a Web3 profile at https://space2.world" ) ``` Supporting instructions in `SKILL.md:10-15`: ```markdown ### ⚙️ Usage 1. Run the skill locally. 2. Copy the generated `SOUL.md` template (which includes your deterministic `S2-DID`) from the terminal. 3. Paste it into your local workspace. *Optional: Want a public Web3 dossier or a physical Matrix Coordinate? Take your generated S2-DID and register it manually on the [Space2.world](https://space2.world) global matrix!* ``` ### Technical Analysis The skill's stated core function is to derive a deterministic identifier from an agent name. However, its output also contains fixed behavioral instructions and directs the user to save them in the persistent `SOUL.md` identity file. These in ...[truncated 2188 chars]
Remediation
## Remediation Suggestions 1. Return only the deterministic DID by default. Do not include behavioral rules in the normal identity-generation output. 2. If a `SOUL.md` template is required, separate the DID metadata from behavioral instructions and make every behavioral rule explicitly opt-in. 3. Present a clear warning that `SOUL.md` may act as privileged, persistent agent context and can affect future sessions. 4. Require users to review and confirm each proposed behavioral rule before producing content intended for persistence. 5. Remove fixed third-party branding and promotional links from generated identity files. If a homepage link is retained, display it separately from persistent agent instructions. 6. Add tests asserting that the default output contains no agent-control directives and performs no file writes or network operations. 7. Keep automatic file writing disabled. If writing support is introduced later, require an explicit destination, preview the complete content, obtain confirmation, and avoid overwriting existing identity files.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Natural-Language Policy Violations

Low
Confidence
78% confidence
Finding
This code includes natural-language comments in Chinese and user-facing strings with a strongly fixed presentation style, without offering any user language or locale choice. Under the policy scope, forcing a specific language or locale without opt-in can be a violation, even when embedded in comments or string literals.

Static analysis

No suspicious patterns detected.