T08 · Insecure Dependencies
Warning
- Location
- scripts/ig_golden_hour.py:1
- Finding
- Unpinned Runtime Dependency Creates Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ig_golden_hour.py`, lines 1-3 **Vulnerability Type**: Unrestricted third-party dependency resolution **Risk Level**: Medium ### Code Snippet ```python # /// script # dependencies = ["requests"] # /// ``` The documented invocation in `SKILL.md`, lines 20-25, causes `uv` to resolve this dependency at runtime: ```bash uv run {baseDir}/scripts/ig_golden_hour.py \ --media_id "12345678901234567" \ --keyword "bot" \ --dm_text "Here is the link you requested: https://example.com" \ --duration 60 ``` ### Technical Analysis The inline dependency declaration specifies `requests` without an exact version, lockfile, or integrity hash. Consequently, the package version installed by `uv run` can change over time without any corresponding change to the audited Skill. This does not establish that the current `requests` package is malicious. However, mutable dependency resolution creates a supply-chain exposure: a compromised upstream release, package repository, dependency, or package-resolution configuration could introduce code that was not included in the static audit. Imported Python packages execute inside the same process as the Skill. In this case, that process can access `IG_ACCESS_TOKEN`, `IG_ACCOUNT_ID`, command-line arguments, and the current user's filesystem and network privileges. ### Attack Path 1. An attacker compromises an upstream package release, transitive dependency, configured package index, or dependency-resolution environment. 2. The user invokes the documented `uv run` command. 3. `uv` resolves and installs the attacker-controlled or compromised package version because no audited version or hash is enforced. 4. The package executes during `import requests`. 5. Malicious initialization code reads Instagram credentials from the environment or performs other actions allowed by the local user. 6. The captured credentials may then be exfiltrated and used for unauthorized ...[truncated 648 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `requests` to a specifically reviewed version rather than using an unrestricted package name. 2. Create and commit a lockfile that records all transitive dependency versions. 3. Enforce package hashes or another integrity-verification mechanism during installation. 4. Resolve dependencies only from an explicitly configured, trusted package index. 5. Run automated dependency vulnerability and provenance checks in CI. 6. Execute the Skill in a restricted environment with access only to the credentials, files, and network destinations required for its operation. 7. Regularly review and deliberately update pinned dependencies rather than allowing implicit runtime upgrades. ]]>
