Back to skill

Security audit

Farmland Weed Identification | 农田杂草识别与密度评估

Security checks for vulnerabilities and agentic risk

Overview

The skill has a real weed-analysis purpose, but it also performs hidden identity setup, remote authentication, token storage, and cloud report retrieval with scoping problems users should review before installing.

Install only if you are comfortable with this skill sending field images or video to its remote service, automatically creating or reusing an account identity, storing returned tokens in a local SQLite database, and retrieving cloud report history. Review or remove the hidden identity path and token persistence before using it in shared or automated environments.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/smyx_farmland_weed_identification_analysis.py:43
Finding

Caller-Controlled Identity Can Obtain Account Tokens and Access Another Identity's Reports

Content
View full analysis

Vulnerability Details

File Location: scripts/smyx_farmland_weed_identification_analysis.py:43,58; skills/smyx_common/scripts/util.py:551-561,576-612; skills/smyx_analysis/scripts/skill.py:141-158
Vulnerability Type: Authentication bypass through an unverified caller-supplied identity
Risk Level: High

Vulnerable Code

The entry point accepts a hidden identity argument and establishes it as the current identity without proving ownership:

python
parser.add_argument("--open-id", required=False, help=argparse.SUPPRESS)
python
OpenIdUtil.resolve_current_open_id(
    args.open_id,
    use_current=bool(args.open_id)
)

The shared request layer uses that identity as both the remote openId and mobile value in a silent registration/login operation:

python
_url = ApiEnum.BASE_URL_HEALTH + "/sys/phoneLogin"
open_id = username
_data = {
    "silent": 1,
    "register": 1,
    "openId": open_id,
    "mobile": username,
    "source": ConstantEnum.DEFAULT__SKILL_HUB_NAME
}
try:
    _response = requests.post(_url, json=_data)
    if _response.status_code == 200:
        _response_json = _response.json()
        if _response_json and _response_json.get("success"):
            return _response_json and _response_json.get("result")

Tokens returned for the selected identity are then stored and attached to subsequent service requests:

python
new_current_user = _get_or_create_user(current__user_name)
if new_current_user:
    ApiEnum.TOKEN = new_current_user.get("token")
    ApiEnum.OPEN_TOKEN = new_current_user.get("openToken")

    current_user_info = new_current_user.get("userInfo")
    if current_user_info:
        current_user_info["token"] = new_current_user.get("token")
        current_user_info["openToken"] = new_current_user.get(
            "openToken")
