Back to skill

Security audit

cn-geo-monitor

Security checks for vulnerabilities and agentic risk

Overview

This skill has a plausible Chinese AI search optimization purpose, but its prediction script is unsafe with untrusted input and the remote data sharing is under-disclosed.

Review this before installing. Do not run predict.sh with untrusted arguments until its payload construction is fixed, and avoid submitting confidential drafts, brand plans, competitors, or search queries unless you are comfortable sending them to the listed Tencent SCF API. Prefer running it in a constrained environment and require explicit confirmation before any remote API call.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/predict.sh:7
Finding

Arbitrary Local Command Execution Through Python Source Injection

Content
View full analysis
/dev/null || echo "{}") ``` ### Technical Analysis The script inserts the user-controlled `TEXT`, `PLATFORM`, and `HISTORY` variables directly into Python source code passed to `python3 -c`. Quoting the shell variables does not make them safe for inclusion in Python syntax. The `HISTORY` value is especially straightforward to exploit because it is inserted as an unquoted Python expression: ```python 'historyCount': $HISTORY ``` An attacker can provide an arbitrary valid Python expression instead of an integer. Python evaluates that expression while constructing the dictionary. Expressions using modules such as `os` or `subprocess` can therefore execute operating-system commands. The `TEXT` and `PLATFORM` parameters are also unsafe. Crafted values can terminate their surrounding Python string literals and inject additional Python syntax. The use of triple quotes around `TEXT` does not prevent injection because the attacker can include a matching triple-quote sequence. The fallback `|| echo "{}"` does not mitigate the vulnerability. Injected commands execute before Python exits, even if the resulting Python program later raises an exception. ### Attack Path 1. An attacker controls or influences arguments supplied to `scripts/predict.sh`. This can occur through direct CLI access or through an Agent that incorpor ...[truncated 1606 chars]
Remediation
View remediation
&2 exit 1 } PAYLOAD=$(python3 - "$TEXT" "$PLATFORM" "$HISTORY" <<'PY' import json import sys text = sys.argv[1] platform = sys.argv[2] history_count = int(sys.argv[3]) print(json.dumps({ "text": text, "platform": platform, "historyCount": history_count, })) PY ) ``` Additional hardening measures should include: 1. Validate that `--history` contains only an integer within an expected range. 2. Restrict `--platform` to an explicit allowlist of supported platform identifiers. 3. Reject missing option values instead of relying on positional expansion. 4. Preserve content as opaque data and never evaluate it as shell, Python, or template syntax. 5. Add regression tests containing quotes, triple quotes, newlines, Python expressions, and shell metacharacters. 6. Run the Skill with least privilege and without unnecessary access to credentials or sensitive files to limit impact if another injection flaw is introduced. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The supplied code does align with part of the description: it is an executable CLI script that calls an API backend and returns per-engine Chinese AI optimization data such as citation style, preferred sources, content preferences, and optimization tips. However, the declared purpose makes much broader claims, including real AI visibility checking, competitor comparison, and a 5-dimension content prediction/calibration system. None of those capabilities appear in this code chunk. The actual behavior is limited to fetching and displaying engine data from /cn-ai-engines, optionally filtered by engine. Because the description presents a multi-function optimization tool while the code only implements the data-query portion, this is a meaningful description-versus-behavior mismatch.

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, feature-rich Chinese AI search optimization platform with multiple analytical and optimization capabilities. The supplied code chunk, however, only implements a simple CLI wrapper around a remote /geo-engines endpoint and formats returned data for display. While this may loosely fit the claim of having executable CLI scripts and an engine database, it does not demonstrate the core advertised functions such as DeepSeek visibility testing, competitor comparison, prediction/calibration, or engine-specific optimization logic. Therefore the code chunk materially under-delivers relative to the declared primary purpose.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises executable CLI scripts and shell-based usage but does not declare any explicit tool scope such as allowed-tools or permissions. That creates an authorization ambiguity where an agent or runtime may permit broader shell access than users expect, increasing the risk of unintended command execution or unsafe tool invocation in response to loosely related prompts.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list contains broad marketing and analysis phrases that can cause the skill to activate in contexts far beyond its narrow intended purpose. Overbroad invocation increases the chance that users are funneled into external API workflows or shell-backed actions without clear relevance, consent, or expectation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill prominently promotes a public web app and remote API endpoint without warning users that submitted content, brand strategy, and optimization inputs may be sent to third-party infrastructure. In a business context, those inputs can include confidential marketing plans or unpublished content, making silent transmission risky.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow requires users to submit brand names, competitor identities, and search queries to external APIs, but it does not warn that potentially sensitive business intelligence will leave the local environment. This can expose confidential strategy, campaign planning, or internal competitive research to third-party services without informed consent or data handling expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script silently sends user-supplied input and execution metadata to a hard-coded remote Tencent SCF endpoint via curl, but gives no user-facing disclosure that network transmission will occur or what endpoint is contacted. In a CLI tool marketed as a data/optimization utility, this can surprise users, leak queried brand or competitor terms to a third party, and make trust decisions impossible because the destination is opaque and not documented in-script.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest centers on optimization for specific Chinese AI engines such as DeepSeek, Kimi, 豆包, 通义, and 文心, with per-engine citation logic and AI visibility features. This script instead accepts a generic 'platform' parameter defaulting to 'baidu' and posts text to a '/predict' endpoint for content scoring, which does not reflect engine-specific AI search optimization behavior described by the skill.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
97% confidence
Finding

The script performs external transmission of user-provided content to a hard-coded remote endpoint. In the context of a CLI tool that invites users to submit content drafts for analysis, this creates a real data-exposure risk, especially if users assume processing is local or paste confidential prepublication material.

Content

Scanner excerpt · scripts/predict.sh (reported line 17)May include surrounding context.

sh
done
[[ -z "$TEXT" ]] && echo "❌ 请提供内容文案" && exit 1
PAYLOAD=$(python3 -c "import json; print(json.dumps({'text': '''$TEXT''', 'platform': '$PLATFORM', 'historyCount': $HISTORY}))" 2>/dev/null || echo "{}")
RESPONSE=$(curl -s -X POST "${API_BASE}/predict" -H "Content-Type: application/json" -d "$PAYLOAD" --connect-timeout 10 --max-time 15)
SCORE=$(echo "$RESPONSE" | jq -r '.data.overallScore // 0')
RECO=$(echo "$RESPONSE" | jq -r '.data.recommendation // "未知"')
PHASE=$(echo "$RESPONSE" | jq -r '.data.calibrationPhase.name // "冷启动期"')

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script transmits arbitrary user-supplied content to a remote API endpoint without any clear warning, consent step, or data-handling disclosure. Users may paste unpublished marketing copy, internal brand strategy, or sensitive business text, causing unintended exfiltration to a third-party service and associated privacy/compliance risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The instruction "你是一个中国AI搜索引擎优化专家" establishes a fixed Chinese-language operating mode and role, while the rest of the file mixes English and Chinese and does not state that the user may choose another language. This can violate a language/locale choice policy when the skill forces a locale-specific interaction style without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script's descriptive comments and terminal output are entirely in Chinese, which imposes a specific language on users without any opt-in or indication that the tool is intentionally region- or locale-specific. Under the stated policy, forcing a language without user choice is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

User-facing strings in the usage and error/help output are only in Chinese, and the example input also assumes Chinese content. This imposes a specific language/locale experience without any opt-in or explanation that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.