Back to skill

Security audit

Bilibili Up To Kb

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent Bilibili transcription purpose, but it needs Review because it can automatically use Chrome cookies, send transcripts to an external LLM, and contains a title-handling bug that can execute attacker-controlled code.

Review and patch before installing. Do not run this against untrusted Bilibili URLs until transcribe.sh stops embedding video titles into Python source. Disable or gate Chrome cookie access behind explicit user consent, preferably using a dedicated browser profile or cookie file. Treat transcript cleaning as remote disclosure to an external model, and avoid it for private, paid, confidential, or sensitive media unless that data flow is acceptable.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/transcribe.sh:47
Finding

Remote video title enables Python code injection

Content
View full analysis
/dev/null || echo "") fi ``` ```bash if [ -n "$TITLE" ]; then SAFE_TITLE=$(sanitize "$TITLE") FILE_BASE="${VIDEO_ID}_${SAFE_TITLE}" echo " Title: $TITLE" fi ``` ```bash if [ -n "$META_JSON" ] && [ "$META_JSON" != "{}" ]; then echo "$META_JSON" | python3 -c " import sys, json d = json.load(sys.stdin) out = { 'bvid': d.get('id',''), 'title': d.get('title',''), 'uploader': d.get('uploader',''), 'uploader_id': d.get('uploader_id',''), 'description': d.get('description',''), 'duration': d.get('duration',0), 'upload_date': d.get('upload_date',''), 'view_count': d.get('view_count',0), 'like_count': d.get('like_count',0), 'tags': d.get('tags',[]), 'url': d.get('webpage_url',''), 'filename_base': '$FILE_BASE' } json.dump(out, sys.stdout, ensure_ascii=False, indent=2) " > "$OUT_DIR/${FILE_BASE}.meta.json" 2>/dev/null fi ``` ### Technical Analysis The video title is obtained from remotely controlled `yt-dlp` metadata and incorporated into `FILE_BASE`. The `sanitize` function only removes characters considered invalid in filenames: ```bash sanitize() { echo "$1" | sed 's/[\/\\:*?"<>|]/_/g' | sed 's/ */ /g' | head -c 120 } ``` It does not remove or encode apostrophes, semicolons, newlines, or other Python syntax. The resulting value is interpolated directly into a dynamically constructed `python3 -c` program: ```python 'filename_base': '$FILE_BASE' ``` A malicious title containing an apostrophe can terminate this Python string literal and introduce additional Python statements or expressions. Those statements execute under the identity ...[truncated 1490 chars]
Remediation
View remediation
"$OUT_DIR/${FILE_BASE}.meta.json" ``` Additional hardening should include: 1. Use `printf '%s'` instead of `echo` when processing arbitrary metadata. 2. Normalize or reject control characters and newlines in filenames. 3. Apply an explicit filename allowlist and deterministic length limit. 4. Test titles containing quotes, newlines, shell metacharacters, and Unicode control characters. 5. Run media-processing scripts in a restricted environment without unnecessary credentials or write access. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/clean_transcript.sh:13
Finding

Transcript contents are transmitted to an external LLM without explicit consent

