Back to skill

Security audit

vsum

Security checks for vulnerabilities and agentic risk

Overview

This video summarizer is mostly purpose-related, but it needs review because it can read Chrome login cookies and write files without strong user confirmation or URL safeguards.

Review before installing. Use it only if you are comfortable letting yt-dlp read Chrome cookies for Bilibili, and prefer an explicit cookie file or a dedicated browser profile. Confirm where outputs will be written, and avoid running the helper script on links from untrusted sources until URL validation and yt-dlp option-delimiting are added.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/vsum.sh:24
Finding

Unvalidated Video URL Permits yt-dlp Option Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/vsum.sh, lines 24–31 and 47–52
Vulnerability Type: Improper input validation and argument injection
Risk Level: Medium

Vulnerable Code

bash
# Detect the platform
detect_platform() {
    if echo "$URL" | grep -q "bilibili.com"; then
        echo "bilibili"
    elif echo "$URL" | grep -q "youtube.com\|youtu.be"; then
        echo "youtube"
    else
        echo "unknown"
    fi
}
bash
# Retrieve subtitles
if [ "$PLATFORM" = "youtube" ]; then
    echo "Retrieving YouTube subtitles..."
    yt-dlp --write-auto-subs --sub-lang "$LANG" --skip-download "$URL"
elif [ "$PLATFORM" = "bilibili" ]; then
    echo "Retrieving Bilibili subtitles (login required)..."
    yt-dlp --cookies-from-browser chrome --write-subs --sub-lang ai-zh,zh-CN,"$LANG" --skip-download "$URL"
fi

Technical Analysis

The script treats input as a supported video URL whenever it contains the text youtube.com, youtu.be, or bilibili.com. It does not parse the URL, validate its scheme and hostname, or reject values beginning with a hyphen.

Although "$URL" is shell-quoted, quoting only prevents shell word splitting and shell metacharacter interpretation. It does not stop the invoked program from interpreting the resulting argument as an option. Because the script does not place the -- end-of-options delimiter before "$URL", a crafted value beginning with - can be parsed as a yt-dlp option rather than as a video URL.

For example, an attacker can submit an option-shaped value containing one of the accepted domain strings in an option parameter or path. Depending on the selected yt-dlp option and accessible local resources, this can alter configuration loading, batch input, output handling, network behavior, or command-hook behavior. Some exploitation variants require an attacker-controlled local configuration or batch file, but the script itse ...[truncated 2394 chars]

Remediation
View remediation

Remediation Suggestions

  1. Terminate option parsing before the URL. Add -- immediately before the positional URL in both invocations:

    bash
    yt-dlp --write-auto-subs --sub-lang "$LANG" --skip-download -- "$URL"
    
    bash
    yt-dlp --cookies-from-browser chrome \
        --write-subs \
        --sub-lang "ai-zh,zh-CN,$LANG" \
        --skip-download \
        -- "$URL"
    
  2. Reject option-shaped input explicitly.

    bash
    case "$URL" in
        -*) echo "Error: the URL must not begin with '-'." >&2; exit 1 ;;
    esac
    
  3. Validate the parsed URL rather than searching for domain substrings. Require HTTPS and compare the normalized hostname against an explicit allowlist. Approved hosts should include only the exact domains and subdomains intentionally supported, such as youtube.com, www.youtube.com, youtu.be, bilibili.com, and www.bilibili.com.

  4. Reject misleading host constructions. Do not accept a URL merely because an approved domain appears in its path, query string, fragment, or user-information component. Reject embedded credentials such as https://youtube.com@untrusted.example/.

  5. Minimize browser-cookie access. Invoke --cookies-from-browser chrome only after confirming that the parsed hostname is an approved Bilibili host. Where possible, use a dedicated, least-privileged cookie file or browser profile rather than the user's general Chrome profile.

  6. Validate the language argument. Restrict the optional language value to the character set and format expected by yt-dlp, even though it is currently supplied as the value of a fixed option.

  7. Add negative security tests. Test values beginning with -, URLs containing approved domains only in their path or query, user-information hostname tricks, malformed URLs, unsupported schemes, and deceptive subdomains such as youtube.com.attacker.example.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description presents a simple video summarization workflow, but the documented behavior expands into accessing browser authentication material for Bilibili and writing files locally without clearly declaring those actions. This mismatch is dangerous because users may consent to summarization without realizing the skill needs sensitive browser cookies or may create files on their system.

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
87% confidence
Finding

