T09 · Insecure Skill Coding Practices
- Location
update_viewer.py:331- Finding
Excessive Collection and Propagation of the Complete Browser Cookie Set
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does the advertised Bilibili update lookup, but it asks users to provide their full Bilibili browser cookies for a read-only viewer task without adequate scoping or warning.
Review before installing. Use only if you are comfortable giving the tool Bilibili session cookies; treat BILIBILI_COOKIES like an account credential, avoid pasting it into chats or logs, and clear or rotate it when done. Be aware that searches create a local user_cache.json with public uploader metadata, and dependency installation is not pinned.
update_viewer.py:331Excessive Collection and Propagation of the Complete Browser Cookie Set
requirements.txt:1Unbounded and Unverified Third-Party Dependency Installation
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
.venv/
# 包含敏感信息的文件
.env
*.env
# 用户搜索缓存
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
.venv/
# 包含敏感信息的文件
.env
*.env
# 用户搜索缓存
The declared purpose understates important behaviors: username-based search, persistent local caching, and use of Bilibili cookies as authentication material. This mismatch can mislead users and reviewers about data handling and privilege needs, increasing the chance that sensitive credentials are provided without informed consent and that local data persistence occurs unexpectedly.
The skill instructs users to export full Bilibili cookies, which are highly sensitive session credentials that may allow account access, impersonation, or disclosure of private account data if mishandled. The guidance does not adequately warn users about the sensitivity of these tokens, their scope, storage risk, or safer alternatives, making credential theft or accidental leakage more likely.
The skill invokes Python scripts, requires environment variables containing credentials, performs network access to Bilibili APIs, and is described as using local cache files, yet it declares no explicit tool scope or permission boundaries. This weakens sandboxing and user visibility, making it easier for a skill with credential and filesystem access to overreach beyond its stated purpose.
L03 将“B站、UP主、视频更新、今天更新了吗、最新视频、最新动态、查看UP主”都作为触发词,其中“最新视频”“最新动态”“今天更新了吗”等短语过于通用,缺少上下文限定,容易在普通对话中与非本技能请求重叠。该描述也没有提供排除条件或负面示例来界定何时不应激活技能。
The client accepts raw authenticated Bilibili cookies and automatically attaches them to all requests without any visible warning, minimization, or consent flow. If users provide active session cookies, the skill can perform authenticated requests and access account-scoped data, creating a privacy and account-security risk if the cookies are over-collected, mishandled, or reused outside the user's expectation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if self._img_key and self._sub_key:
return self._img_key, self._sub_key
resp = self.session.get("https://api.bilibili.com/x/web-interface/nav")
data = resp.json()
if data["code"] != 0:
The skill includes subtitle enumeration, download, and text extraction capabilities that exceed the stated purpose of checking whether a B站 UP主 has recent videos or dynamics. This unnecessary scope expansion increases data access and external request surface, and could expose or process more user/content data than users would reasonably expect from the manifest.
The skill requires raw Bilibili cookies from the environment to perform a viewer-style task, which introduces handling of session credentials far beyond what users would expect from simply checking an uploader's latest content. Even if the code does not obviously exfiltrate the cookies, collecting authenticated session material increases the blast radius if logs, subprocesses, dependent libraries, or future modifications expose them.
Requesting sensitive cookie credentials through an environment variable without meaningful disclosure can mislead users into supplying full authenticated session data for a low-risk viewer task. This creates avoidable privacy and account-security risk because users may not realize the credential sensitivity or how broadly those cookies may authorize actions outside this script's stated purpose.
The display name is written specifically in Chinese ("B站 (bilibili) 更新查看") with no indication that the skill supports other languages or that the locale restriction is intentional and documented. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.
The method get_video_subtitle_text sets prefer_lang to "zh" by default and the comments explicitly state a preference for Chinese subtitles. This imposes a language default in natural-language behavior without offering an explicit user choice or documenting an opt-in mechanism.
The dependency specification uses a lower-bound only constraint (requests>=2.28.0), which makes builds non-reproducible and can pull in unexpected future releases with breaking changes or newly introduced security issues. In a security context, unpinned dependencies also make it impossible to verify exactly which version will be installed and whether known advisories apply.
requests>=2.28.0
Because requests is not pinned, the manifest does not establish whether installation will use a version affected by one of the known advisories associated with this package. This uncertainty is a supply-chain risk: depending on resolution time and environment, the skill may install a vulnerable release and expose consumers to issues such as credential leakage or TLS/request-validation flaws present in some historical versions.
The stated skill purpose is to view a Bilibili uploader's latest content and check whether they updated today. In addition to that, the code creates and maintains a local JSON cache of search results and supports fuzzy user lookup, which is extra behavior not mentioned in the manifest description.
The script persistently writes searched user/profile data to a local JSON cache without clear user notice or consent. While the cached fields appear to be public-facing metadata rather than secrets, undisclosed local persistence can still create privacy, transparency, and data-retention concerns in shared or managed environments.
No suspicious patterns detected.