T08 · Insecure Dependencies
Error
- Location
- SKILL.md:33
- Finding
- Unpinned External Dependencies Handle Reusable Twitter Authentication Cookies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 33–40 and 55–62 **Vulnerability Type**: Unpinned and externally sourced dependency with access to authentication credentials **Risk Level**: High ### Complete Code Snippet ```bash # Install rnet (Rust HTTP client with TLS fingerprint emulation) pip install "rnet>=3.0.0rc20" --pre # Required files: # 1. rnet_twitter.py — lightweight async Twitter GraphQL client # Get it: https://github.com/PHY041/rnet-twitter-client # 2. twitter_cookies.json — your auth cookies # Format: [{"name": "auth_token", "value": "..."}, {"name": "ct0", "value": "..."}] ``` ```python import asyncio, os from rnet_twitter import RnetTwitterClient async def search(query, count=200): client = RnetTwitterClient() cookies_path = os.environ.get("TWITTER_COOKIES_PATH", "twitter_cookies.json") client.load_cookies(cookies_path) tweets = await client.search_tweets(query, count=count, product="Top") return tweets ``` ### Technical Analysis The Skill directs users to install a pre-release dependency through the open-ended constraint `rnet>=3.0.0rc20` and to obtain `rnet_twitter.py` from an external GitHub repository without specifying an immutable commit, release artifact, checksum, or signature. This externally obtained code is imported into the Python process and receives direct access to a cookie file containing reusable Twitter session credentials, including `auth_token` and `ct0`. Python imports execute module-level code immediately, so a compromised or unexpectedly modified dependency would not need to wait for `load_cookies()` to misuse local privileges. The absence of dependency locking and integrity verification means the code executed during a future installation can differ from the code reviewed today. This is a supply-chain weakness; the available evidence does not establish that the named package or repository is currently malicious. ### Attack Path 1. An attacker compromises the pa ...[truncated 1460 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every Python dependency to an exact, reviewed version rather than using an open-ended pre-release constraint. 2. Use a lock file with cryptographic hashes and require hash verification during installation, such as `pip install --require-hashes`. 3. Pin the GitHub client to a reviewed immutable commit and verify the downloaded artifact against a documented SHA-256 digest or trusted signature. 4. Prefer vendoring the minimal reviewed client implementation into the Skill package when licensing permits, followed by routine security review and controlled updates. 5. Audit direct and transitive dependencies before deployment and use automated dependency vulnerability and provenance scanning. 6. Run the client in a sandbox or dedicated low-privilege environment with access only to the required cookie file and network destinations. 7. Use a dedicated Twitter account with the minimum necessary privileges. Revoke its active sessions immediately if dependency compromise is suspected. 8. Restrict cookie-file permissions to the Agent's operating-system account, avoid defaulting to a predictable working-directory file, and prevent credentials from appearing in logs or persisted reports. 9. Establish an explicit update process in which new dependency versions and repository commits are reviewed and tested before being accepted. ]]>
