T09 · Insecure Skill Coding Practices
- Location
scripts/download_and_chunk.py:9- Finding
Reusable Bilibili session cookies stored in a plaintext workspace file
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches a Bilibili subtitle-download purpose, but it asks users to log in and stores reusable session cookies in plaintext with incomplete disclosure and weak controls.
Review before installing. Use this only if you are comfortable authenticating a Bilibili account through the skill. Run it in a private, non-shared workspace, treat the generated cookie/session files as secrets, delete ~/.openclaw/workspace/bilibili_cookie.txt and any bilibili_cheese_session.json when finished, and avoid using it from synced or source-controlled directories until credential storage and URL validation are improved.
scripts/download_and_chunk.py:9Reusable Bilibili session cookies stored in a plaintext workspace file
scripts/cheese_downloader.py:79Cheese workflow stores authenticated session material in the current directory
scripts/download_and_chunk.py:87Unvalidated subtitle URL enables conditional SSRF and unbounded network retrieval
scripts/cheese_downloader.py:149Cheese subtitle downloader follows an unvalidated API-provided URL
The English description similarly overstates safe, simple subtitle processing while omitting authentication, cookie persistence, and input limitations. Such description-behavior mismatch is dangerous because it obscures sensitive operations and can lead users to scan a login QR code or expose account-linked data under the mistaken belief that the skill only processes a public video URL.
The English description similarly overstates safe, simple subtitle processing while omitting authentication, cookie persistence, and input limitations. Such description-behavior mismatch is dangerous because it obscures sensitive operations and can lead users to scan a login QR code or expose account-linked data under the mistaken belief that the skill only processes a public video URL.
The skill invokes local Python scripts that read and write files, access the network, and persist authentication material, yet the manifest does not declare any explicit tool scope or permissions. This weakens reviewability and containment because operators and automated policy systems cannot easily tell that the skill needs network access and local storage of sensitive session data.
The QR-code login step asks the user to authenticate the tool to their Bilibili account but does not explain that this grants the tool access to account-linked data and potentially paid or private content available through that session. In this skill context, that omission is more dangerous because the login is embedded inside a subtitle-downloading workflow that appears routine and low-risk.
The skill instructs that Bilibili cookies will be saved to ~/.openclaw/workspace/bilibili_cookie.txt but provides no warning that these cookies are authenticated session credentials. Storing them in a predictable local path without security guidance increases the risk of session theft, reuse by other tools, or accidental inclusion in logs, backups, or shared workspaces.
The script persists authenticated Bilibili session cookies to a JSON file on disk without warning, permission hardening, or lifecycle controls. Anyone with access to the working directory or logs/artifacts from the agent environment may be able to reuse those cookies to access the user’s account session.
The manifest says users provide a Bilibili BV number or URL to obtain video summaries, but this implementation only handles 'ep...' episode IDs, 'ss...' season IDs, or numeric IDs for Bilibili cheese content. That is a semantic mismatch between the advertised input model and the actual supported identifiers in code.
The script stores Bilibili authentication cookies in plaintext at a fixed path under the user's home directory without any warning, consent flow, or protection controls. If that file is read by another local process, user, backup system, or accidentally shared workspace, the account session can be reused to access the user's Bilibili account.
The script sends the user's Bilibili cookies in HTTP headers when calling remote API endpoints, which transmits sensitive authentication data over the network. There is no visible warning, confirmation, or explanatory comment informing the user that their authenticated session will be used for outbound requests.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return cookie_str
def get_video_info(bv_id, cookie):
url = "https://api.bilibili.com/x/web-interface/view"
params = {'bvid': bv_id}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return cookie_str
def get_video_info(bv_id, cookie):
url = "https://api.bilibili.com/x/web-interface/view"
params = {'bvid': bv_id}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return cookie_str
def get_video_info(bv_id, cookie):
url = "https://api.bilibili.com/x/web-interface/view"
params = {'bvid': bv_id}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
return cookie_str
def get_video_info(bv_id, cookie):
url = "https://api.bilibili.com/x/web-interface/view"
params = {'bvid': bv_id}
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36',
The subtitle selection logic explicitly prefers Chinese subtitles whenever available, and otherwise falls back silently, without offering the user a language choice. This is a natural-language locale policy issue because the behavior imposes a specific language preference without opt-in or explanation.
The script takes a subtitle URL from the Bilibili API response and fetches it without validating the host or scheme. Even though the expected source is Bilibili, a compromised API response, upstream service issue, or manipulated subtitle_url could cause the script to make unintended outbound requests, creating an SSRF-style primitive and potentially exposing the user's network environment.
if target_url.startswith('//'):
target_url = 'https:' + target_url
resp = requests.get(target_url)
body = resp.json().get('body', [])
full_text = "\n".join([b.get('content', '') for b in body])
return full_text
The manifest describes a skill for downloading Bilibili subtitles, chunking them for LLM processing, and generating summaries from a BV ID or URL. This file implements QR-code account login, persistent session-cookie storage, and a separate mode that lists course episodes by season/series ID instead of directly downloading subtitles, which expands the operational scope beyond the stated user-facing purpose.
The code preferentially selects subtitles whose language code contains zh, which imposes a language choice automatically. There is no user opt-in, configuration, or documented reason for forcing this locale preference.
The code fetches subtitle content from a remote subtitle URL, which is an outbound network operation tied to the user's requested video context. While network access is part of the script's purpose, there is no explicit disclosure in this file that subtitle data will be downloaded from remote endpoints.
No suspicious patterns detected.