Content
View full analysis
"$JSONOUT" 2>/dev/null || true ``` The declared workflow also directs users to run remote cleaning: ```bash scripts/batch_clean.sh ./kb/UP主名_UID/ ``` ### Technical Analysis The cleaning script reads each transcript chunk into `CHUNK_TEXT` and supplies the complete text as a prompt to the OpenCode CLI using the external `opencode/minimax-m2.5-free` model. Although Whisper transcription is performed locally, the cleaning phase is not local. Transcript content may include private speech, member-only media, personal information, unpublished material, or other sensitive content. The workflow does not require affirmative consent immediately before disclosure, clearly identify the external recipient and its data-handling implications, or default to a local-only mode. The operation is functionally relevant to AI-based proofreading, but it exceeds the minimum privileges needed for transcription and local knowledge-base generation. Remote disclosure should be an explicit, separately authorized capability. The script also defaults to processing all chunks concurrently when concurrency is zero. This can rapidly transmit an entire corpus before the user can detect or stop unintended disclosure. ### Attack Path 1. A user transcribes a private, restricted, or otherwise sensitive video. 2. The raw transcript is stored in the knowledge base's `.raw` directory. 3. Following the documented workflow, the user runs `batch_clean.sh`. 4. `batch_clean.sh` invokes `clean ...[truncated 794 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/batch_channel.sh:20
Finding

Unauthenticated lookup failure automatically triggers Chrome cookie access

Content
View full analysis
/dev/null 2>&1; then echo "Direct access failed, trying with browser cookies..." COOKIES_ARG="--cookies-from-browser chrome" fi ``` The cookie argument is then reused for channel and video operations, including: ```bash TOTAL_ESTIMATE=$(yt-dlp $COOKIES_ARG --flat-playlist --print id "$CHANNEL" 2>/dev/null | wc -l || echo "0") ``` and is passed to parallel transcription jobs: ```bash export COOKIES_ARG cat "$FILTERED" | xargs -P "$CONCURRENCY" -I {} "$SCRIPT_DIR/transcribe.sh" "{}" "$OUT_DIR" "$LANG" "$COOKIES_ARG" ``` ### Technical Analysis Any failure of the initial unauthenticated `yt-dlp` request causes the script to invoke `yt-dlp` with `--cookies-from-browser chrome`. This requests access to Chrome's cookie database and, where necessary, associated operating-system credential or key storage used to decrypt cookies. The fallback is automatic and is not restricted to a user-requested member-only workflow. Failures may result from network interruptions, invalid URLs, site changes, rate limiting, or other conditions unrelated to authentication. None of those conditions justifies accessing browser authentication state. The documentation characterizes browser cookies as optional, but the implementation enables them automatically after a broad failure condition. This violates least privilege because public channel transcription ordinarily requires no access to the user's authenticated browser session. ### Attack Path 1. A user invokes `batch_channel.sh` with a channel URL. 2. The initial unauthenticated playlist request fails for any reason. 3. The script automatically changes `COOKIES_ARG` to `--cookies ...[truncated 1112 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A second description-behavior mismatch is present: the skill claims batch ingestion, transcript cleaning, and searchable KB construction as core capabilities, but the reviewed content does not substantiate all of those functions. This can lead operators to run the skill with broader privileges or on more sensitive data than warranted.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A second description-behavior mismatch is present: the skill claims batch ingestion, transcript cleaning, and searchable KB construction as core capabilities, but the reviewed content does not substantiate all of those functions. This can lead operators to run the skill with broader privileges or on more sensitive data than warranted.

Content

No source excerpt is available for this finding.

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

Although this is not direct malware, the instruction to use browser cookies matches credential-access patterns because it leverages authenticated browser session data. In practice, this can expose highly sensitive tokens if copied, logged, or processed by untrusted tools, so the risk is real even if the apparent purpose is content access.

Content

Scanner excerpt · SKILL.md (reported line 143)May include surrounding context.

/O, no local load |

If fans start spinning:

  • Stop whisper processes immediately
  • Wait for cooldown
  • Resume with lower concurrency (1-2)
bash
# Check GPU temp (if using CUDA)
nvidia-smi

# Check Mac CPU/GPU temp
sudo powermetrics --sample-rate 1000 -i 1 -n 1 | grep -E "CPU|GPU"

Dependencies

Required: yt-dlp, ffmpeg, whisper.cpp (+ model), opencode CLI Optional: Browser cookies for member-only content (--cookies-from-browser chrome)

Environment Variables

VariableDefaultDescription
WHISPER_CLIwhisper-cliPath to whisper.cpp
WHISPER_MODEL~/.whisper-cpp/ggml-small.binWhisper model
OPENCODE_BIN~/.opencode/bin/opencodeopencode CLI
CLEAN_MODELopencode/minimax-m2.5-freeCleaning model

Tips

  • China users: Use hf-mirror.com for whisper model
  • Long videos (1h+): Auto-segmented into 10-min chunks
  • Resumable: All batch scripts skip already-proc

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · scripts/batch_channel.sh (reported line 22)May include surrounding context.

sh
wnload+transcribe jobs
CHUNK_SIZE="${6:-500}" # Fetch videos in chunks to avoid timeout

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

echo "=== Fetching video list from: $CHANNEL ==="

# Try without cookies first, fall back to cookies-from-browser
COOKIES_ARG=""
if ! yt-dlp --flat-playlist --print url "$CHANNEL" >/dev/null 2>&1; then
  echo "Direct access failed, trying with browser cookies..."
  COOKIES_ARG="--cookies-from-browser chrome"
fi

# Function to fetch video URLs in chunks (handles 1000+ video channels)
fetch_urls_chunked() {
  local chunk_start=1
  local chunk_end=$CHUNK_SIZE
  local all_urls=$(mktemp)
  
  while true; do
    echo "  Fetching videos $chunk_start-$chunk_end..."
    local chunk_urls=$(mktemp)
    
    # Try to fetch this chunk
    if yt-dlp $COOKIES_ARG --flat-playlist \
      --playlist-start $chunk_start \
      --playlist-end $chunk_end \
      --print url "$CHANNEL" > "$chunk_urls" 2>/dev/null; then
      
      local count=$(wc -l < "$chunk_urls" | tr -d

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises and documents shell execution, file reads, and file writes, but it does not declare an explicit tool scope or permissions boundary. In an agent environment, this increases the chance the agent can invoke broader local capabilities than users expect, especially when the skill includes batch processing, background execution, and filesystem output.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation says processing is local and requires no API key, but the cleaning stage depends on an external model/service via opencode. That discrepancy can cause users to unknowingly send transcript content off-device, creating privacy and compliance risk for potentially sensitive audio-derived text.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The cleaning section describes model-based transcript correction but does not clearly warn that transcript chunks are transmitted to an external service. This omission is dangerous because transcript text may contain personal, confidential, or copyrighted information, and users are not given informed consent before exfiltration occurs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The instruction 'Output MUST be Simplified Chinese' forces a specific language/locale behavior. The file does not provide user opt-in, a configurable language choice, or a clear justification that the skill is restricted to a Simplified Chinese-only compliance context.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

Using nohup to launch long-running background jobs creates persistence beyond the interactive session, which reduces oversight and can allow unattended processing of local files and network operations. In an agent setting, this is risky because it can continue consuming resources or handling sensitive data after the user thinks the interaction has ended.

Content

Scanner excerpt · SKILL.md (reported line 93)May include surrounding context.

⚠️ Long-running tasks

Use nohup to avoid session compaction killing processes:

bash
nohup bash scripts/batch_clean.sh ./kb/UP主名_UID/ 0 80 > /tmp/clean.log 2>&1 &

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The resumable detached cleaning workflow reinforces background execution of transcript processing, including possible external-service transmission, without active supervision. This increases privacy and operational risk if the job continues after context is lost or if logs capture sensitive material.

Content

Scanner excerpt · SKILL.md (reported line 95)May include surrounding context.

Use nohup to avoid session compaction killing processes:

bash
nohup bash scripts/batch_clean.sh ./kb/UP主名_UID/ 0 80 > /tmp/clean.log 2>&1 &

batch_clean.sh is resumable — safe to re-run after interruption.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

Detached batch-channel processing can run for extended periods, perform large-scale downloads, and write many files without session visibility. In a multi-tool agent environment, this persistence materially raises the chance of uncontrolled resource use, unnoticed failures, or continued handling of sensitive content.

Content

Scanner excerpt · SKILL.md (reported line 105)May include surrounding context.

bash
# Auto-chunked, just re-run to resume
nohup bash scripts/batch_channel.sh "https://space.bilibili.com/UID/" ./kb/output > /tmp/batch.log 2>&1 &

If still fails, manually fetch URL list:

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
89% confidence
Finding

The documentation includes a sudo command, which normalizes privileged execution in a workflow that otherwise should not require elevation. Even if only for hardware monitoring, encouraging users or agents to run sudo expands the blast radius of mistakes and can expose the system to privilege misuse.

Content

Scanner excerpt · SKILL.md (reported line 137)May include surrounding context.

nvidia-smi

Check Mac CPU/GPU temp

sudo powermetrics --sample-rate 1000 -i 1 -n 1 | grep -E "CPU|GPU"

text

## Dependencies

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill suggests using browser cookies for member-only content without a strong warning that this exposes authenticated session material. Browser-extracted cookies can grant account access if mishandled, and encouraging their use in an agent or scripted workflow materially increases credential theft and privacy risk.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/dependencies.md (reported line 23)May include surrounding context.

md
brew install ffmpeg

# Linux
sudo apt install ffmpeg

# Windows
winget install ffmpeg

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/dependencies.md (reported line 46)May include surrounding context.

海外 / Outside China:

bash
mkdir -p ~/.whisper-cpp
# Small model (recommended for Chinese)
curl -L -o ~/.whisper-cpp/ggml-small.bin \
  "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The guide tells users to export a GEMINI_API_KEY for the optional summarize CLI without warning that it is a sensitive secret or that transcript content may be sent to an external LLM-backed service. This can lead to accidental credential exposure in shell history or environment leakage, and users may unknowingly transmit potentially sensitive transcript data to a third party.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script silently falls back to --cookies-from-browser chrome when unauthenticated access fails, giving it access to the user's browser session cookies even though the skill is presented as a transcription/knowledge-base utility. This expands the trust boundary from public video retrieval to authenticated browser data access, which can expose private account context and session material without explicit informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script performs authenticated network requests using browser cookies without any interactive warning or confirmation. Even if the intent is to access gated Bilibili content, silently reusing browser credentials can leak authenticated identity, private subscriptions/history context, or session-bearing requests to external tooling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script configures an external opencode model endpoint for transcript cleaning, which means transcript content is transmitted off-box even though the skill description emphasizes local whisper.cpp transcription and does not clearly disclose remote cleaning. This creates a privacy and data-handling risk for potentially sensitive transcript contents and can mislead users into believing all processing is local.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The embedded prompt explicitly states that output must be in Simplified Chinese regardless of the input language. This imposes a fixed language/locale without user choice or documented justification, which matches the policy category for language or locale violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Each transcript chunk is passed to the external model command without a user-facing warning or consent step, so potentially sensitive spoken content is disclosed to a third-party service transparently to the user. In the context of a transcription/knowledge-base skill, users may reasonably expect local-only processing because the description highlights whisper.cpp and no API key requirements, making the undisclosed transmission more dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script hardcodes Chinese strings for the generated markdown header, table columns, and status text. Under the policy, forcing a specific language without user opt-in or clear justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The stated skill purpose is converting Bilibili videos into transcripts/knowledge bases. The included guidance to run nvidia-smi and especially sudo powermetrics extends into system hardware inspection and privileged execution, which is not a direct requirement of the skill's content-processing mission.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy issues. The document splits instructions into 'Outside China' and 'China' flows and recommends a mirror or VPN, which imposes a locale-specific path without an explicit opt-in framing or justification beyond reachability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The script sets LANG to zh by default, which imposes a specific language choice when the user does not provide one. The policy allows locale constraints only when the user is offered a choice or the constraint is clearly justified; neither is present here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.