Back to skill

Security audit

公众号投资博主蒸馏器

Security checks for vulnerabilities and agentic risk

Overview

The skill’s main article-analysis purpose is real, but it has unsafe side effects and broad data collection that users should review before installing.

Install only if you are comfortable giving the skill a RedFox API key, letting it fetch and store WeChat article content and engagement data locally, and reviewing generated files as untrusted. Run it in an isolated workspace or virtual environment, avoid sensitive working directories, do not pass path-like account or author names, and consider removing the automatic pip install and adding explicit confirmation before web search, raw-content storage, and profile generation.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/gzh.py:113
Finding

Path Traversal Through Unvalidated Account and Author Names

Content
View full analysis
Remediation
View remediation
str: if not value or not SAFE_NAME.fullmatch(value): raise ValueError(f"Invalid {field}") if value in {".", ".."}: raise ValueError(f"Invalid {field}") return value ``` 2. Reject `/`, `\`, drive prefixes, absolute paths, null bytes, and parent-directory components explicitly. 3. Resolve every destination and verify that it is a descendant of the intended base directory: ```python def safe_output_path(base: Path, filename: str) -> Path: base = base.resolve() candidate = (base / filename).resolve() if candidate.parent != base: raise ValueError("Output path escapes the designated directory") return candidate ``` 4. Use a stable internal identifier, such as a digest of the account ID, for cache filenames rather than a raw external value. 5. Store display names inside file content rather than using them directly as filenames. 6. Add tests covering `../`, absolute paths, Windows drive paths, UNC paths, Unicode separators, empty names, and oversized values. 7. Use restrictive permissions when creating files that may contain complete article data. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:32
Finding

Indirect Prompt Injection Through Untrusted Remote Article Content

Content
View full analysis
**All extraction must be performed article by article from the complete raw > text. Reliance on any clean or NER intermediate layer is prohibited.** 1. Raw-text principle: all extraction must directly traverse raw article bodies. 2. Dictionary and alias matching must be used for stock extraction. 3. Sector attention must be counted at article level. 4. Investment-domain phrases must be extracted using a dedicated keyword list. 5. Validation must be run after distillation. ``` ```markdown ### Step B: AI-generated style profile The AI reads the distillation task and generates the final product according to the seven-dimensional DNA framework. The style profile must contain seven sections, and each section must contain: - Specific feature descriptions - At least two original-text quotations - Reusable rules or templates - Distillation confidence ``` ```python # scripts/distill.py:991-1001 articles = fetch_articles( account=account, author_name=author_name, count=count, api_key=api_key, force_refresh=force_refresh, ) if not articles: error(f"No article data was obtained for {author_name}") return False articles_file = OUTPUT_DIR / f"{author_name}_完整文章.json" articles_file.write_text( json.dumps(articles, ensure_ascii=False, indent=2), encoding="utf-8", ) ``` ```python # scripts/distill.py:1034-1039 print(" Ask the AI to read the following files and generate the profile:") print(f" 1. {brief_file}") print(f" 2. {task_file}") print(f" 3. {profile_file}") print(f" 4. Reference template: {SCRIPT_DIR}/assets/profile_template.md") print(f" Output to: {OUTPUT_DIR}/{author_name}_风格画像.md") ``` The quoted prose and status strings above are English translations of ...[truncated 2705 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/distill.py:61
Finding

Automatic Installation of an Unpinned Dependency During Environment Checks

Content
View full analysis
Remediation
View remediation
--hash=sha256: ``` 4. Maintain a lock file that also pins transitive dependencies. 5. Direct users to install dependencies explicitly in an isolated virtual environment. 6. Use an approved package index and disable unexpected extra indexes in controlled deployments. 7. Review and update dependency pins through a documented maintenance process. 8. If programmatic installation is absolutely required, obtain explicit confirmation and invoke: ```python subprocess.run( [sys.executable, "-m", "pip", "install", "--require-hashes", "-r", requirements], check=True, shell=False, ) ``` 9. Do not perform installation during ordinary Skill startup or environment validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/gzh.py:205
Finding

Unbounded Recursive Retry on Remote API Rate-Limit Responses

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The documented purpose says the skill performs style distillation, but the behavior includes authenticated scraping/collection, local caching, and handling API keys, while the core analysis functionality is only described procedurally rather than bounded and verifiable. This mismatch can mislead users and orchestrators into granting broader capabilities than expected, causing hidden data collection and storage under the guise of simple analysis.

Content

No source excerpt is available for this finding.

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
93% confidence
Finding

The script executes a shell command to install a package at runtime via os.system, which is unnecessary for the core analysis task and expands the attack surface. Although sys.executable is usually local and not attacker-controlled here, shell execution can still trigger unintended command execution paths, package supply-chain risk, and side effects without user consent.

Content

Scanner excerpt · scripts/distill.py (reported line 68)May include surrounding context.

python
info("requests 已就绪")
    except ImportError:
        warn("缺少 requests,正在安装...")
        os.system(f"{sys.executable} -m pip install requests")
        try:
            import requests
            info("requests 安装成功")

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The overview emphasizes automatic collection and analysis of WeChat articles and engagement metrics but does not prominently warn users that third-party content and metadata will be collected. This creates privacy, consent, and compliance risk because operators may use the skill on accounts or content without understanding collection scope, retention, or downstream use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README encourages broad natural-language use ('Simply describe your needs in natural language') without clearly constraining what the skill will and will not do. In an agent setting, vague invocation boundaries can cause over-collection, unintended actions, or misuse-triggering prompts because users and orchestration layers are not given explicit limits on supported operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README states that the skill collects not only article text and metadata but also reading, likes, shares, favorites, and comment data, and writes outputs to local files, yet it does not clearly warn users about the privacy, compliance, and data-handling implications of collecting third-party engagement/comment data. This increases the risk of users unintentionally processing potentially sensitive or platform-restricted data without understanding retention, disclosure, or consent issues.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill describes shell, network, file read/write, and environment-variable usage but declares no explicit tool scope or permission boundaries. In an agent setting, this expands the blast radius: the skill can read secrets, make authenticated external requests, and persist fetched third-party data without an upfront least-privilege contract.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad enough to match ordinary investment-analysis requests, which can cause the skill to activate in contexts where the user did not clearly intend third-party data collection and profiling. In practice, this increases the chance of surprise execution of networked collection and persistence behaviors.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill does not clearly warn that it will automatically collect, analyze, and profile third-party public-account content and related background/social information. Without an explicit privacy notice and purpose limitation, users may unknowingly initiate profiling and retention of third-party data, creating privacy and compliance risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The workflow instructs the agent to collect and synthesize not just article text but broader persona, history, interaction, milestone, and social-relationship data about third parties. That materially increases surveillance/profiling scope and can create detailed dossiers unrelated to the user's minimal need, especially when combined with AI-generated inferences.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The instruction to have AI automatically gather additional background information via web search without user-supplied input encourages silent expansion of the dataset and profiling scope. This makes the skill more dangerous because it normalizes hidden enrichment of third-party identities and beliefs beyond the originally requested article analysis.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill requires storing full article bodies, UUID caches, structured profiles, and validation reports in local output files, creating a persistent repository of third-party content and derived sensitive inferences. Persistence increases breach, misuse, and secondary-use risk, especially if file permissions, retention periods, or deletion controls are not defined.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The template is written entirely in Chinese and all required section headings and field labels are fixed in Chinese, which implicitly constrains the skill output to a specific language. Under the policy, language-specific behavior should offer user opt-in or clearly document the locale constraint and justification, which this file does not do.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The environment-check path automatically installs dependencies and executes shell commands even though the advertised purpose is article distillation. That mismatch increases risk because users may invoke a content-analysis tool expecting passive processing, not system modification or network/package operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatic package installation is performed without explicit user confirmation, causing unannounced environment changes and potential package supply-chain exposure. In a tool meant for content analysis, that behavior is unexpected and can be abused indirectly through compromised package indexes, mirrors, or dependency confusion scenarios.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script persists full fetched article bodies to disk, which goes beyond the minimal data needed to produce a profile and creates a local data-retention risk. If the fetched corpus contains sensitive, proprietary, or private content, this behavior increases exposure through disk compromise, backups, or accidental sharing.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Fetched article data is written to disk without an upfront privacy notice or consent flow, creating avoidable retention and disclosure risk. The danger is higher because the tool later encourages downstream AI processing of the saved corpus, amplifying the amount of content exposed and retained.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script saves full article content and instructs downstream AI to deeply read and distill it into profiles without any data-minimization boundaries, privacy filters, or sensitivity checks. This can propagate personal, confidential, or copyrighted material into derivative outputs and additional artifacts, increasing compliance and privacy exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README states that output artifacts are generated in the local output directory, but it does not clearly warn that these files may contain scraped third-party content, analytical inferences, and identifiers. Users may inadvertently expose sensitive or regulated data through local storage, sync tools, backups, or repository commits.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

脚本在环境检查中调用 get_api_key() 并将密钥前 8 位打印到终端。虽然获取文章数据可能需要认证,但在终端回显密钥片段属于额外的敏感信息处理行为,不是“提取交易体系、风格画像”等分析目标所必需。

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

除结构化画像外,脚本还会写出统计数据 JSON、数据底稿 Markdown、蒸馏任务 Markdown,以及后续校验报告。虽然这些可作为实现辅助,但 manifest 未说明会产出多份中间分析工件,而不仅是最终 profile。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code creates an output directory and writes account-specific UUID cache data to a local file. Although the module and function docstrings mention caching behavior, there is no runtime confirmation or explicit user-facing warning at the point of persistence that data tied to the target account will be stored locally.

Content

No source excerpt is available for this finding.