Back to skill

Security audit

抖音相似账号推荐

Security checks for vulnerabilities and agentic risk

Overview

This Douyin analysis skill is mostly purpose-aligned, but it needs Review because it persists and searches for API keys, forces verbatim output with subscription prompts, and ships an unsafe wrapper script.

Install only if you are comfortable sending Douyin account names or IDs to RedFox and using a RedFox API key. Prefer a platform secret store or temporary session environment variable instead of letting the skill modify shell profiles, and treat the subscription prompt as under-specified until the publisher documents opt-in, unsubscribe, retention, and notification behavior.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:70
Finding

Forced Verbatim Output Enables Recurring Promotional Content Injection

Content
View full analysis
助手:调用脚本 `python scripts/douyin_similar_account.py --account_id "一乐店长"`,将脚本输出原样完整展示,禁止摘要、改写、增减或添加额外评论 > 用户:查抖音号geng970616的相似账号 > > 助手:调用脚本 `python scripts/douyin_similar_account.py --account_id "geng970616"`,将脚本输出原样完整展示,禁止摘要、改写、增减或添加额外评论 ``` ```markdown > **强制约束:脚本输出的完整文本即为最终结果,AI必须原样呈现,禁止任何形式的摘要、改写、增减、重组或二次加工。不得在脚本输出前后添加任何额外的总结、解读或评论。** ``` ```markdown ## 订阅服务 查询结果末尾自动输出订阅服务提示,文案如下: ``` 是否订阅「{查询账号昵称}」的相似账号最新信息推送? 1. 每日下午19点推送最新数据。可自行选择推送频率和时间~ 2. 暂不需要 > 💼 另外红狐配套全量数据库可提供完整详实数据,如需了解采购方案,可前往红狐hub[企业服务](https://redfox.hk/dashboard/enterprise)对接咨询 ``` ``` ```python # 订阅服务提示 account_name = current_account.get("nickname") or account_id if current_account else account_id output_lines.append("") output_lines.append(format_subscription_prompt(account_name)) return "\n".join(output_lines) # ============================================================ def format_subscription_prompt(account_name): """查询结果末尾输出订阅服务提示文案""" lines = [] lines.append(f"是否订阅「{account_name}」的相似账号最新信息推送?") lines.append("") lines.append("1. 每日下午19点推送最新数据。可自行选择推送频率和时间~") lines.append("2. 暂不需要") return "\n".join(lines) ``` ### Technical Analysis The skill instructions explicitly require the agent to reproduce script output without review, modification, summarization, or additional commentary. The executable script then automatically appends a subscription solicitation to every query result, while the documented output template additionally includes a commercial enterprise-service link. This combination alters how the agent composes its current-session response and prevents it from exercising normal output review. It al ...[truncated 1956 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
query_wrapper.py:13
Finding

Relative-Path Source Execution Allows Local Script Substitution

Content
View full analysis
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (19)

exec() call detected

High
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The wrapper reads a Python file from disk and executes its contents with exec(), which turns the file into dynamically evaluated code rather than an imported module or subprocess target. If an attacker can modify, replace, or influence scripts/douyin_similar_account.py or the working directory, this becomes arbitrary code execution in the agent context.

Content

Scanner excerpt · query_wrapper.py (reported line 15)May include surrounding context.

python
# 直接调用脚本
sys.argv = ['script', '--account_id', '疯狂小杨哥']
exec(open('scripts/douyin_similar_account.py', encoding='utf-8').read())

Direct flow: open (file read) → exec (code execution)

High
Category
Data Flow
Confidence
97% confidence
Finding

This is a direct file-read-to-code-execution flow: the program opens a file and immediately passes its contents to exec(). That pattern is inherently dangerous because any tampering with the file or path resolution leads to execution of attacker-controlled Python code with the privileges of the running process.

Content

Scanner excerpt · query_wrapper.py (reported line 15)May include surrounding context.

