Back to skill

Security audit

X Deep Miner

Security checks for vulnerabilities and agentic risk

Overview

This skill is an underimplemented X-to-Obsidian scaffold that asks users to set up persistent hourly execution without enough scoping or removal guidance.

Review this before installing if you are comfortable with a Chinese-language, mostly unfinished scaffold. Do not add the suggested cron job unless you want persistent hourly execution, use absolute paths, restrict permissions on the project directory, and document how to remove the crontab entry later.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T06 · System Persistence

Warning
Location
SKILL.md:25
Finding
Persistent Hourly Execution Through User Crontab<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 25-28 **Vulnerability Type**: Persistent scheduled task **Risk Level**: Medium ### Vulnerable Code ```bash # 设置定时任务 crontab -e 0 * * * * cd /path/to && python3 scripts/x_deep_miner.py scan ``` ### Technical Analysis The documentation instructs the user to create an indefinite hourly cron job. This establishes cross-session persistence under the user account and causes Python code from the project directory to execute automatically. Scheduled scanning is consistent with the Skill's advertised hourly automation, but the persistence exceeds what is necessary for manual operation. It is particularly disproportionate in the current implementation because `search_x_tweets()` is only a placeholder and always returns an empty result set. Consequently, the scheduled task repeatedly executes code without currently delivering the advertised automated collection functionality. The cron entry also runs a relative script from a potentially mutable project directory. If `scripts/x_deep_miner.py` or its imported local environment is later replaced or compromised, the modified code will automatically run every hour without further user interaction. The project does not provide validation of the executable path, integrity controls, a restricted execution account, or documented removal instructions. The project does not programmatically modify the crontab; persistence occurs only if a user manually follows these instructions. ### Attack Path 1. A user follows the setup instructions in `SKILL.md`. 2. The user replaces `/path/to` with the project directory and installs the supplied cron entry. 3. Cron begins invoking `scripts/x_deep_miner.py scan` every hour under that user's account. 4. An attacker or another compromised process that gains write access to the project directory modifies the scheduled Python script or relevant local code. 5. At the next hourly interval, cron executes the modified code ...[truncated 697 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make manual, on-demand execution the default workflow and remove cron installation from the basic usage instructions. 2. Offer scheduling only as an explicit, informed opt-in after the automated scanning functionality is implemented. 3. Use validated absolute paths for both the Python interpreter and script rather than relying on `cd` and a relative script path. 4. Run the task through a dedicated wrapper with a minimal environment, restrictive file permissions, and explicit logging. 5. Use a dedicated least-privileged account where practical; do not run the scheduled task as root. 6. Ensure the project directory and scheduled script are not writable by untrusted users. 7. Document how to inspect and remove the task, for example with `crontab -l` and `crontab -e`. 8. Provide a supported disable or uninstall command that removes only this Skill's scheduled entry. 9. Consider a user-visible scheduler that supports enable/disable controls and execution history instead of directly editing the crontab. 10. Add integrity or ownership checks before scheduled execution if the code remains in a mutable location. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description overstates the implemented functionality. While the code structure aligns with the general theme of an X/Twitter mining-to-Obsidian workflow, the core capabilities are not actually implemented: tweet collection is only described in comments/prints, no real browser or API calls occur, no automatic hourly scheduling exists, and translation is not performed. The Obsidian note generation and local file output do match part of the declaration, but the primary promised behavior is only a scaffold rather than a functioning auto-scanning/translation pipeline.

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill advertises operational behavior and references executable scripts, but the manifest declares no explicit tool scope or permissions despite detected capabilities for environment access and file read/write. This creates an overbroad and non-transparent trust boundary: operators cannot easily tell what resources the skill may use, which increases the chance of unintended data access or modification when the skill is installed or reviewed.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The description says the skill will automatically translate content into professional Chinese articles, which imposes a specific language choice by default. Under the language/locale policy, this is a natural-language policy concern unless the skill explicitly offers user choice or documents a justified locale constraint.

Session Persistence

Medium
Category
Rogue Agent
Content
python3 scripts/x_deep_miner.py status

# 设置定时任务
crontab -e
0 * * * * cd /path/to && python3 scripts/x_deep_miner.py scan
```
Confidence
85% confidence
Finding
The skill documentation explicitly instructs users to install a cron job for recurring execution, which introduces persistence on the host outside the normal interactive session. In security-sensitive environments, unattended periodic execution can repeatedly access files, environment variables, network resources, or generate content without ongoing user review, increasing the blast radius if the underlying script is later modified or behaves unexpectedly.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The manifest describes an operational skill that automatically scans high-heat X posts every hour, translates them into professional Chinese articles, and outputs Obsidian format. In contrast, this documentation explicitly says auto-crawling and translation still require manual steps or future API integration, and calls the hourly scan 'currently simulated,' indicating the implemented behavior does not match the advertised capability.

Tainted flow: 'CONFIG_FILE' from os.environ.get (line 20, credential/environment) → open (file write)

Medium
Category
Data Flow
Content
def save_config(config: dict):
    """保存配置"""
    CONFIG_FILE.parent.mkdir(parents=True, exist_ok=True)
    with open(CONFIG_FILE, 'w') as f:
        json.dump(config, f, indent=2)
Confidence
65% confidence
Finding
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The documentation says the function '抓取用户 Timeline 新帖' using a managed browser, which describes an implemented scraping action. In reality, the body performs no browser interaction or tweet extraction and always returns an empty list, so the inline intent directly contradicts the actual behavior.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The docstring states that the function translates text into professional Chinese while preserving technical terms. The implementation is a placeholder that returns the original text without any translation, which is a direct contradiction rather than merely incomplete documentation.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The function docstring explicitly says content will be translated into Chinese, and the rest of the user-facing output is also Chinese. This enforces a specific language/locale without any opt-in, fallback, or documented regional justification, which matches the natural-language policy violation criteria.

Tainted flow: 'output_path' from os.environ.get (line 168, credential/environment) → open (file write)

Medium
Category
Data Flow
Content
filename = f"{datetime.now().strftime('%Y%m%d_%H%M%S')}_{safe_title}.md"
    
    output_path = OUTPUT_DIR / category / filename
    with open(output_path, 'w', encoding='utf-8') as f:
        f.write(note)
    
    print(f"  ✓ 已保存: {output_path}")
Confidence
65% confidence
Finding
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
This markdown file contains user-facing instructions exclusively in Chinese, and there is no note that the skill is region-specific or that alternative languages are supported. Per the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Static analysis

No suspicious patterns detected.