Back to skill

Security audit

wh-x-post

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for posting to Twitter/X, but it deserves review because it can publish from the user's account through an unpinned third-party CLI and has broad activation phrasing.

Install only if you are comfortable letting an unpinned twitter-cli package act through your logged-in Twitter/X browser session. Review the exact post, reply, quote target, account, and images before approving any action, and consider installing a pinned reviewed version of the dependency in an isolated environment.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
scripts/common.py:27
Finding

Unpinned Third-Party Executable Dependency

Content
View full analysis

Vulnerability Details

File Locations:

  • SKILL.md:10-13
  • _meta.json:9-11
  • scripts/common.py:27-44

Vulnerability Type: Unpinned executable dependency and insufficient supply-chain integrity controls
Risk Level: Medium

Vulnerable Code

Installation instructions in SKILL.md:10-13:

bash
pip install twitter-cli
uv tool install twitter-cli
pipx install twitter-cli

Dependency declaration in _meta.json:9-11:

json
"dependencies": [
  "twitter-cli (pip install twitter-cli)"
]

Dependency execution in scripts/common.py:27-44:

python
python = find_python()
cmd = [python, "-m", "twitter_cli"] + args
if json_output:
    # Avoid duplicate --json
    if "--json" not in args and "--yaml" not in args:
        cmd.append("--json")

try:
    result = subprocess.run(
        cmd,
        capture_output=True,
        text=True,
        timeout=60,
    )

Technical Analysis

The Skill instructs users to install twitter-cli without specifying an exact reviewed version, package hash, lock file, or verified distribution source. It then executes the installed package as Python code through python -m twitter_cli.

Although subprocess arguments are safely passed as a list and no shell injection was identified, this does not protect against malicious or compromised code inside the dependency itself. The effective implementation of authenticated Twitter operations is outside the reviewed project and can change independently after this Skill is audited.

The dependency receives user-controlled tweet text, tweet identifiers, image paths, and access to the local environment used to obtain browser-based Twitter authentication. Consequently, integrity compromise of the package would provide a direct code-execution path under the user's account.

Attack Path

  1. An attacker compromises the package publisher, distribution account, build process, or a ...[truncated 1466 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin twitter-cli to an exact version that has undergone security review.
  2. Require artifact hash verification, such as a hashes-enforced requirements file or lock file generated from trusted artifacts.
  3. Document and verify the expected package publisher, canonical source repository, and distribution channel.
  4. Review dependency source code and release changes before updating the pinned version.
  5. Run the dependency in an isolated environment with the minimum necessary filesystem and browser-profile access.
  6. Avoid exposing unrelated environment variables, credentials, home-directory files, or browser profiles to the subprocess.
  7. Prefer an audited official Twitter API client using narrowly scoped credentials where operationally possible.
  8. Add automated dependency integrity and vulnerability scanning to the release process.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • 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
Findings (10)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill begins by forcing the assistant into Chinese ('你是一个 Twitter/X 操作助手') without any user language preference or negotiation. While not directly enabling code execution or data theft, this can degrade consent and usability, increase the chance of user misunderstanding around high-impact actions like social media posting, and make confirmation less reliable if the user expects another language.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases include broad, natural-language expressions such as '帮我发这条' and 'reply to this' that can plausibly appear in ordinary conversation without the user intending to invoke this specific skill. In an agent environment, that ambiguity can cause unintended activation and lead to accidental posting, replying, or quoting on the user's Twitter/X account if downstream confirmation is weak or bypassed.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/common.py (reported line 40)May include surrounding context.

python
cmd.append("--json")

    try:
        result = subprocess.run(
            cmd,
            capture_output=True,
            text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This code returns multiple user-visible status and error messages in Chinese, such as timeout and installation guidance, with no indication that the skill is intentionally region- or language-specific. That creates a natural-language policy concern because the skill effectively forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The exception and CLI error handling paths continue the same pattern of emitting Chinese-only messages for execution errors, login prompts, rate limits, and empty output. Because these are user-visible responses in a general utility module, they impose a locale choice that is not configurable or explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code emits user-facing error messages in Chinese only (for tweet length and image-count validation) while the rest of the interface and usage text are in English. That creates a language policy issue because the skill enforces a specific locale without offering the user a choice or documenting that it is intended only for Chinese-speaking users.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code emits user-facing error messages in Chinese only, such as at L40 and L53. The file does not offer a locale option or document that the skill is intentionally region-specific, so it violates the language/locale policy criterion.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script returns error messages in Chinese string literals, which imposes a specific language on users without any visible opt-in or locale selection. This is a natural-language policy issue because the file provides no mechanism to choose or document the enforced language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest description is written entirely in Chinese and gives no indication that language selection is optional or tied to a justified region-specific use case. Under the policy, forcing or assuming a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code emits the fallback error message "未知错误" unconditionally, which forces a specific language in user-facing output without any visible user opt-in or locale selection. This is a natural-language policy concern because the skill otherwise presents its interface in English but may return Chinese text in some cases.

Content

No source excerpt is available for this finding.