Back to skill

Security audit

bot

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a local agent demo rather than a backdoor, but it needs Review because its memory, monitor, and policy-execution controls are too weak for sensitive use.

Install only in an isolated virtual environment. Treat this as a demo framework, not a security boundary: do not rely on PolicyExecutor to block network, filesystem, subprocess, or other side effects from untrusted tools. Avoid running the web monitor with secrets or sensitive prompts, stop it when finished, and harden memory storage by validating agent IDs before using this with untrusted input.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
src/protocol/memory.py:4
Finding

Path Traversal in Agent Memory Storage

Content
View full analysis
Remediation
View remediation
Path: if not SAFE_AGENT_ID.fullmatch(agent_id): raise ValueError("Invalid agent ID") target = (MEMORY_PATH / f"{agent_id}.json").resolve() target.relative_to(MEMORY_PATH) return target ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
src/tools/policy_executor.py:6
Finding

Policy Executor Does Not Enforce Its Declared Network Policy

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/web/thought_tree.py:65
Finding

HTML Injection Through Unescaped Confidence Values

Content
View full analysis
confidence: {confidence}' thoughts_html = "" if thoughts: items = "".join(f"
  • {html.escape(str(t))}
  • " for t in thoughts) thoughts_html = f"
      {items}
    " children_html = "" if children: children_html = "".join(render_node(child) for child in children) return f'''

    {label}{confidence_html}

    {thoughts_html} {children_html}
    ''' ``` ### Technical Analysis The renderer correctly escapes node labels and thoughts, but inserts `confidence` directly into an HTML fragment. No numeric type validation or HTML escaping is applied. If viewer data contains an attacker-controlled string in a node's `confidence` property, the string can terminate the `` element and insert arbitrary markup. Script execution is possible through executable HTML constructs, subject to the browser's behavior and any external browser protections. The generated page does not define a Content Security Policy to reduce this risk. The bundled agent currently emits a numeric confidence value, but `serve_thought_tree()` accepts a general data structure. Therefore, integrations that display imported, persisted, or externally generated results can expose the vulnerable path. ### Attack Path 1. An attacker influences a thought-tree object supplied to the viewer. 2. The attacker places an HTML payload in a node's `confidence` field. 3. `render_node()` conve ...[truncated 784 chars]
    Remediation
    View remediation
    confidence: {safe_confidence}' ) ``` ]]>

    T08 · Insecure Dependencies

    Note
    Location
    install.sh:9
    Finding

    Mutable and Unhashed Dependency Installation

    Content
    View full analysis
    =2,<3 jsonschema>=4,<5 rich>=13,<14 cryptography>=42,<43 PyYAML>=6,<7 ``` ### Technical Analysis The installation script resolves broad version ranges at installation time and does not require package hashes. Two installations performed at different times can therefore retrieve different package versions and artifacts. The reviewed dependency names are conventional, and no custom package index, suspicious spelling, direct URL, or known malicious package was identified in the audited files. The weakness is the absence of reproducible pinning and artifact verification, not evidence that the listed dependencies are currently malicious. Without hashes, package integrity depends entirely on the configured package index, transport security, account security of upstream maintainers, and the environment's pip configuration. ### Attack Path 1. A new package version becomes eligible under one of the declared version ranges, or an eligible upstream artifact is compromised. 2. A user later runs `install.sh`. 3. Pip resolves the mutable range using the environment's configured index. 4. Because no reviewed lock file or hash requirement is present, pip installs the newly resolved artifact. 5. The package's installation or runtime code executes in the environment under the user's privileges. This path depends on an upstream or package-index compromise, an unsafe index configuration, or an unexpectedly unsafe eligible release; no such compromise was established during this audit. ### Impact Assessment A compromised dependency can execute code with the privileges of the user running pip and can affect any process importing that package. Potential scope includes the virtual environmen ...[truncated 332 chars]
    Remediation
    View remediation
    Vulnerability Patterns
    • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
    • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
    • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
    • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
    • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
    Findings (19)

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    The declared description presents a broad agent framework with policy-guarded execution semantics, but the supplied code chunk only performs local dependency installation. While installation can be a supporting detail, this specific code does not itself implement or demonstrate the described framework behavior. Its primary purpose is setup/package installation, which is materially different from the declared operational purpose of the skill.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    95% confidence
    Finding

    The declared description describes a substantial autonomous-agent framework with policy-guarded execution and composability on ClawHub. The provided code chunk only implements minimal placeholder perception utilities for text and image analysis, and even those do not perform real analysis beyond string formatting. This is a materially different primary purpose from the declared framework, so the description does not accurately represent the code shown.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    88% confidence
    Finding

    The description claims a broader agent framework with local-first architecture, observability, composability, and policy-guarded execution on ClawHub. The supplied code only provides a basic reasoning helper that simulates thought output, plus optional TUI display and optional cryptographic signing. Those behaviors do not substantiate the declared primary purpose, and key claimed capabilities like policy enforcement and ClawHub execution are absent from this chunk. Additionally, signing outputs with a crypto interface is an extra capability not reflected in the description.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    90% confidence
    Finding

    The supplied code only loads a YAML configuration file and returns specific fields (IDENTITY, EQUIP, GRANT, DENY). This is materially narrower and different from the declared description of a universal autonomous entity framework with observable/composable agents and policy-guarded execution on ClawHub. While configuration parsing could be a supporting component of such a system, the declared purpose describes a much broader framework and execution model that is not represented in this code chunk. The code also performs local file access, which is not reflected in the declared permissions list.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    87% confidence
    Finding

    The declared description presents a broad autonomous agent framework with observability, composition, and policy-guarded execution. The supplied code chunk only implements two terminal display helpers for showing thought text and tool names. While UI observability could be a supporting detail, exposing chain-of-thought is a specific behavior not reflected in the description, and the code does not evidence the core claimed framework capabilities such as execution control, policy enforcement, composability, or ClawHub integration. This is therefore a meaningful description-to-behavior mismatch for this chunk.

    Content

    No source excerpt is available for this finding.

    Tp4

    High
    Category
    MCP Tool Poisoning
    Confidence
    96% confidence
    Finding

    The supplied code chunk does not implement a general 'Universal Autonomous Entity Standard' framework, agent composition system, or policy-guarded execution on ClawHub. Instead, it is narrowly focused on one function: serving a local web page that visualizes provided thought-tree data and raw JSON. While this could be a small observability component within a larger agent framework, the declared description presents the skill as a broad local-first agent framework, whereas the code shown is specifically a monitoring/viewer utility with HTTP serving behavior. That is a materially different primary purpose from the declared description.

    Content

    No source excerpt is available for this finding.

    Direct Prompt Extraction

    High
    Category
    System Prompt Leakage
    Confidence
    88% confidence
    Finding

    The handler directly extracts and displays the internal prompt from in-memory agent data, which is a direct confidentiality leak of model inputs and potentially hidden instructions or secrets. In an agent framework, prompts often contain system directives, user data, tokens, or task context, so exposing them through a web endpoint increases the risk of prompt disclosure and downstream compromise.

    Content

    Scanner excerpt · src/web/thought_tree.py (reported line 100)May include surrounding context.

    python
    self.send_response(404)
                self.end_headers()
                self.wfile.write(b"Not Found")
                return
    
            prompt = html.escape(str(self.data.get("prompt", "")))
            tree = self.data.get("thought_tree", {})
    

    Undeclared Tool Scope

    Medium
    Category
    MCP Least Privilege
    Confidence
    70% confidence
    Finding

    Without declared permissions the skill's intent is opaque and cannot be validated.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    89% confidence
    Finding

    The function persists arbitrary memory data to a JSON file, which can affect user data and filesystem state. There is no confirmation prompt, log message, comment, or docstring indicating that the skill stores data locally.

    Content

    No source excerpt is available for this finding.

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

    Medium
    Category
    Data Flow
    Confidence
    96% confidence
    Finding

    The file write path is influenced by untrusted input in two ways: the base directory comes from the BOT_MEMORY_DIR environment variable and the filename embeds unsanitized agent_id. An attacker who can control either value can cause writes outside the intended memory store via path traversal or redirection to sensitive filesystem locations, leading to file overwrite or data corruption.

    Content

    Scanner excerpt · src/protocol/memory.py (reported line 9)May include surrounding context.

    python
    def save_memory(agent_id: str, data: dict):
        path = os.path.join(MEMORY_PATH, f"{agent_id}.json")
        with open(path, "w", encoding="utf-8") as f:
            json.dump(data, f, indent=2, ensure_ascii=False)
    
    def load_memory(agent_id: str):
    

    Missing User Warnings

    Medium
    Category
    Not specified by scanner
    Confidence
    94% confidence
    Finding

    The function renders the agent's internal thought_process directly to the terminal, which can expose sensitive reasoning, hidden prompts, secrets copied into reasoning state, or internal policy/debug data to anyone with terminal access or logs. In an agent framework, chain-of-thought disclosure is more dangerous than ordinary debug output because it may reveal internal decision logic and confidential intermediate content not intended for users.

    Content

    No source excerpt is available for this finding.

    Description-Behavior Mismatch

    Medium
    Category
    Not specified by scanner
    Confidence
    94% confidence
    Finding

    This code intentionally launches a local HTTP server and renders sensitive runtime state, including the prompt and thought-tree contents, into a browser-accessible page. Even though it binds to 127.0.0.1 by default, any local process, browser extension, malware, or user-triggered page that can reach localhost may read this internal agent data, creating confidentiality exposure for prompts, reasoning traces, and possibly other embedded secrets.

    Content

    No source excerpt is available for this finding.

    Unverifiable Dependency: pydantic has 4 known advisory(ies) (CVE-2021-29510 (Use of "infinity" as an input to datetime and date fields causes infinite loop i); CVE-2024-3772 (Pydantic regular expression denial of service); CVE-2021-29510 (Pydantic is a data validation and settings management using Python type hinting.) +1 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

    Low
    Category
    Supply Chain
    Confidence
    40% confidence
    Finding

    Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

    Content

    No source excerpt is available for this finding.

    Unverifiable Dependency: cryptography has 16 known advisory(ies) (GHSA-39hc-v87j-747x (Vulnerable OpenSSL included in cryptography wheels); CVE-2023-50782 (Python Cryptography package vulnerable to Bleichenbacher timing oracle attack); GHSA-537c-gmf6-5ccf (Vulnerable OpenSSL included in cryptography wheels) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

    Low
    Category
    Supply Chain
    Confidence
    40% confidence
    Finding

    Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

    Content

    No source excerpt is available for this finding.

    Unverifiable Dependency: PyYAML has 8 known advisory(ies) (CVE-2019-20477 (Deserialization of Untrusted Data in PyYAML); CVE-2020-1747 (Improper Input Validation in PyYAML); CVE-2020-14343 (Improper Input Validation in PyYAML) +5 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

    Low
    Category
    Supply Chain
    Confidence
    40% confidence
    Finding

    Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    91% confidence
    Finding

    This code contains natural-language comments/docstrings in Chinese, including the feature description at L08 and L25-L27, with no indication that language choice is configurable or user-selected. Under the stated policy, forcing a specific language without opt-in is a locale/language policy concern.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    96% confidence
    Finding

    The natural-language docstrings at L10-L18 are written only in Chinese, which imposes a specific language choice without any opt-in or justification. The policy explicitly calls for flagging language or locale constraints when the skill does not offer a user language choice or document a justified regional scope.

    Content

    No source excerpt is available for this finding.

    Missing User Warnings

    Low
    Category
    Not specified by scanner
    Confidence
    78% confidence
    Finding

    The code accesses BOT_MEMORY_DIR to determine where persistent memory files are stored. Access to environment-derived configuration that influences data storage is not explained via comments, docstrings, or user-facing output.

    Content

    No source excerpt is available for this finding.

    Natural-Language Policy Violations

    Low
    Category
    Not specified by scanner
    Confidence
    88% confidence
    Finding

    The docstrings are written only in Chinese, which indicates a fixed language choice without offering user selection or documenting a justified locale restriction. This can violate language/locale policy when the skill is not clearly scoped to a Chinese-only environment.

    Content

    No source excerpt is available for this finding.

    Static analysis

    No suspicious patterns detected.