T08 · Insecure Dependencies
- Location
SKILL.md:33- Finding
Unverified Python Module Loaded from a Hard-Coded External Directory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 33-34
Vulnerability Type: Insecure dependency loading and Python import-path manipulation
Risk Level: MediumVulnerable Code
python import sys; sys.path.insert(0, r'D:\coze-local\db') from collaborative_agent import ARCWorkflow, AgentRoleTechnical Analysis
The documented usage inserts a machine-specific external directory at the beginning of
sys.pathbefore importingcollaborative_agent. Because the inserted directory has the highest import precedence, Python will load a matching module or package from that location instead of a trusted or installed version.Importing a Python module executes its top-level initialization code. The project does not include the referenced implementation and does not specify a trusted package source, pinned version, cryptographic integrity verification, or expected file hash. Consequently, the behavior of the imported component cannot be verified from the audited project.
Exploitation requires an attacker to create or modify a matching module in
D:\coze-local\db, or otherwise control the contents resolved through that path. This is an unsafe dependency-loading pattern and supply-chain boundary rather than evidence that the missing module is itself malicious.Attack Path
- A user follows the usage instructions from
SKILL.md. - An attacker gains write access to
D:\coze-local\db, compromises its provisioning source, or persuades the user to place attacker-controlled files there. - The attacker creates
collaborative_agent.pyor acollaborative_agentpackage containing malicious top-level Python code. sys.path.insert(0, ...)gives the attacker-controlled location precedence over normal Python package locations.- The
from collaborative_agent import ...statement loads the substituted module and executes its initialization code. - The malicious code runs with the permissions and ...[truncated 650 chars]
- A user follows the usage instructions from
- Remediation
View remediation
Remediation Suggestions
- Remove direct
sys.pathmodification and import the component through Python's standard package-resolution mechanism. - Bundle the required implementation within the reviewed Skill package when feasible so its behavior is included in security review.
- If the component must remain external, distribute it through an authenticated, trusted package registry and pin an exact version and integrity hash.
- Use a lock file or hash-enforced installation process, such as
pip install --require-hashes, to prevent silent dependency substitution. - Document the expected package origin, version, installation procedure, and integrity value.
- Ensure dependency directories are not writable by untrusted users and avoid running the workflow with administrative privileges.
- Perform a separate security review of
collaborative_agentand its transitive dependencies before enabling the documented automatic capability execution.
- Remove direct
