Back to skill

Security audit

抖音爆款爬虫

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Douyin scraping helper, but it advertises real scraped results while the implementations return fabricated data and also allow broad output-file writes and mutable dependency installation.

Review before installing. Treat current search and hot-list results as mock/example data, not real Douyin trend evidence. Run installation only in an isolated, low-privilege environment, pin dependencies if you proceed, and avoid using user-supplied absolute or traversal output paths.

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

Warning
Location
scripts/scraper.py:103
Finding

Unrestricted output path allows arbitrary writable-file overwrite

Content
View full analysis
None: output.write_text(json.dumps([item.to_dict() for item in items], ensure_ascii=False, indent=2), encoding="utf-8") def write_csv(items: list[VideoData], output: Path) -> None: if not items: output.write_text("", encoding="utf-8") return fieldnames = list(items[0].to_dict().keys()) with output.open("w", newline="", encoding="utf-8") as f: writer = csv.DictWriter(f, fieldnames=fieldnames) writer.writeheader() for item in items: row = item.to_dict() row["tags"] = "|".join(row["tags"]) writer.writerow(row) ``` ```python if args.output: output = Path(args.output) if args.format == "csv": write_csv(items, output) else: write_json(items, output) ``` Equivalent Node.js implementation: ```javascript function saveToJson(videos, filepath) { const data = videos.map(v => ({ title: v.title, description: v.description, author: v.author, play_count: v.play_count, like_count: v.like_count, comment_count: v.comment_count, share_count: v.share_count, url: v.url, tags: v.tags, publish_time: v.publish_time })); fs.writeFileSync(filepath, JSON.stringify(data, null, 2), 'utf-8'); console.log(`💾 已保存到: ${filepath}`); } function saveToCsv(videos, filepath) { if (!videos.length) return; const headers = Object.keys(videos[0]); const csvContent = [ headers.join(','), ...videos.map(v => headers.map(h => { const value = Array.isArray(v[ ...[truncated 2465 chars]
Remediation
View remediation
Path: requested = Path(user_value) if requested.is_absolute() or ".." in requested.parts: raise ValueError("Absolute paths and path traversal are not allowed") destination = (EXPORT_ROOT / requested).resolve() if destination != EXPORT_ROOT and EXPORT_ROOT not in destination.parents: raise ValueError("Output path escapes the export directory") return destination ``` 4. Apply equivalent `path.resolve` and containment validation in the Node.js implementation. 5. Refuse to replace existing files by default, or require explicit user confirmation or a dedicated `--overwrite` option. 6. Restrict permitted extensions to `.json` and `.csv`, and ensure the selected format matches the destination extension. 7. Run the Skill under a low-privilege account with write access limited to its export directory. ]]>

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Mutable and non-official dependency downloads create supply-chain exposure

Content
View full analysis
=1.40.0 ``` Shell installer: ```bash source venv/bin/activate pip install --upgrade pip pip install playwright # Install browser echo "" echo "🌐 正在安装 Playwright 浏览器..." playwright install chromium # Install Node.js dependencies if Node.js is available if command -v npm &> /dev/null; then echo "" echo "📦 正在安装 Node.js dependencies..." npm install fi ``` Docker/native installer: ```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) ``` The documentation also recommends: ```bash npm install npx playwright install chromium ``` ### Technical Analysis The Python requirement uses an open-ended lower bound rather than an exact audited version: ```text playwright>=1.40.0 ``` As a result, a future installation may retrieve a different Playwright release than the one reviewed. The main installer further installs `playwright` without a version constraint and upgrades `pip` to the latest available release. No package hashes are provided. The native Playwright installer defaults browser downloads to `npmmirror.com` and `cdn.npmmirror.com`, which ...[truncated 2507 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill description emphasizes scraping/search functionality, but the instructions also include environment setup and dependency installation actions that materially expand behavior. This mismatch can cause an agent or reviewer to underestimate that the skill may execute setup commands and modify the local environment.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill description emphasizes scraping/search functionality, but the instructions also include environment setup and dependency installation actions that materially expand behavior. This mismatch can cause an agent or reviewer to underestimate that the skill may execute setup commands and modify the local environment.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description emphasizes scraping/search functionality, but the instructions also include environment setup and dependency installation actions that materially expand behavior. This mismatch can cause an agent or reviewer to underestimate that the skill may execute setup commands and modify the local environment.

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 91)May include surrounding context.

md
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 92)May include surrounding context.

md
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")

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a scraper that can obtain Douyin hot videos, captions, search results, and video information. In this implementation, search() and hot() merely attempt to open a browser page, then always return fabricated VideoData from _mock_search() and _mock_hot() rather than extracting real Douyin content.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill description, installation, usage, and warnings are presented only in Chinese, with no indication that the skill is region-specific or that alternative languages are supported. 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
95% confidence
Finding

The skill instructs the agent to run shell commands, install dependencies, and optionally write output files, but it does not declare any explicit tool scope or allowed-tools/permissions boundary. That makes the skill harder to sandbox and increases the chance an agent can invoke shell, access environment state, or write files more broadly than intended.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The natural-language triggers are broad everyday phrases like '搜索一下' or '帮我找', which can cause accidental activation from ordinary conversation. In an agent context, ambiguous invocation increases the risk of unintentional shell execution, network access, and data collection without a clearly scoped user request.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The recognition rules instruct the agent to infer keywords and execute commands from ambiguous phrases without strong validation boundaries. That makes prompt-to-command translation fragile and raises the chance of unintended or overly broad command execution, especially when paired with shell usage.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
88% confidence
Finding

Using 'npx playwright' without pinning a specific version creates a supply-chain risk because the resolved package version can change over time. A compromised or breaking upstream release could execute unintended code during install or runtime in the agent environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This shell script presents its user-facing output, comments, and usage guidance entirely in Chinese, including installation status and quick-start instructions. Because the file provides no opt-in, alternative locale, or justification that the skill is intended only for Chinese-speaking users, it creates a language-policy concern under the natural-language policy rules.

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:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest describes a Douyin scraping skill for searching hot videos, extracting video information, and handling natural-language search requests. This file instead pulls container images, builds Docker images, creates virtual environments, installs dependencies, and downloads browser binaries via subprocesses, which are operational/bootstrap capabilities not justified by the stated scraping functionality itself.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code file contains natural-language strings that force a single locale for documentation and runtime interaction. Under the policy, language constraints should either offer user opt-in/choice or be clearly documented as region-specific and justified, which is not present here.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The inline comment and surrounding behavior imply page data is being obtained, but the implementation transitions into generating example data. This mismatch is a security-relevant integrity issue because it can deceive operators, conceal nonfunctional scraping logic, and cause agent workflows to act on invented content.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises Douyin scraping but, at this location, returns fabricated placeholder records instead of data extracted from the loaded page. In an agent context this is dangerous because downstream users or automations may trust the output as real-world data, leading to misinformation, bad decisions, or hidden test/mock behavior shipped as production functionality.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The hot-list path is presented as fetching Douyin hot data but instead emits fabricated entries. In a skill intended for automated data gathering, this can mislead users into believing trend data is authentic, which is especially risky if outputs are used for analysis, content decisions, or further automated actions.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/scraper.py (reported line 90)May include surrounding context.

python
browser.close()
            return True
        except Exception as e:
            print(f"⚠️  浏览器不可用,使用模拟数据: {e}", file=__import__("sys").stderr)
            return False

    def search(self, keyword: str, limit: int) -> list[VideoData]:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The skill description and operating instructions are presented entirely in Chinese, and the file does not indicate that the user can choose another language or that the locale restriction is required. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

All sample invocations are written exclusively in Chinese, which indicates the skill may be designed around a fixed language without any stated user opt-in or alternative locale support. Under the language/locale policy, this is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code creates or overwrites Dockerfile.generated via Path.write_text(...), which is a file write operation. While subprocess commands are printed, there is no explicit warning, confirmation, or comment/docstring disclosing that the script will modify files in the working directory.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.