T08 · Insecure Dependencies
- Location
scripts/eval-skill.py:25- Finding
Unmanaged Third-Party YAML Dependency Contradicts Self-Contained Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/eval-skill.py:25
Vulnerability Type: Unmanaged third-party dependency and unsafe ambient module resolution
Risk Level: MediumVulnerable Code
python import argparse import ast import json import os import re import sys import yamlTechnical Analysis
The evaluator imports the third-party
yamlmodule, provided in typical environments by PyYAML. However, the project does not include a dependency manifest, version constraint, lockfile, package hash, or documented trusted installation source. This conflicts with the documented claim that the evaluator is self-contained and uses no external dependencies.Python resolves imports from its runtime search path. Consequently, the script may load an incompatible, compromised, dependency-confusion-supplied, or locally shadowed
yamlmodule. Imported Python modules execute their top-level code immediately, before the evaluator processes the target Skill. Although the audited project does not itself install a malicious dependency, it relies on an unmanaged ambient package and therefore cannot ensure the integrity of the code executed under theyamlname.The later use of
yaml.safe_loadreduces risks associated with unsafe YAML object deserialization, but it does not protect against malicious code executing when theyamlmodule is initially imported.Attack Path
- A user prepares an environment to run
scripts/eval-skill.py. - A malicious or compromised package providing the
yamlmodule is introduced into that environment, or an attacker places a shadowingyaml.pyoryamlpackage in a location searched before the legitimate PyYAML installation. - The user invokes
python3 scripts/eval-skill.py <skill-path>. - Python resolves
import yamlto the attacker-controlled module. - The module's top-level code executes immediately with the privileges and environment of the us ...[truncated 754 chars]
- A user prepares an environment to run
- Remediation
View remediation
Remediation Suggestions
- Explicitly declare PyYAML in a dependency manifest and pin it to a reviewed version.
- Use a reproducible lockfile with cryptographic hashes, such as a hash-locked
requirements.txt, and install only from a trusted package index. - Run the evaluator in an isolated virtual environment rather than relying on packages from the user's ambient Python environment.
- Consider replacing PyYAML with a minimal bundled frontmatter parser if the project must remain genuinely self-contained.
- Correct the documentation if an external dependency remains required, including the exact package name, supported version, and trusted installation procedure.
- Avoid adding untrusted directories to
PYTHONPATH, and execute the evaluator from a controlled, non-writable installation directory to reduce module-shadowing exposure. - Add automated dependency auditing and integrity verification to the release process.
