Back to skill

Security audit

Reflection Engine

Security checks for vulnerabilities and agentic risk

Overview

This skill is a small local analyzer that reads an agent knowledge graph and prints recurring themes, with a minor undocumented log-file side effect.

Install only if you are comfortable letting the script read the configured knowledge_graph.json and print recurring concepts from DreamInsight descriptions. Before running, verify the hardcoded paths in tool.py and consider removing the unused file logging line if you want strictly read-only behavior.

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

Note
Location
tool.py:4
Finding

Undeclared Filesystem Write Through File-Based Logging

Content
View full analysis

Vulnerability Details

File Location: tool.py, line 4
Vulnerability Type: Undeclared filesystem write and violation of least-functionality expectations
Risk Level: Low

Vulnerable Code:

python
logging.basicConfig(filename='/home/albion/albion_memory/reflection.log', level=logging.INFO)

Technical Analysis

The skill metadata declares only permissions: [read], and its documented purpose requires reading and analyzing a knowledge graph. However, logging.basicConfig() configures the root logger with a file handler targeting the fixed path /home/albion/albion_memory/reflection.log.

During initialization, Python may create or open this file even though the script does not emit any log messages. This introduces an undocumented filesystem write outside the functionality required to analyze the knowledge graph. The hardcoded absolute path also couples the skill to another application's memory directory and may modify that directory when the process has sufficient operating-system permissions.

No evidence was found that the file is used to poison agent memory, establish persistence, store sensitive information, or execute attacker-controlled content. The issue is therefore an insecure coding and permission-declaration mismatch rather than a demonstrated malicious persistence mechanism.

Attack Path

  1. A user or agent invokes the skill with python3 tool.py.
  2. Python executes the module-level logging.basicConfig() call.
  3. The logging subsystem initializes a file handler for /home/albion/albion_memory/reflection.log.
  4. If the invoking process has write permission, the target log file may be created or opened despite the skill declaring only read permission.
  5. This causes an unexpected modification within the Albion memory directory.

Exploitation is limited by the operating-system privileges of the invoking process. The reviewed code does not provide a mechanism to elevate privileges ...[truncated 583 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove the unused file-based logging configuration because the script does not currently emit log records:
    python
    # Remove:
    logging.basicConfig(
        filename='/home/albion/albion_memory/reflection.log',
        level=logging.INFO
    )
    
  2. Remove the unused logging import after deleting the configuration.
  3. If logging is required in a future version, explicitly declare and document the required write permission.
  4. Avoid a hardcoded path in another application's memory directory. Accept a user-configured path or default to standard error for diagnostic output.
  5. Initialize file logging only when it is explicitly requested, validate the destination, and use restrictive file permissions.
  6. Keep the default execution path read-only so that the implementation matches the permission declaration and documented behavior.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (2)

Lp4

Low
Category
MCP Least Privilege
Confidence
65% confidence
Finding

Declared permissions with no matching code capability may indicate removed functionality or pre-staging for future abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill reads a local knowledge graph containing the agent's memory/dream data and processes it without any disclosure, consent flow, or minimization. Even though it only outputs aggregated top themes, it still performs analysis over potentially sensitive internal memory, which creates a privacy/transparency issue and could expose personal or confidential concepts if the output is shown to a user or logged elsewhere.

Content

No source excerpt is available for this finding.