T09 · Insecure Skill Coding Practices
- Location
source_text/init_context_os.py.txt:746- Finding
Arbitrary Python Code Injection Through Generated Server Name
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent portable memory-system builder, but it needs Review because its generated MCP server can mutate or delete durable memory and its source generation can turn an unsafe server name into Python code execution.
Use this only in an isolated workspace you are willing to modify. Keep the generated server on STDIO or localhost unless you add authentication and authorization, do not expose streamable HTTP to untrusted clients, avoid untrusted or unusual names for --name and --server-name, pin dependencies before installing, and back up any existing directory before scaffolding into it.
source_text/init_context_os.py.txt:746Arbitrary Python Code Injection Through Generated Server Name
source_text/init_context_os.py.txt:343Unauthenticated Persistent Memory Read, Modification, and Deletion Operations
source_text/init_context_os.py.txt:288Unpinned MCP Dependency Allows Unreviewed Future Releases
The skill clearly directs the agent to read files, write workspace artifacts, and execute shell commands, but it does not declare any explicit tool scope or permission boundaries. This creates an authorization ambiguity where an orchestrator or user may not realize the skill can modify the filesystem and invoke commands, increasing the chance of unintended or over-broad execution.
The skill instructs the agent to create a durable context vault, memory objects, artifacts, and governance files on disk, but it never requires an explicit user-facing warning or consent before storing potentially sensitive long-lived data. In a memory-oriented skill, this is more dangerous because users may provide personal, organizational, or regulated context that persists beyond the current session without clear acknowledgement.
The skill says to install runtime dependencies if the user wants the server fully runnable, but it does not require a separate confirmation or provide safety constraints around package installation. Installing dependencies changes the execution environment and can introduce supply-chain risk, especially when combined with generated code and shell execution instructions.
This code creates directories and writes a JSON manifest derived from the workspace, including file listings and metadata from memory objects. Although it prints the output path afterward, there is no prior user-facing warning in the code comments, docstring, or prompt that the generated bundle manifest may capture sensitive workspace structure and should be reviewed before sharing.
The generated server intentionally exposes create, update, delete, and bundle-building operations over workspace files, but the embedded descriptions do not prominently warn operators that connecting this MCP server grants remote mutation of durable local context files. In an agent setting, this increases the chance that a host or user enables the server without understanding that clients can modify or delete memory objects, which can lead to unauthorized data tampering or loss.
The scaffold resolves and creates the target directory, then unconditionally writes many files and chmods executables into it without checking whether the directory already contains user data or warning before overwriting. If pointed at an existing workspace, this can clobber configuration, scripts, or policy files and silently alter executable content, causing integrity loss and possibly changing downstream behavior.
The template uses a generic placeholder, "[WHEN TO LOAD]," for the retrieval trigger without requiring concrete trigger phrases, scope boundaries, or exclusion conditions. In a manifest-like markdown template, this can lead to overly broad or ambiguous activation behavior when the template is instantiated.
pip install without ==version installs the latest release, which could include malicious changes.