Back to skill

Security audit

hot-video-breakdown

Security checks for vulnerabilities and agentic risk

Overview

This video-analysis skill is mostly purpose-aligned, but it needs Review because it can fetch arbitrary URLs, use user-supplied cookie files, and generate HTML with a verified injection weakness.

Install only if you are comfortable letting the skill run local Python tools, download videos and a Whisper model, and write transcript/report files. Use it only with trusted public video URLs, avoid passing browser cookie files unless necessary, keep output in a controlled directory, and treat generated HTML from untrusted analysis JSON as unsafe until inspected.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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

Warning
Location
scripts/parse.py:569
Finding

HTML Attribute Injection in Contrast Card Background Rendering

Content
View full analysis
{_e(label)}
{_e(title)}
{_e(body)}
""" ``` ### Technical Analysis The `bg` property is obtained from the supplied analysis JSON and inserted directly into a quoted HTML `style` attribute. Unlike the other fields in this block, it is neither escaped with `html.escape()` nor validated as a permitted CSS color. An attacker who controls the analysis JSON can terminate the `style` attribute and add a new event-handler attribute. For example: ```json { "bg": "red;\" onmouseover=\"alert(document.domain)" } ``` This produces markup equivalent to: ```html
``` The injected JavaScript runs when the relevant user interaction occurs. Encoding the value alone would prevent attribute breakout, but arbitrary CSS values should also be rejected to reduce CSS-based content manipulation. ### Attack Path 1. An attacker creates or modifies an analysis JSON file. 2. The attacker places the injection payload in a `bg` property under a capsule whose `type` is `contrast`. 3. The user or agent runs: ```bash python scripts/parse.py --generate-html malicious-analysis.json ``` 4. `_render_contrast()` inserts the payload into the generated HTML without escaping or validation. 5. The user opens the generated report and triggers the injected event. 6. Attacker-controlled JavaScript executes in the report's browser conte ...[truncated 502 chars]
Remediation
View remediation
' ``` If custom colors are required: 1. Accept only a narrowly defined color syntax, such as validated hexadecimal colors. 2. Reject quotes, parentheses, semicolons, URL expressions, and unexpected whitespace. 3. Escape the final attribute value with `html.escape(value, quote=True)`. 4. Add a restrictive Content Security Policy that blocks inline scripts and event handlers. 5. Add regression tests using quote-breaking and event-handler payloads. Example restrictive validation: ```python if bg and not re.fullmatch(r"#[0-9A-Fa-f]{6}", bg): raise ValueError("Invalid background color") style = f' style="background:{html.escape(bg, quote=True)};"' if bg else "" ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/parse.py:84
Finding

Unrestricted User-Supplied URL Fetching

Content
View full analysis
dict: """下载视频,返回 {path, title, platform, duration}""" # 抖音优先走 iesdouyin API(无需 cookies/yt-dlp) if "douyin.com" in url or "iesdouyin.com" in url: result = _download_douyin(url, out_dir) if result: return result print(" [Douyin] iesdouyin 失败,降级 yt-dlp...", file=sys.stderr) _check_tool("yt-dlp") if not shutil.which("yt-dlp"): return _download_module(url, out_dir, cookies) out_tmpl = str(out_dir / "%(title)s.%(ext)s") ffmpeg = _find_ffmpeg() cmd = [ "yt-dlp", "-f", "bv*+ba/best[ext=mp4]/best", "--merge-output-format", "mp4", "-o", out_tmpl, "--print", "filename", "--print", "title", "--print", "duration", "--no-playlist", "--socket-timeout", "30", ] if ffmpeg: cmd += ["--ffmpeg-location", ffmpeg] if cookies: cmd += ["--cookies", cookies] cmd.append(url) ``` ```python def _download_douyin(url: str, out_dir: Path) -> dict | None: """抖音专用下载:iesdouyin API → mp4 直链 → urllib 下载。失败返回 None 降级 yt-dlp。""" try: import urllib.request as ur # 1. 提取 video_id m = re.search(r"/video/(\d+)", url) or re.search(r"/shipin/(\d+)", url) if not m and ("v.douyin.com" in url or "iesdouyin.com" in url): req = ur.Request(url, headers={"User-Agent": DOUYIN_UA}) with ur.urlopen(req, timeout=10) as resp: final = resp.geturl() m = re.search(r"/video/(\d+)", final) ``` ```python def _download_module(url: str, out_dir: Path, cookies: str | None = None) -> dict: import yt_dlp info = {} def _hook(d): ...[truncated 2750 chars]
Remediation
View remediation
str: parsed = urlsplit(raw_url) if parsed.scheme != "https": raise ValueError("Only HTTPS video URLs are permitted") if parsed.username or parsed.password: raise ValueError("Embedded URL credentials are not permitted") host = (parsed.hostname or "").rstrip(".").lower() if host not in ALLOWED_HOSTS: raise ValueError("Unsupported video platform hostname") return raw_url ``` Where broad subdomain support is necessary, use boundary-aware checks: ```python host == domain or host.endswith("." + domain) ``` Do not use raw substring matching. ]]>

T08 · Insecure Dependencies

Note
Location
skill.yaml:26
Finding

Unpinned Executable Third-Party Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The entire skill description is presented only in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill requires powerful capabilities including shell execution, outbound network access, local file read/write, and subprocess invocation, but it does not declare machine-readable tool scope such as explicit permissions or allowed-tools. This creates a governance gap: an agent runner may expose broader tools than intended, making unsafe execution or privilege overreach more likely when processing user-supplied URLs, cookies, and local files.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill accepts an arbitrary cookies file path and forwards it to yt-dlp, enabling the process to use sensitive browser-exported session cookies when accessing remote services. In an agent setting, this broadens the skill from local analysis into authenticated account-context access, increasing the chance of unintended private-content access or credential/session leakage through misuse of a caller-supplied cookie jar.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/parse.py (reported line 112)May include surrounding context.

python
cmd.append(url)

    try:
        result = subprocess.run(
            cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
            text=True, timeout=600, encoding="utf-8", errors="replace",
        )

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The transcription function defaults language to zh, causing the tool to assume Chinese processing unless the caller overrides it. This is a language-policy concern because the file imposes a locale choice by default rather than detecting language or requesting user preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generated HTML sets <html lang="zh-CN">, which forces a specific locale in the output regardless of user preference. This file also uses Chinese-only UI text by default, and there is no visible option allowing the user to choose another language or locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The parameter table states --language defaults to zh, which imposes a specific locale by default. The document does not clearly frame this as user-selectable at invocation time or justify the default as a region-specific tool, so it may conflict with language/locale choice policy.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The module docstring presents the file as 'tri-platform-parse' for collecting Douyin/Bilibili/Xiaohongshu videos, downloading them, transcribing locally, and outputting subtitle JSON/TXT. The manifest instead describes a skill centered on taking a hot short-video link and producing an interactive capsule-card HTML report; while related, this file’s stated and implemented primary output is a generic acquisition/transcription pipeline rather than the report-generation behavior emphasized by the manifest.

Content

No source excerpt is available for this finding.