T08 · Insecure Dependencies
Warning
- Location
- README.md:20
- Finding
- Unpinned Third-Party Dependency Installation## Vulnerability Details **File Location**: `README.md:20-24`; related runtime guidance at `scripts/applecal.py:40-44` **Vulnerability Type**: Unverified and unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash ### 1. Install the dependency ```bash pip3 install requests # optional (recommended off-macOS): pip3 install keyring ``` ``` The application also recommends installing the latest available package when the dependency is missing: ```python except ImportError: print(json.dumps({"error": "Missing dependency: requests. Run 'pip3 install requests'"})) sys.exit(1) ``` ### Technical Analysis The installation instructions retrieve `requests` and `keyring` from the user's configured Python package index without pinning reviewed versions or verifying package hashes. The effective dependency version can therefore change after the Skill has been audited. This creates a supply-chain exposure when an attacker compromises an upstream release, controls a configured package mirror, poisons a private index, or manipulates local pip configuration. A malicious dependency may execute code during installation or when imported by `scripts/applecal.py`. The Skill imports `requests` before processing commands and optionally imports `keyring` while resolving credentials. Consequently, malicious package code would execute with the same operating-system privileges and environment access as the Skill. ### Attack Path 1. An attacker compromises an upstream dependency release or a package index configured on the target system. 2. The user follows the documented `pip3 install requests` or `pip3 install keyring` instructions. 3. Because no version or hash is specified, pip retrieves the attacker-controlled release. 4. Malicious code executes during installation or when the package is imported. 5. The malicious dependency can access the Skill process environment, including `APPLECAL_PASSWORD`, and act with the user's local privileges. ### ...[truncated 537 chars]
- Remediation
- ## Remediation Suggestions 1. Add a reviewed dependency file with exact versions, for example: ```text requests==REVIEWED_VERSION keyring==REVIEWED_VERSION ``` 2. Generate and publish hashes for every approved distribution. 3. Require hash verification during installation: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Prefer a locked virtual environment rather than installing unspecified packages globally. 5. Document the expected package index and advise users to review pip index configuration. 6. Update the runtime error message to reference the locked requirements file rather than recommending an unpinned installation command. 7. Add an automated dependency review process for version updates and known vulnerabilities.
