T09 · Insecure Skill Coding Practices
- Location
SKILL.md:87- Finding
Plaintext Storage and Manual Extraction of Full-Access Session Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 87–110
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: MediumVulnerable Code Snippet
markdown ### Cookie 文件格式 创建 `cookies.json`,结构如下: ```json { "qq_number": "123456789", "p_skey": "your_p_skey_value", "skey": "your_skey_value", "uin": "o0123456789" }获取方式
- 推荐:使用
--action login扫码登录,Cookie 自动保存 - 手动:登录后,通过浏览器开发者工具(F12 → Application → Cookies)提取
🔒 安全与隐私
- Cookie 文件包含 QQ空间完整访问权限,请勿泄露或分享
- 凭证仅存储在本地,不会上传到任何服务器
text ### Technical Analysis The Skill instructs users to extract authentication cookies manually or save them automatically in a plaintext `cookies.json` file. The documented fields include `p_skey`, `skey`, and `uin`, which collectively represent sensitive QQ session credentials. The documentation explicitly states that the cookie file grants complete access to the user's QQ Zone. No controls are specified for owner-only file permissions, operating-system credential storage, encryption at rest, secret redaction, expiration cleanup, repository exclusion, or protection from backups and synchronization services. Storing reusable session credentials in an ordinary JSON file makes them accessible to other processes operating under the same account and creates a risk of accidental disclosure through source control, shared directories, cloud synchronization, logs, or backups. The statement that credentials remain local does not mitigate local disclosure and cannot be independently verified because the referenced implementation file, `scripts/qzone_photos.py`, is absent from the audited package. ### Attack Path 1. A user follows the Skill instructions and authenticates through QR login or manually extracts `p_skey`, `skey`, and related cookie values. 2. The credentials are stored unencrypted in `cookies.json`. 3. The file is created with permissive inher ...[truncated 1127 chars]- 推荐:使用
- Remediation
View remediation
Remediation Suggestions
- Store session credentials in an operating-system credential manager, such as macOS Keychain, Windows Credential Manager, or Linux Secret Service, instead of a plaintext JSON file.
- If a cookie file is unavoidable, create it with owner-only permissions from the outset, such as mode
0600on Unix-like systems, and reject files readable by other users. - Add
cookies.jsonand equivalent credential files to.gitignoreand provide a non-secret example file containing placeholders only. - Avoid recommending manual extraction of browser cookies. Use a constrained authentication flow that retrieves only the credentials required for the requested operation.
- Never print cookie values in command output, errors, debug logs, or Agent responses. Apply explicit redaction to
p_skey,skey, and other session identifiers. - Store credentials outside the project and download-output directories to reduce accidental inclusion in archives, synchronization, or source-control commits.
- Delete expired credentials securely and provide a documented logout or revocation procedure.
- Warn users against placing the credential file in shared folders, cloud-synchronized locations, or backups without encryption.
- Include the referenced implementation in the package so its credential storage, network destinations, TLS validation, and logging behavior can be independently audited.
