T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- references/cookie-guide.md:5
- Finding
- Collection of Unrelated Douyin Authentication Credentials<![CDATA[ ## Vulnerability Details **File Location**: `references/cookie-guide.md:5-30`; also repeated in `SKILL.md:93-96` **Vulnerability Type**: Unnecessary credential collection and violation of least privilege **Risk Level**: High ### Vulnerable Documentation Segment The following is an English translation of the relevant instructions: ```text 1. Open Chrome/Edge and visit www.douyin.com (note that this is not bilibili.com). 2. Open Developer Tools and select the Network tab. 3. Select a request and copy the complete Cookie header. Alternatively, obtain cookies from: Application → Cookies → https://www.douyin.com Collect sessionid, SESSDATA, uid_tt, and ttwid. Example cookie entries: .douyin.com TRUE / FALSE 0 sessionid your-session-id .douyin.com TRUE / FALSE 0 uid_tt your-user-id douyin.com FALSE / FALSE 0 ttwid your-token ``` ### Technical Analysis The Skill downloads Bilibili favorites and communicates with Bilibili endpoints. It has no legitimate functional requirement for Douyin authentication credentials such as `sessionid`, `uid_tt`, or `ttwid`. The guide nevertheless explicitly directs users to extract a complete Cookie header from `douyin.com`. A complete Cookie header may contain multiple authentication, tracking, and session-management tokens beyond anything required by this Skill. The downloaded script passes the supplied cookie file to Bilibili and `yt-dlp`. Browser-style cookie domain restrictions should normally prevent `.douyin.com` cookies from being sent to Bilibili, and the audited code does not explicitly transmit the file to an attacker-controlled endpoint. Nevertheless, collecting and persistently storing unrelated account credentials violates least-privilege principles and needlessly expands the consequences of local file disclosure. The guide also incorrectly combines Douyin cookie names with Bilibili credentials such as `SESSDATA`, making it more likely that users will export credentials fro ...[truncated 1250 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace every reference to `douyin.com` with the correct Bilibili domain. 2. Remove all requests for Douyin-specific credentials, including `sessionid`, `uid_tt`, and `ttwid`. 3. Request only the minimum Bilibili cookies required for private-favorites access. 4. Do not instruct users to copy an entire Cookie header when a narrower export is sufficient. 5. Provide a correct Netscape-format example containing only `.bilibili.com` entries. 6. Instruct users to restrict cookie-file permissions: ```bash chmod 600 /path/to/cookie.txt ``` 7. Recommend storing the cookie in a user-owned configuration directory rather than a shared or system-wide path. 8. Correct the duplicated Douyin instructions in `SKILL.md:93-96`. 9. Clearly state that authentication cookies must never be committed to source control, included in logs, or shared in support requests. ]]>
