T09 · Insecure Skill Coding Practices
- Location
scripts/scraper.py:87- Finding
Browser sandbox is explicitly disabled while processing remote web content
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent Douyin scraper, but it asks agents to run browser scraping and file-writing commands without confirmation while using unsafe browser and installation defaults.
Install only if you are comfortable with a scraper that downloads browser automation components and runs Chromium against Douyin pages. Use an isolated, unprivileged environment with no sensitive files mounted, pin reviewed dependency versions, avoid running as root, and require confirmation before scraping or writing output files.
scripts/scraper.py:87Browser sandbox is explicitly disabled while processing remote web content
requirements.txt:1Executable dependencies and browser components are not reproducibly pinned
scripts/scraper.py:270User-controlled output paths permit unrestricted file overwrite
The declared purpose is scraping Douyin content, but the skill also includes bootstrap and dependency installation instructions such as pip installation and browser binary installation. This expands execution from task-specific scraping into environment modification, which can surprise operators, increase supply-chain risk, and cause the agent to run setup commands not clearly scoped by the skill description.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
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")
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.
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.
The skill advertises executable shell commands, file output, and environment-related setup behavior but does not declare any explicit tool scope or permissions boundaries. In an agent environment, missing scope declarations increase the chance of over-privileged execution, unintended file writes, or shell access being granted implicitly when the skill is invoked.
The natural-language matching rules are broad enough that many ordinary Douyin-related requests could automatically trigger browser automation and scraping. In an agent setting, this can cause unintended command execution, external network access, and data collection when the user did not explicitly ask to run a scraper.
The skill explicitly instructs the agent to execute scraping commands without confirmation, including variants that write output files. This removes an important consent checkpoint and can lead to unintended scraping, network activity, and filesystem modifications, especially when user requests are ambiguous or casually phrased.
The examples state that the agent will automatically convert natural-language requests into scraper commands, but they do not define clear trigger boundaries, confirmation requirements, or exclusions. This can cause ordinary conversational text to be interpreted as an actionable scraping request, leading to unintended browser automation or data collection.
The trigger examples are generic phrases like everyday user speech, which are likely to overlap with normal conversation. In an agent environment, this increases the chance of accidental activation and unintended execution of scraping actions, especially if the agent routes free-form chat directly into the skill.
This shell script presents all user-facing messages and usage guidance in Chinese, including installation status and next-step instructions. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
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:
The browser context is hard-coded to use locale 'zh-CN', which imposes a specific language/locale behavior on all runs. The file does not offer a user opt-in or configuration path for other locales, nor does it document a clear policy justification for the restriction.
The manifest description says the skill supports '获取热榜', implying hot-list retrieval is a working capability. However, the only hot-list method logs that the feature requires login and is unavailable, then always returns an empty array. This is a direct mismatch between the advertised behavior and actual code behavior.
This code hard-codes locale="zh-CN" for every browser context, which imposes a specific locale on all users without opt-in. The policy allows locale constraints only when the user is given a choice or when the restriction is clearly documented and justified as region-specific, which is not present here.
A natural-language policy issue exists when a skill effectively forces a specific language without user opt-in. This README presents all instructions and warnings only in Chinese and does not indicate any alternative language support or explicit locale limitation.
The markdown includes multiple examples that persist scraped results to local files, which affects user data and the local filesystem. Although there are general platform-usage cautions, the README does not explicitly disclose that running these commands will create or overwrite output files.
The natural-language interface, invocation rules, and user guidance are entirely in Chinese, which effectively imposes a single language for use. The file does not offer multilingual use, opt-in language selection, or explain that the skill is intentionally restricted to a Chinese-language audience for a documented reason.
All user-facing examples and instructions are presented only in Chinese, with no indication that other languages are supported or that Chinese is a justified region-specific requirement. This can violate language/locale policy when a skill implicitly enforces one language without user opt-in.
The dependency is specified with a lower-bound only (playwright>=1.40.0), which allows future major or minor releases to be installed without review. That can introduce breaking changes or a compromised/upstream-vulnerable version into the scraping skill's browser automation stack, reducing build reproducibility and increasing supply-chain risk.
playwright>=1.40.0
No suspicious patterns detected.