T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/smb-auto-subtitle.py:19
- Finding
- Hard-Coded SMB, qBittorrent, Jackett, and OpenSubtitles Credentials<![CDATA[ ## Vulnerability Details **File Location**: `scripts/smb-auto-subtitle.py:19-32` **Vulnerability Type**: Hard-coded credentials and API keys **Risk Level**: High ### Technical Analysis The package embeds operational SMB credentials and an OpenSubtitles API key directly in source code: ```python # SMB configuration SMB_CONFIG = { "username": "13917908083", "password": "Roger0808", "server_name": "Z4ProPlus-X6L8", "server_ip": "192.168.1.246", "share_name": "super8083", "remote_path": "qb/downloads" } # OpenSubtitles configuration OPENSUBTITLES_API_KEY = "CBfNpndpF56j2TsGJuaicd8AAwx0rS2R" OPENSUBTITLES_API = "https://api.opensubtitles.com/api/v1" ``` The same SMB password is replicated in `config/smb.env` and numerous scripts. Jackett and qBittorrent credentials are also embedded in `SKILL.md` and shell-script defaults, including: ```bash JACKETT_API_KEY="${JACKETT_API_KEY:-o5gp976vq8cm084cqkcv30av9v3e5jpy}" QB_USERNAME="${QB_USERNAME:-admin}" QB_PASSWORD="${QB_PASSWORD:-adminadmin}" SMB_PASSWORD="${SMB_PASSWORD:-Roger0808}" ``` Because the project is a distributable Skill package, anyone who can download the package, inspect build artifacts, access logs containing its source, or read a deployed installation receives reusable credentials. Environment-variable overrides do not mitigate the issue because working defaults remain embedded. The pre-scan-targeted OpenSubtitles behavior sends the embedded API key to `https://api.opensubtitles.com/api/v1` in the `Api-Key` header. That destination is consistent with subtitle retrieval, and no SMB password transmission to OpenSubtitles was identified. Nevertheless, embedding the API key makes it public and reusable by unrelated parties. ### Attack Path 1. An attacker obtains the Skill package or reads a deployed copy. 2. The attacker extracts the plaintext SMB password, qBittorrent password, Jackett key, and OpenSubtitles key. 3. If the NAS or services are reachable from the attac ...[truncated 871 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Immediately rotate all exposed SMB, qBittorrent, Jackett, and OpenSubtitles credentials. 2. Remove every credential default from source code, documentation, generated scripts, and `config/smb.env`. 3. Require credentials through environment variables or a dedicated secret manager and fail closed when they are absent. 4. Provide only a redacted template such as `config/smb.env.example`. 5. Add the real environment file to version-control and packaging exclusion rules. 6. Use separate, narrowly scoped service accounts: - Restrict the SMB account to the required media directories. - Disable SMB deletion if the subtitle workflow only needs read and create permissions. - Restrict qBittorrent and Jackett to trusted management networks. 7. Add secret scanning to CI and release checks to prevent recurrence. 8. Avoid accepting passwords through command-line flags because process listings and shell history can expose them. ]]>