The YARA hit is justified because the skill explicitly invokes browser-cookie extraction, a pattern strongly associated with credential theft tooling. In this skill context, the behavior may have a functional purpose for accessing Bilibili subtitles, but it still involves highly sensitive authentication data and therefore remains dangerous if not tightly constrained and transparently disclosed.

Content

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

yt-dlp --write-auto-subs --sub-lang en --skip-download "视频链接"

或者明确指定语言

yt-dlp --write-subs --sub-lang en --skip-download "视频链接"

列出可用字幕

yt-dlp --list-subs "视频链接"

text

**注意**: YouTube 需要使用 `--write-auto-subs` 才能下载自动生成的字幕。

### Bilibili

```bash
# 需要登录 cookie(浏览器需已登录 B站)
yt-dlp --cookies-from-browser chrome --write-subs --sub-lang ai-zh,zh-CN --skip-download "视频链接"

# 列出可用字幕
yt-dlp --cookies-from-browser chrome --list-subs "视频链接"

注意: B站字幕需要用户登录,需要使用 --cookies-from-browser chrome 从浏览器读取 cookie。

工作流程

  1. 获取视频链接 - 用户提供 YouTube 或 Bilibili 链接
  2. 识别平台 - 自动判断是 YouTube 还是 Bilibili
  3. 获取字幕 - 使用 yt-dlp 获取字幕
  4. AI 总结 - 调用 AI API 对字幕进行总结
  5. 输出 md - 将总结保存为 md 文

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

High
Category
YARA Match
Confidence
90% confidence
Finding

The info-stealer signature is triggered by the script's use of browser-cookie extraction. In context, this does not look like overt malware because the cookies are passed to yt-dlp for a stated purpose, but it still resembles credential-harvesting behavior enough to be dangerous in an agent skill: it accesses highly sensitive browser session data without strong minimization or consent controls.

Content

Scanner excerpt · scripts/vsum.sh (reported line 53)May include surrounding context.

sh
"unknown" ]; then
    echo "错误: 无法识别的视频平台"
    exit 1
fi

echo "检测到平台: $PLATFORM"

cd "$OUTPUT_DIR"

# 获取字幕
if [ "$PLATFORM" = "youtube" ]; then
    echo "获取 YouTube 字幕..."
    yt-dlp --write-auto-subs --sub-lang "$LANG" --skip-download "$URL"
elif [ "$PLATFORM" = "bilibili" ]; then
    echo "获取 Bilibili 字幕(需要登录)..."
    yt-dlp --cookies-from-browser chrome --write-subs --sub-lang ai-zh,zh-CN,"$LANG" --skip-download "$URL"
fi

echo "字幕已保存到: $OUTPUT_DIR"
echo ""
echo "下一步: 将字幕内容发送给 AI 进行总结"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs reading Chrome cookies for Bilibili but does not prominently warn that browser cookies are sensitive authentication secrets. Without a clear warning and consent step, users may unknowingly authorize access to account sessions beyond what they expected for subtitle retrieval.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Using --cookies-from-browser chrome reads authenticated browser session data, which is sensitive local credential material unrelated to a minimal summarization task unless strictly necessary and explicitly approved. If misused, this could expose account sessions or normalize credential access patterns that resemble infostealer behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

These lines define preferred languages for subtitle retrieval by platform, which can force a locale/language choice independent of user preference. Under the policy, language constraints should either be optional or clearly justified as region-specific; here the document does not present them as a user-selectable preference.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example dialogue suggests saving directly to Desktop or Downloads, which encourages writing files to common user directories without an explicit consent gate. In an agent setting, this increases the risk of unapproved file creation and accidental disclosure of generated content on shared or synced folders.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes a video summarizer that automatically gets subtitles and produces an AI-generated summary in markdown format. In this file, the implemented behavior stops after fetching subtitles and prints a manual next step to send them to AI, with no summarization or markdown generation performed.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Bilibili path invokes yt-dlp with --cookies-from-browser chrome, which accesses the user's browser session cookies. For a video summarization skill, pulling browser authentication material is broader than necessary and can expose sensitive session data if mishandled, especially because the skill does not clearly justify or constrain this access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script silently reads Chrome cookies for Bilibili subtitle retrieval without an explicit warning about privacy and credential implications. Even if intended only to access protected subtitles, this behavior touches sensitive authentication material and can surprise users into granting access they did not knowingly approve.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill says it will save markdown output and elsewhere implies saving to user-accessible directories, but it does not clearly require confirmation of the destination first. Silent or assumed file creation can surprise users, overwrite expectations, or expose generated content in unintended locations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

All user-facing messages and usage text are presented in Chinese, with no option to select another language. This can violate language/locale policy when a skill imposes a single language without offering user choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.