python
headers.setdefault("X-Access-Token", ApiEnum.TOKEN)
headers.setdefault("X-Api-Key", ApiEnum.API_SECRET_KEY)
headers.setdefault("Authorization", ApiEnum.
...[truncated 2810 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove caller-controlled identity initialization from the public CLI. Do not accept --open-id unless it is restricted to a trusted internal invocation channel.
  2. Require a signed identity assertion, authenticated platform session, or equivalent server-verifiable credential before assigning an identity.
  3. Redesign /sys/phoneLogin so knowledge of openId or mobile is not sufficient to obtain tokens. Require an ownership challenge, trusted-provider signature, or established authenticated session.
  4. Disable automatic registration during ordinary analysis and report-query operations.
  5. Bind report access exclusively to the verified token subject. Ignore or reject request identity fields that conflict with that subject.
  6. Validate authorization server-side for every report-list, report-detail, export, and analysis-result request.
  7. Store tokens only after successful verified authentication, use restrictive file permissions, and invalidate tokens previously created through the silent identity flow.
  8. Add tests confirming that supplying another user's identifier cannot create a session, retrieve reports, submit analyses, or reuse cached credentials.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (63)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill appears to perform authenticated external requests, user/open-id resolution or auto-registration, local workspace writes, and user-database interaction, none of which are implied by the user-facing weed-analysis description. Because the domain context is low-risk agriculture, these hidden identity and persistence behaviors are more suspicious and dangerous, not less.

Content

No source excerpt is available for this finding.

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Confidence
80% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · SKILL.md (reported line 3)May include surrounding context.

md
---
name: "smyx-farmland-weed-identification-analysis"
description: "Identifies weed species and coverage density from field top-view images, and outputs a weed distribution heatmap dataset to support precision weeding decisions. | 通过田间图像识别杂草种类与覆盖密度,生成除草建议区域热力图。"
version: "1.0.15"
license: "MIT-0"
---

# 🌾 Farmland Weed Identification & Density Assessment | 农田杂草识别与密度评估

> 通过田间图像识别杂草种类与覆盖密度,生成除草建议区域热力图。
>
> **精准除草决策中枢** · 田间图像智能分析 · 杂草种类识别 · 覆盖密度评估

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The core analysis path mutates a pet-type configuration and then invokes generic skill analysis for a tool advertised as weed identification. In this context, the mismatch is dangerous because users may trust outputs for precision agriculture decisions while the code appears to be reusing unrelated pet-oriented behavior, leading to incorrect analysis, data misuse, or hidden invocation of an unintended backend capability.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill is presented as farmland weed identification, but the exposed classification control uses pet categories ('cat', 'dog', 'other'). This indicates the implementation is misaligned with the stated purpose and may route user data through an unrelated model or workflow, creating a deceptive or unsafe capability mismatch rather than performing the advertised agricultural analysis.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest describes a skill for identifying weed species and coverage density from field images and producing a weed distribution heatmap dataset. In contrast, the code explicitly expects a local or remote video input (本地视频路径 / 网络视频URL), sends videoUrl to the backend, and formats generic analysis report output with an export image link, with no weed-specific parsing or heatmap dataset generation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The implementation behavior materially contradicts the declared skill purpose: it performs generic video analysis and video history listing instead of farmland weed identification from field top-view images. This mismatch is dangerous because users and orchestrators may route sensitive agricultural imagery or automation decisions to a skill that calls unrelated backend functionality, causing unintended data exposure, incorrect outputs, and unsafe downstream actions based on mislabeled capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The CLI explicitly describes itself as a video analysis tool, reinforcing that the shipped implementation does not match the stated farmland weed-image analysis function. This is security-relevant because operators may trust the metadata and invoke the tool in automated pipelines, leading to misuse of the wrong service, faulty agronomic decisions, or disclosure of inputs to an unexpected analysis path.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The User model stores authentication material and personal profile data such as token, open_token, email, birthday, age, and realname, none of which are justified by farmland weed-image analysis. Collecting and persisting this data in a local SQLite database creates unnecessary privacy, compliance, and credential-exposure risk, especially if the shared database is accessible across agents or skills.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The utility contains automatic account creation, login, token acquisition, token persistence, and retry logic that are unrelated to weed-identification image analysis. This expands the skill's privilege and data-handling scope, enables undisclosed outbound authentication flows, and can create or bind identities without explicit user consent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill declares no explicit tool/permission scope, yet the manifest and referenced behavior imply access to shell execution, local files, environment-derived identity, network APIs, and local writes. In an agent setting, undeclared capabilities weaken least-privilege controls and can allow the skill to perform broader actions than a user would reasonably expect.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest presents the skill as focused on weed identification and density/heatmap output, yet also embeds cloud history retrieval and report-link disclosure behavior. This hidden secondary function can expose prior analysis metadata and expands the data surface beyond what a user expects from a one-shot image-analysis tool.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The operational instructions, triggers, examples, and output specifications are written almost entirely in Chinese, and the skill does not state that users may choose another language. This creates a de facto language constraint without explicit opt-in or documented justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The AI role says the skill should only output weed distribution and density results, but elsewhere it is instructed to query cloud history and return report links. Conflicting instructions reduce transparency and can cause the agent to perform broader data-access actions than the user expects from the stated role.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The history-report trigger phrases are broad enough that ordinary conversation could unintentionally activate cloud report retrieval. In an agent context, ambiguous auto-invocation increases the chance of unauthorized or surprising access to historical data linked to an internal identity.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.install_untrusted_source

Install source points to URL shortener or raw IP.

Warn
Code
suspicious.install_untrusted_source
Location
skills/smyx_common/scripts/config-dev.yaml:2