T08 · Insecure Dependencies
- Location
scripts/fortune_fusion.py:12- Finding
Unverified External Python Code Execution
- Content
View full analysis
Vulnerability Details
File Location:
scripts/fortune_fusion.py, lines 12–18
Vulnerability Type: Unverified execution of an external sibling dependency
Risk Level: MediumVulnerable Code
python target = ( Path(__file__).resolve().parents[2] / "destiny-fusion-pro" / "scripts" / "fortune_fusion.py" ) runpy.run_path(str(target), run_name="__main__")Technical Analysis
The compatibility wrapper constructs a path outside the audited project and executes the referenced Python file in-process through
runpy.run_path. It does not validate the target's ownership, integrity, version, cryptographic digest, or location within an approved dependency root.The delegated file is therefore part of the effective executable payload despite not being included in the reviewed project. An attacker who can create or replace the expected sibling file can cause arbitrary Python code to run when this wrapper is invoked. Because
runpy.run_pathexecutes the target in the current Python process, the delegated code inherits the wrapper's operating-system identity, environment, accessible files, and available network permissions.Attack Path
- The attacker obtains write access to the directory containing the expected
destiny-fusion-prosibling project or otherwise controls how that dependency is installed. - The attacker creates or replaces
destiny-fusion-pro/scripts/fortune_fusion.pywith malicious Python code. - A user or automation invokes
scripts/fortune_fusion.py, including through the command documented inSKILL.md. - The wrapper resolves the attacker-controlled sibling path without performing an integrity or trust check.
runpy.run_pathexecutes the substituted file as__main__.- The malicious code operates with the same privileges and resource access as the invoking process.
Impact Assessment
Successful exploitation permits arbitrary code execution under the operating-system account running the sk ...[truncated 456 chars]
- The attacker obtains write access to the directory containing the expected
- Remediation
View remediation
Remediation Suggestions
- Package the required implementation inside the reviewed skill so that all executable code is included in the same integrity and review boundary.
- If an external dependency is necessary, install it through a controlled package mechanism with an exact version and verified hashes.
- Resolve delegated code only from a configured, trusted root rather than deriving an implicitly trusted sibling path.
- Before execution, verify the target is a regular file, resolves beneath the approved root, and matches a pinned cryptographic digest or signed release.
- Reject symbolic links and unexpected ownership or permission states where the deployment model permits those checks.
- Fail closed with a clear error if the dependency is absent or any validation fails.
- Prefer importing a narrowly scoped, versioned API over executing an entire external file as
__main__. - Ensure the process runs with least privilege to reduce the impact of any future dependency compromise.
