T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:980
- Finding
- Unpinned Third-Party Automation Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:980` and `SKILL.md:999-1001`; corresponding runtime guidance in `automation_helper.py:104-106` **Vulnerability Type**: Unpinned third-party dependencies installed from a mutable package index **Risk Level**: Medium ### Vulnerable Code `SKILL.md:978-981`: ```bash ### Optional (for auto-send) ```bash pip install pyautogui pyperclip ``` ``` `SKILL.md:997-1002`: ```bash ### Prompt Not Sent Install pyautogui: ```bash pip install pyautogui pyperclip ``` ``` `automation_helper.py:104-106`: ```python if not PYAUTOGUI_AVAILABLE: print("❌ 需要安装 pyautogui 和 pyperclip") print(" 运行: pip install pyautogui pyperclip") ``` ### Technical Analysis The installation instructions do not pin package versions, verify package hashes, or specify a trusted package repository. Consequently, the code imported under the names `pyautogui` and `pyperclip` depends on whatever distributions the user's active pip configuration resolves at installation time. Python packages can execute code during installation and later during import. The application imports both packages at module initialization: ```python try: import pyautogui import pyperclip PYAUTOGUI_AVAILABLE = True except ImportError: PYAUTOGUI_AVAILABLE = False ``` This creates a supply-chain exposure: a compromised upstream release, maliciously configured package index, or dependency-resolution attack could introduce code that was not part of the audited project. ### Attack Path 1. An attacker compromises a relevant package release or causes the victim's pip client to resolve packages from an untrusted or malicious index. 2. The user follows the documented command: ```bash pip install pyautogui pyperclip ``` 3. pip downloads and installs the attacker-controlled distribution because no version or cryptographic hash is enforced. 4. Malicious installation logic may run immediately, or malicious module code runs when `automation_ ...[truncated 750 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Add a reviewed dependency lock file with exact versions, for example: ```text pyautogui==<reviewed-version> --hash=sha256:<reviewed-hash> pyperclip==<reviewed-version> --hash=sha256:<reviewed-hash> ``` 2. Install dependencies with hash verification: ```bash python -m pip install --require-hashes -r requirements.txt ``` 3. Explicitly document the trusted package index and disable unintended fallback indexes where practical: ```bash python -m pip install \ --index-url https://pypi.org/simple \ --require-hashes \ -r requirements.txt ``` 4. Review transitive dependencies and update the lock file through a controlled dependency-review process. 5. Recommend installation inside a dedicated virtual environment rather than a privileged or system-wide Python environment. 6. Replace the unpinned installation commands in both `SKILL.md` and the runtime error message with the locked installation procedure. ]]>