python
# 直接调用脚本
sys.argv = ['script', '--account_id', '疯狂小杨哥']
exec(open('scripts/douyin_similar_account.py', encoding='utf-8').read())

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file is in scope for vague-trigger checks. The instruction 'Simply describe your query needs in natural language—no commands to memorize' does not define specific activation boundaries or exclusions, which makes the invocation condition broad and potentially overlapping with ordinary conversational requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The example 'Analyze competitor accounts in my niche for me' is generic enough to overlap with common analysis requests and does not clearly indicate that it is specifically for Douyin similar-account benchmarking. Without narrower wording or exclusions, the trigger scope remains ambiguous.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The security section discusses API key handling but does not warn that user-supplied Douyin nicknames, account IDs, and subscription preferences may be sent to Redfox, an external service. This omission undermines informed consent and can expose user-provided identifiers, competitive research targets, and monitoring preferences to a third party without clear disclosure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README encourages invocation through broad natural-language phrases without defining clear boundaries, confirmation steps, or data-handling constraints. In a skill that queries external APIs and supports subscription setup, this can cause accidental invocation on ambiguous requests and lead to unintended transmission of Douyin identifiers or analysis requests to the third-party service.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation clearly directs use of shell commands, environment variables, networked API access, and referenced local files, but it does not declare any explicit tool scope or permissions boundary. This makes the operational capability broader and less auditable than the manifest suggests, increasing the chance an agent may invoke sensitive capabilities without clear user or platform review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documented subscription push feature expands the skill from one-time account analysis into ongoing monitoring and outbound notifications, but that capability is not reflected in the manifest description or scoped permissions. Hidden or under-declared behavioral expansion is risky because users and platforms cannot accurately assess what data handling or continued actions the skill may perform.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs the agent to persistently modify shell startup files or user-level environment settings to store an API key, which is a sensitive credential. This is dangerous because it causes long-lived secret persistence on the user's machine, may expose the key to other tools or sessions, and authorizes the agent to alter user configuration beyond the immediate task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The setup guidance tells the agent to permanently write the API key into shell profiles or user environment variables without warning about persistence, exposure, or safer alternatives. This increases the likelihood of credential leakage through profile files, inherited environments, terminal history, or access by unrelated tools and future skills.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The FAQ states that users can subscribe to recurring push updates at scheduled times, which materially exceeds a simple recommendation workflow and implies retained state, scheduling, or future outbound actions. When such behavior is not prominently declared and permissioned, it creates consent and data-governance risks and can surprise users with continuing activity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file contains Chinese-only comments and hardcodes a Chinese account identifier in the invoked arguments, which indicates the skill is tailored to a specific language/locale without any user opt-in or documented justification. This matches the policy category for language or locale constraints expressed in natural language or config-like values.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow instructs the system to send user-supplied Douyin account names or IDs to a third-party API endpoint, but it does not warn the user that their input will be transmitted externally. This undermines informed consent and may expose personal or business-identifying account data to a third party without transparent disclosure, which is more concerning here because the skill is specifically built around external enrichment of user-provided identifiers.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow mandates that the script output be shown verbatim as the final answer, yet the file also appends subscription prompts and enterprise-service promotion after the claimed terminal output. This creates an undeclared secondary behavior where a data-query skill can steer users into ongoing notifications or commercial upsell, which is risky because users may treat it as part of the trusted analytical result rather than optional marketing.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill's stated purpose is similar-account analysis, but it also includes subscription push messaging and enterprise-service lead generation unrelated to fulfilling the immediate query. That scope expansion increases the chance of dark-pattern behavior, consent confusion, and secondary use of user/account data beyond the user's original intent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script does more than read an API key from the process environment: it scans multiple shell startup files and Windows profile/registry locations to extract credentials. That broad local secret discovery increases exposure of unrelated secrets stored in user configs and exceeds least-privilege expectations for a tool whose primary function is remote Douyin account analysis.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The tool sends user-supplied Douyin account identifiers and related analysis context to a third-party API endpoint without any explicit user-facing notice or consent flow. In the context of an agent skill, this creates a privacy and transparency risk because users may reasonably assume the analysis is local or not realize their inputs are being transmitted externally.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

Natural-language policy checks apply to all file types. Line 105 switches to Chinese in an English README and does not offer a language choice or explain a locale-specific requirement, which can violate language/locale expectations for users of the English skill documentation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest scope is a recommendation and analysis tool for finding similar Douyin accounts. The output adds a prompt asking whether to subscribe to future updates, but the script contains no subscription workflow, persistence, or notification handling, making this behavior semantically mismatched with the stated tool purpose.

Content

No source excerpt is available for this finding.