Back to skill

Security audit

抖音爆款爬虫 Pro

Security checks for vulnerabilities and agentic risk

Overview

This Douyin scraping skill is mostly purpose-aligned, but it needs review because it can browse arbitrary user-supplied URLs with Chromium sandboxing disabled and installs mutable external dependencies.

Install only if you are comfortable running a browser scraper with local shell access. Prefer running it in a restricted container or disposable environment, do not analyze untrusted URLs, avoid logging into accounts, and pin/verify dependencies before use.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scraper.py:278
Finding

Unrestricted URL Navigation in a Browser with the Security Sandbox Disabled

Content
View full analysis
VideoData: if sync_playwright is None: print("⚠️ Playwright 未安装", file=sys.stderr) return VideoData(url=url) with sync_playwright() as p: browser, page = self._launch_browser(p) try: print(f"🎬 分析视频: {url}", file=sys.stderr) page.goto(url, wait_until="domcontentloaded", timeout=30000) video = self._extract_video_detail(page, url) print(f"✅ 分析完成", file=sys.stderr) return video except Exception as e: print(f"⚠️ 分析出错: {e}", file=sys.stderr) return VideoData(url=url) finally: browser.close() ``` ```python analyze_p.add_argument("--url", required=True, help="视频链接") ``` ### Technical Analysis The `analyze` command accepts an arbitrary URL and passes it directly to Playwright's `page.goto()` without validating its scheme, hostname, resolved address, port, or redirect destination. Although the command is described as analyzing a Douyin video, the implementation does not restrict navigation to Douyin domains. An attacker can therefore instruct the agent to analyze URLs targeting loopback addresses, private networks, link-local services, or other endpoints reachable from the host. Redirects from an initially acceptable-looking URL are also not validated. The browser is additionally launched with both `--no-sandbox` and `--disable-setuid-sandbox ...[truncated 2129 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unpinned Dependencies and Use of Third-Party Browser Binary Mirrors

Content
View full analysis
=1.40.0 ``` ```bash source venv/bin/activate pip install --upgrade pip pip install playwright # 安装浏览器 echo "" echo "🌐 正在安装 Playwright 浏览器..." playwright install chromium ``` ```python def mode_native() -> None: env = os.environ.copy() env.setdefault("PLAYWRIGHT_DOWNLOAD_HOST", "https://npmmirror.com/mirrors/playwright") env.setdefault("PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST", "https://cdn.npmmirror.com/binaries/chrome-for-testing") venv_python = Path("venv/bin/python") venv_pip = Path("venv/bin/pip") if not venv_python.exists(): run([sys.executable, "-m", "venv", "venv"]) run([str(venv_pip), "install", "-r", "requirements.txt"], env=env) run([str(venv_python), "-m", "playwright", "install", "chromium"], env=env) ``` ### Technical Analysis The requirement `playwright>=1.40.0` permits installation of any newer compatible release rather than a reviewed, fixed version. The main installer goes further by running `pip install playwright` directly and upgrading `pip` to the newest available version. Installation behavior can therefore change over time without any change to the audited project. The native installation mode redirects Playwright and Chromium downloads to third-party mirrors. The project does not perform its own cryptographic hash or signature verification of the downloaded browser artifact. This expands the set of infrastructure that must remain trusted and makes the resulting installation less reproducible. There is also a version-consistency risk: the Docker helper defaults to Playwright version `1.50.0`, while `requirements.txt` allows any version from `1.40.0` onward. Browser binaries and Playwright packages a ...[truncated 1614 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

声明的核心能力是‘抖音内容抓取与搜索’,而提供的代码片段实际是一个安装脚本,负责配置 Playwright 依赖、Docker 镜像和本地 Chromium 浏览器环境。这可以视为相关的支持性基础设施,但该片段本身的主要行为与声明的主要用途明显不一致,因为它没有执行任何抓取、搜索、解析或数据提取操作。因此应判定为描述与实际代码行为不匹配。

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cd {{SKILL_DIR}} && node scripts/douyin_scraper.js search "海鲜" 10

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cd {{SKILL_DIR}} && node scripts/douyin_scraper.js search "海鲜" 10

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
cd {{SKILL_DIR}} && node scripts/douyin_scraper.js search "海鲜" 10

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · install_playwright_docker.py (reported line 30)May include surrounding context.

python
def mode_native() -> None:
    env = os.environ.copy()
    env.setdefault("PLAYWRIGHT_DOWNLOAD_HOST", "https://npmmirror.com/mirrors/playwright")
    env.setdefault("PLAYWRIGHT_CHROMIUM_DOWNLOAD_HOST", "https://cdn.npmmirror.com/binaries/chrome-for-testing")
    venv_python = Path("venv/bin/python")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documentation title and all user-facing instructions are written entirely in Chinese, with no indication that other languages are supported or that the Chinese-only presentation is an intentional, justified regional constraint. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs the agent to execute shell commands, install packages, and potentially write outputs to files, but it declares no tool scope or permission boundaries. This increases the attack surface because a caller or downstream agent may invoke shell/file capabilities implicitly without any explicit least-privilege guardrails.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding

Using npx playwright without a pinned version allows retrieval of whatever version is current at execution time, creating a supply-chain risk and harming reproducibility. If the upstream package or a dependency is compromised, the skill may install and execute untrusted code during setup.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

All example requests are written exclusively in Chinese and reference Chinese-language platforms, which indicates the skill is oriented to a specific language/locale. There is no accompanying note offering language choice or documenting that the skill is intentionally region-specific, so this can violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The installer's comments and all user-facing echo messages are in Chinese, which imposes a specific language on users without any opt-in or alternative locale support. This matches the language/locale policy violation category because the file provides no mechanism to choose another language and no justification that the skill is region-locked.

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 · install_playwright_docker.py (reported line 14)May include surrounding context.

python
def run(cmd: list[str], cwd: str | None = None, env: dict[str, str] | None = None) -> None:
    print("\n>>>", " ".join(cmd))
    subprocess.run(cmd, cwd=cwd, env=env, check=True)


def mode_official() -> None:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The browser context is forced to use locale: 'zh-CN', which imposes a specific language/locale behavior on all runs. Under the policy, locale restrictions should be user-selectable or clearly justified as region-specific; this file provides neither.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The browser context is hard-coded with locale="zh-CN", which imposes a specific language/locale behavior on all runs. The file does not provide a user opt-in, configuration option, or documented justification that this skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
92% confidence
Finding

The dependency is specified with a lower bound only, which allows installation of any newer Playwright release, including versions with breaking changes or newly introduced supply-chain risk. While this is not an immediate exploit by itself, it reduces build reproducibility and can unexpectedly pull in vulnerable or incompatible versions over time.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
playwright>=1.40.0

Static analysis

No suspicious patterns detected.