Back to skill

Security audit

抖音学习流水线

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does the advertised Douyin downloading and transcription work, but it also automatically changes the user environment and handles reusable credentials in ways users should review before installing.

Review this skill before installing. Use environment variables or a secret manager for API keys and cookies where possible, avoid running the automatic environment check unless you accept user-level package installation, and treat captured Douyin cookies as reusable login material that should be protected and revoked if exposed.

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/setup_config.py:9
Finding

Plaintext Storage of API Keys, Document Tokens, and Authentication Cookies

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/check_env.sh:31
Finding

Automatic Installation of an Unpinned Package into the User Environment

Content
View full analysis
/dev/null; then echo "✓ yt-dlp 已安装" else echo "✗ yt-dlp 未安装,尝试用户级安装..." python3 -m pip install yt-dlp --user || echo " 用户级安装失败,请手动安装 yt-dlp" fi ``` ### Technical Analysis The script is described as an environment self-check, but it changes the user's Python environment by installing the latest version of `yt-dlp` available from the configured package index. The installation has no exact version pin, hash verification, isolated virtual environment, or explicit user confirmation. Python package installation is a code-execution boundary. Package build hooks, installation logic, imported dependencies, or the installed executable may run code under the invoking user's account. Because the selected release can change after the Skill has been reviewed, the effective dependency payload is not reproducible. The use of `--user` avoids a system-wide privileged install, but it can still place scripts and modules in locations that affect later user commands. It may also alter an existing user Python environment and create dependency conflicts. ### Attack Path 1. The user invokes the mandatory environment check. 2. `yt-dlp` is absent from `PATH`. 3. The script automatically executes `python3 -m pip install yt-dlp --user`. 4. Pip resolves the current package and dependencies from the configured index without requiring reviewed versions or hashes. 5. If a selected release, transitive dependency, configured index, or package-distribution path is compromised, malicious installation or runtime code executes with the user's privileges. 6. The installed package persists in the user's Python environment and may execute again during subsequent downloads. ### Impact Assessment A compromised dependency can obtain ...[truncated 645 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
assets/douyin-downloader/auth/ms_token_manager.py:25
Finding

Mutable Third-Party Configuration Controls the Token-Service Destination

Content
View full analysis
Optional[str]: conf = self._load_f2_ms_token_conf() if not conf: return None payload = { "magic": conf["magic"], "version": conf["version"], "dataType": conf["dataType"], "strData": conf["strData"], "ulr": conf["ulr"], "tspFromClient": int(time.time() * 1000), } request = urllib.request.Request( conf["url"], data=json.dumps(payload).encode("utf-8"), headers={ "Content-Type": "application/json; charset=utf-8", "User-Agent": self.user_agent, }, method="POST", ) try: with urllib.request.urlopen(request, timeout=self.timeout_seconds) as resp: token = self._extract_ms_token_from_headers(resp.headers) ``` ```python def _load_f2_ms_token_conf(self) -> Optional[Dict[str, Any]]: now = time.time() with self._lock: if self._cached_conf and (now - self._cached_at) < self._cache_ttl_seconds: return self._cached_conf try: with urllib.request.urlopen( self.conf_url, timeout=self.timeout_seconds ) as resp: raw = resp.read().decode("utf-8") data = yaml.safe_load(raw) or {} ms_conf = ( data.get("f2", {}).get("douyin", {}).get("msToken", {}) ) required = {"url", "magic", "version", "dataType", "ulr", "strData"} if not required.issubset(ms_conf.keys()): logger.warning( "F2 msToken config incomplete, missing: %s", sorted(required ...[truncated 3220 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (190)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared description promises a substantial Douyin-processing workflow with multiple stages and fallback behaviors, but the provided code chunk contains only a version constant and no operational logic. This is not merely incomplete supporting code; based on the supplied chunk, the actual behavior does not implement or evidence the described purpose at all.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a high-level end-user workflow for processing Douyin links, including download, transcription, text extraction, analysis, and rewriting. The supplied code chunk does not implement any of those behaviors directly; it only exposes authentication-related components (cookie and ms_token managers) from an auth module. While auth could be a supporting detail in a larger downloader system, this specific chunk’s actual behavior is materially different from the declared purpose and omits the advertised workflow functionality. Therefore, this chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a user-facing Douyin link processing workflow focused on downloading/parsing content, extracting copy, transcription, polishing, structural analysis, and rewriting. The supplied code chunk does none of those tasks. Instead, it implements low-level authentication cookie management: saving cookies to disk, loading them, formatting them into a header string, validating required cookie keys, and deleting stored cookies. While cookie handling could be a supporting component of a downloader system, this chunk's actual primary purpose is materially different from the declared workflow behavior, and the local filesystem access for cookie persistence is not reflected in the description. Therefore this code chunk does not accurately match the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是面向用户的抖音链接内容处理总控流程,核心能力应包括下载解析、文案提取、转写、修顺、拆解和仿写等。而实际代码只是底层网络辅助模块,用于获取或伪造 msToken 以补全请求参数,属于鉴权/反爬支持逻辑。虽然这类 token 管理可能是抖音下载器的配套实现细节,但单看该代码块,其行为与声明的主要功能明显不一致,且包含未在声明中体现的远程配置拉取和外部网络请求能力。因此应判定为描述与代码行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description promises a full-featured Douyin processing workflow with multiple stages and behaviors. The supplied code chunk is only a minimal package initializer that imports and exports main from .main. Based on this chunk alone, none of the declared functional capabilities are actually represented. Because the actual code shown has a materially narrower and different observable behavior than the declared description, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

该描述与代码的核心用途存在明显偏差。代码的主功能是“抖音资源下载工具”的命令行入口:解析配置、处理 URL、调用下载器、下载内容、展示进度、记录数据库历史。这与声明中的“内容提取/转写/修顺/拆解/仿写工作流”不是同一主要目的。虽然描述中提到“下载解析”,代码确实涉及下载,但它并没有实现所强调的文本/语音处理流水线,也没有看到任何 ASR、LLM、文案抽取、仿写相关实现。因此应判定为描述与实际行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a high-level multimodal workflow centered on Douyin link processing, ASR transcription, text polishing, structural breakdown, and imitation writing. The provided code chunk is much narrower and materially different: it is a terminal UI/helper class for displaying download progress and summary statistics in a batch downloader. While the banner says 'Douyin Downloader' and the progress labels reference URL/item downloads, there is no implementation of the declared main workflow capabilities. This is not merely a supporting detail unless the surrounding skill contains the missing logic; based on this chunk alone, the actual behavior shown is a downloader progress UI, which does not accurately represent the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个高层抖音工作流编排器,核心输入应是“抖音链接”,并能根据意图执行下载解析或文案提取,再继续修顺、拆解、仿写等后续步骤。而代码仅是一个单用途的本地视频转录 CLI 工具。它既没有链接解析/下载逻辑,也没有任何 NLP 后处理(修顺、拆解、仿写)实现;模型栈也与声明不符,实际依赖是 ffmpeg + openai-whisper(可选 OpenCC),而不是 TeleSpeechASR/cpa-gpt。代码唯一与声明部分重合的是“转写”这一子能力,但只是针对已存在的本地 mp4 文件。因此该描述对主要目的、输入资源、能力范围和依赖行为都存在实质性失配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a full end-user workflow for processing Douyin links, including download/parsing, transcription, polishing, structural breakdown, and rewrite generation. The supplied code chunk is only a package initializer for a config module, re-exporting ConfigLoader and DEFAULT_CONFIG. This is merely supporting infrastructure and does not itself exhibit the declared functionality. Because the actual code’s observable behavior is far narrower and materially different from the claimed primary purpose, this chunk does not accurately represent the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a high-level Douyin link processing workflow centered on downstream media/text operations: deciding request type, downloading/parsing, extracting copy, transcribing speech, polishing text, breaking down structure, and generating imitation content. The supplied code does none of those core tasks. Instead, it is a support module dedicated to configuration management: reading YAML config, merging environment overrides, normalizing alias keys, loading cookies from strings/files, and validating numeric/date/path fields. While such config handling could support a downloader system, this chunk’s actual primary behavior is materially different from the declared workflow purpose. Therefore this code chunk does not accurately represent the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code is a static default_config definition for a downloader-oriented tool with optional transcription settings. Its primary behavior, as evidenced by this chunk, is configuration of download/scrape options and an optional OpenAI transcription endpoint. The declared description presents a much broader workflow orchestrator that detects user intent and performs multiple NLP stages beyond transcription. Those capabilities are not represented in this code chunk. Additionally, the declared default transcription model (TeleAI/TeleSpeechASR) does not match the actual configured model (gpt-4o-mini-transcribe), which is a concrete inconsistency rather than a mere implementation detail.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is for a full end-user Douyin processing workflow with branching between downloading and copy extraction, plus downstream ASR and content processing. The supplied code chunk does not implement any of those user-facing capabilities; it merely re-exports three internal support classes from a control package. While such components could support a larger downloader system, this chunk’s actual behavior is limited to infrastructure module exposure and does not accurately represent the declared primary purpose on its own.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This code chunk does not match the declared end-user functionality. The description promises a Douyin-specific controller workflow that distinguishes user intent and orchestrates link handling, transcription, correction, breakdown, and rewrite steps. The actual code is only a reusable async queue manager that limits concurrency for arbitrary tasks and downloads. While such a component could support a downloader system internally, this chunk by itself does not implement the declared primary purpose and lacks the specific media/link-processing behaviors described.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code shown is a package initializer that exports Douyin-related downloader and parsing components. This aligns partially with the 'download/parse' portion of the description, but the declared primary purpose is much broader: a master workflow that distinguishes request types and chains link processing into transcription, cleanup, analysis, and rewriting. None of those higher-level behaviors are visible in this code chunk. Since the supplied code only supports downloader-oriented functionality and not the declared full workflow, the description materially overstates what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个面向抖音链接内容处理的高层工作流,核心任务应是下载/解析后进行转写、润色、拆解和仿写。但该代码片段并未实现这些文本或语音处理流程,而是底层的数据采集客户端:向 Douyin Web API 发请求、生成 X-Bogus/a_bogus 签名、维护 msToken/cookies、解析短链接,并在接口受限时借助 Playwright 打开浏览器、滚动页面、监听网络响应、等待人工验证码通过、回写 cookies。这说明其主要行为是抓取和访问抖音资源,而非声明中的内容转写与文案工作流。虽然“解析抖音链接”与获取视频详情部分有一定相关性,但整体主用途和关键能力与声明明显不一致,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

该代码块的核心职责非常明确:作为下载器基类,围绕抖音 aweme 资源进行去重判断、本地索引、时间过滤、数量限制、无水印视频 URL 构造、视频/图集/Live Photo/封面/音乐/头像下载、JSON 元数据保存、数据库登记、manifest 追加,以及下载后的视频转写调用。这与声明中的“总控工作流”只有部分重合,重合点主要是“下载无水印”和“转写”。但声明强调的主要链路是从链接出发进行转写、修顺、拆解、仿写等内容处理,而代码并未展示任何修顺、结构化拆解、仿写生成、文案提取结果输出或基于用户意图进行路由判断的逻辑。相反,代码主要是下载与存储基础设施。按评估标准,这属于实际主用途与声明用途存在实质偏差,并且声明包含多项代码未实现的能力,因此应判定为 mismatch。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向抖音链接的高层内容处理工作流,核心能力应包括需求识别、下载或解析、语音转文字、文本润色、结构拆解以及仿写。而给出的代码片段只是一个 DownloaderFactory,根据 URL 类型返回不同下载器对象,属于底层下载组件装配逻辑。它主要处理下载器实例化及相关依赖注入,涉及 API、文件、Cookie、数据库、限流、重试和队列管理等资源,但没有任何与转写、文案提取、修顺、拆解、仿写、缺配置交互或自动安装依赖有关的实现。虽然“下载”与声明中的部分场景有弱相关,但该片段的实际职责与声明的主要目的存在明显偏差,因此应判定为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents an end-to-end Douyin link processing workflow centered on routing between download and text-oriented tasks, with a fixed chain of transcription, polishing, breakdown, and imitation writing. The supplied code does not implement that orchestration or any language-processing features. Instead, it is a narrow downloader for Douyin mixes/collections: it retrieves a mix's video list via API pagination, optionally limits item count, fetches mix metadata, and downloads each aweme's assets while tracking success/skips/failures. This partially overlaps only with the broad notion of Douyin downloading, but materially differs from the declared primary purpose and omits most stated capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向抖音链接的高层内容处理编排器,核心链路是‘链接 → 转写 → 修顺 → 拆解 → 仿写’,重点在文本提取和内容加工。而代码仅是一个具体的音乐下载模块,主要职责是获取音乐详情、解析音频 URL、下载音频/封面,并记录元数据。两者主目的明显不同:声明强调内容理解与生成,代码强调媒体资源下载与落库。虽然声明中提到“下载解析”这一方向,和下载存在弱相关,但该代码并未实现描述中的分流、转写、修顺、拆解、仿写,也没有体现“总控工作流”逻辑,因此属于明显描述-行为不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

该代码块的实际职责非常窄:对已经存在于本地路径的视频/音频文件执行转写,并把结果写入文件和数据库。从行为上看,它是“转写子模块”,而不是声明中的“抖音链接总控工作流(精简版)”。声明强调的是基于抖音链接触发、自动区分任务类型,并串联下载、转写、修顺、拆解、仿写等多个阶段;而代码既没有接收/解析链接,也没有下载、纠错、拆解、仿写、用户交互、自动安装依赖等实现。更重要的是,代码实际调用的是默认 OpenAI 转写 API(gpt-4o-mini-transcribe / https://api.openai.com/v1/audio/transcriptions),与声明中的默认转写模型 TeleAI/TeleSpeechASR 不符。因此这不是简单的“只展示部分实现细节”,而是描述与该代码块所体现的能力存在明显且实质性的不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad end-to-end Douyin processing workflow, including download parsing, copy extraction, transcription, polishing, decomposition, and rewriting. The supplied code chunk is much narrower: it validates/parses URL type and extracts IDs from specific Douyin URL formats. While URL parsing could be a supporting component of such a workflow, this chunk by itself does not implement the declared main capabilities. Therefore the description does not accurately represent what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个高层抖音链接处理工作流,核心链路包括链接解析后进行转写、文本修顺、内容拆解和仿写,并兼顾下载无水印、文案提取等需求。但所给代码仅实现下载器中的用户下载部分:校验 sec_uid 与 mode,获取用户信息,按模式调用下载策略,批量下载作品资源,并在需要时通过浏览器抓取/回补作品 ID 和详情。这与声明的主要能力存在显著偏差。虽然“下载解析”中的下载部分与代码有一定相关性,但代码没有展示任何与音频转写、文本处理、内容分析或仿写相关的实现,因此描述不能准确代表该代码块的实际行为。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a high-level Douyin link processing workflow focused on downloading/parsing and text-oriented stages such as transcription, polishing, breakdown, and imitation writing. The supplied code chunk does not implement any of those behaviors. Instead, it is an internal registry for selecting user mode strategies based on mode names such as post, like, mix, music, collect, and collectmix. That is a materially different purpose from the declared main workflow, and it also exposes content-collection modes not described in the declaration. While this may be part of a larger downloader system, this specific code chunk is not accurately represented by the declared description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description promises a high-level end-to-end Douyin processing workflow centered on links, including download parsing, text extraction, ASR transcription, cleanup, breakdown, and rewrite generation. The supplied code chunk is only an init.py that imports and re-exports downloader user mode strategy classes. Based on this chunk alone, the observable behavior is package organization for downloader modes, not the declared multifunction content-processing pipeline. This is a material mismatch in primary purpose and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的核心能力是“抖音链接→转写→修顺→拆解→仿写”的内容处理流水线,并强调下载解析与文案提取两类需求的自动区分。给出的代码片段却是 downloader 的基础策略实现,负责调用 API 分页获取用户作品、限流、游标翻页、去重、时间/数量过滤,以及把某些元数据项扩展成 aweme 项后交给下载器下载。该代码面向用户作品采集/下载基础设施,而不是面向单条链接的文案提取或语音转文字处理;也没有出现 TeleSpeechASR、GPT 修顺、结构拆解或仿写等任何实现痕迹。因此这不是轻微实现细节差异,而是主要用途与能力明显不一致。

Content

No source excerpt is available for this finding.