T08 · Insecure Dependencies
- Location
scripts/generate_mascot.py:29- Finding
Untrusted and Unpinned Sibling Skill Module Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/generate_mascot.py, lines 29–30
Vulnerability Type: Unverified external Python dependency loaded through path manipulation
Risk Level: Highpython # Import chromakey from sibling skill sys.path.insert(0, str(Path(__file__).parent.parent.parent / "transparent-image-gen" / "scripts")) from chromakey_despill import chromakey_with_despillTechnical Analysis
The script prepends a directory belonging to a separate sibling skill to
sys.pathand then importschromakey_despillfrom that location. Python executes module-level code immediately during an import.The imported module is not included in this project, pinned to a reviewed version, or subject to an integrity check. Consequently, this project's behavior depends on mutable code outside its audited package boundary. Prepending the directory also gives that location priority during module resolution.
This is a supply-chain and local module-substitution weakness. An attacker who can publish, install, create, or replace the expected sibling skill can introduce arbitrary Python statements into
chromakey_despill.py. Those statements execute as soon asgenerate_mascot.pyis loaded, before image generation begins.Attack Path
- The attacker gains control over, compromises, or supplies the sibling
transparent-image-genskill. - The attacker places malicious code in:
transparent-image-gen/scripts/chromakey_despill.py. - A user or agent invokes the mascot generator or imports
generate_mascot.py. - The script inserts the sibling directory at the beginning of
sys.path. - Python resolves and imports the attacker-controlled
chromakey_despillmodule. - The malicious module's top-level code executes with the same permissions and environment as the agent process.
Impact Assessment
Successful exploitation provides arbitrary Python code execution under the account running the ...[truncated 479 chars]
- The attacker gains control over, compromises, or supplies the sibling
- Remediation
View remediation
Remediation Suggestions
- Remove the runtime
sys.pathmodification. - Vendor the required chromakey implementation into this project and include it in the normal review process, or publish it as a properly packaged dependency.
- Pin the dependency to an exact reviewed version and verify its cryptographic hash during installation.
- Use an isolated virtual environment with a locked dependency manifest.
- If a sibling skill must be supported, resolve it through a trusted registry and verify its path, ownership, version, and integrity before importing it.
- Avoid importing mutable code from user-writable shared directories.
- Run the skill with least privilege and provide only the credentials and filesystem access needed for image generation.
- Remove the runtime
