Back to skill

Security audit

Livestock Individual Identification | 畜禽个体识别与追踪

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed cloud livestock-analysis tool, but it uses hidden identity handling, persistent local tokens, and active plaintext HTTP development endpoints for sensitive media and authentication data.

Install only after the publisher replaces the dev HTTP endpoints with verified HTTPS production hosts, documents the exact remote service and account identity behavior, narrows history-query triggers, and fixes credential storage and dependency declarations. Treat uploaded livestock media and report history as account-linked data that may be sent to a remote service.

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

T09 · Insecure Skill Coding Practices

Error
Location
skills/smyx_common/scripts/config-dev.yaml:1
Finding
Authentication Tokens, Internal Identity, and Uploaded Media Are Transmitted Over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/config-dev.yaml:1-7`; `skills/smyx_common/scripts/util.py:545-561, 572-612, 646` **Vulnerability Type**: Cleartext transmission of credentials and sensitive user data **Risk Level**: High ### Vulnerable Code ```yaml ApiEnum: base-url-open-api: "http://192.168.1.234:9601/smyx-open-api" base-url-open-h5: "http://192.168.1.234:4100" base-url-health: "http://192.168.1.234:7070/jeecg-boot-xzgz" ConstantEnum: is-debug: true ``` The development configuration is enabled by the active configuration: ```yaml env: dev ``` The request utility sends the internal identity to the HTTP health endpoint: ```python def _get_or_create_user(username): _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) ``` It subsequently attaches authentication credentials and identity data to analysis requests: ```python if not url.startswith("https://") and not url.startswith("http://"): url = cls.BASE_URL + url headers.setdefault("X-Access-Token", ApiEnum.TOKEN) headers.setdefault("X-Api-Key", ApiEnum.API_SECRET_KEY) headers.setdefault("Authorization", ApiEnum.OPEN_TOKEN) if current__user_name: data.setdefault('pnaUserName', current__user_name) response = requests.request( method, url, *args, json=data, params=params, headers=headers, timeout=int(timeout), **argss ) ``` ### Technical Analysis `config.yaml` selects the `dev` environment, causing `config-dev.yaml` to override the otherwise HTTPS production endpoints. All three development endpoints use unencrypted HTTP. The normal execution flow sends the following information over these endpoints: - The internally resolved Open ID in both the `ope ...[truncated 2401 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Change every API and report endpoint to HTTPS and remove plaintext HTTP fallbacks. 2. Do not distribute the package with `env: dev`; default to a production configuration containing validated HTTPS endpoints. 3. Reject any request URL whose scheme is not `https`. 4. Implement an explicit hostname allowlist for all authenticated requests. 5. Resolve relative paths against a single trusted base URL and prohibit callers from supplying arbitrary absolute URLs. 6. Attach authentication headers only after confirming that the final normalized URL belongs to an approved origin. 7. Use certificate verification without disabling `requests` verification. Where appropriate, add certificate or public-key pinning. 8. Rotate all tokens that may already have traversed the plaintext development endpoints. 9. Separate development credentials and environments from production identities and data. 10. Add automated tests that fail when an endpoint uses HTTP or when credentials would be sent to an unapproved host. 11. Clearly disclose to users that media is uploaded to a remote service and identify the approved service destination. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
skills/smyx_common/scripts/dao.py:448
Finding
Reusable Authentication Tokens Are Persisted Unencrypted in a Workspace SQLite Database<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_common/scripts/dao.py:448-462`; `skills/smyx_common/scripts/util.py:580-604` **Vulnerability Type**: Plaintext credential storage **Risk Level**: Medium ### Vulnerable Code The user database schema stores both token types as ordinary text columns: ```python class User(Base, BaseModelMixin): __tablename__ = "sys_user" id = Column(String(32), primary_key=True, index=True) source_id = Column(String(32), comment="source ID") username = Column(String(100), unique=True, index=True, nullable=False) realname = Column(String(200), unique=True, index=True) email = Column(String(45), unique=True, index=True) birthday = Column(DateTime, unique=True, index=True) sex = Column(Integer) age = Column(Integer) token = Column(String(500)) open_token = Column(String(1000)) source = Column(String(50)) ``` The database is created as a regular workspace file: ```python if not db_path: db_path = "smyx-common-claw.db" db_path = self.get_db_path(db_path) self.engine = create_engine(f"sqlite:///{db_path}", echo=False) ``` Tokens received from the remote service are copied into the model and saved: ```python 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") user_model = User.load(current_user_info) user = user_dao.save(user_model) ``` ### Technical Analysis The Skill persists reusable bearer-style credentials in `data/smyx-common-claw.db` without application-level encryption or integration with an operating-system credential store. The database is created using normal SQLite file creation. The code does not set restrictive permissions with `chmod`, verify ownership, or prevent other workspace com ...[truncated 1586 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Avoid persisting bearer tokens when short-lived session credentials can be obtained on demand. 2. Store required long-lived credentials in an operating-system keychain, secret manager, or platform-provided credential vault. 3. If database persistence is unavoidable, encrypt token values with a key that is not stored in the same database or source tree. 4. Create the database and its parent directory with owner-only permissions, such as `0700` for the directory and `0600` for the database. 5. Verify file ownership and permissions before reading stored credentials; refuse to use an unexpectedly accessible database. 6. Use short-lived, narrowly scoped tokens and refresh-token rotation. 7. Revoke tokens when the Skill is removed, the identity changes, or repeated authorization failures occur. 8. Do not include the database in backups, diagnostics, exports, or shared workspace artifacts unless it is encrypted. 9. Add a migration that removes or encrypts existing plaintext token values. ]]>

T08 · Insecure Dependencies

Warning
Location
skills/smyx_analysis/requirements.txt:1
Finding
Incorrect YAML Dependency Name Creates Dependency-Confusion and Installation Risk<![CDATA[ ## Vulnerability Details **File Location**: `skills/smyx_analysis/requirements.txt:1-3` **Vulnerability Type**: Ambiguous or incorrect third-party dependency declaration **Risk Level**: Medium ### Vulnerable Code ```text pydash==8.0.6 SQLAlchemy==2.0.46 yaml==6.0.3 ``` The source code imports the `yaml` module: ```python import yaml ``` The sibling common package declares the expected distribution as: ```text PyYAML==6.0.3 ``` ### Technical Analysis The Python import name `yaml` is conventionally provided by the `PyYAML` distribution. The analysis package instead requests a distribution named `yaml`, while the common package correctly requests `PyYAML`. Import names and package-index distribution names are not interchangeable. Installing an incorrect or ambiguously named distribution can produce one of two security-relevant outcomes: - Installation fails, leaving the Skill in a partially configured or unpredictable state. - A package with the mistaken name is resolved from an available package index, including a private or attacker-controlled index, creating a dependency-confusion opportunity. A dependency package executes installation and import-time code with the privileges of the process installing or running the Skill. Therefore, dependency resolution must use the intended distribution name and a trusted source. ### Attack Path 1. An operator or automated installer processes `skills/smyx_analysis/requirements.txt`. 2. The package manager attempts to resolve `yaml==6.0.3` rather than the intended `PyYAML` distribution. 3. A configured public, private, or compromised package index supplies a package matching that name and version, or the installation fails after partially installing dependencies. 4. If a malicious package is resolved, its build or installation hooks execute during installation. 5. The malicious dependency gains the installer process's filesystem, environment, and network privileges. 6. It may read workspace data, includi ...[truncated 868 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `yaml==6.0.3` with the intended distribution: ```text PyYAML==6.0.3 ``` 2. Maintain a single authoritative dependency manifest to prevent disagreement between sibling packages. 3. Generate and verify hashes for all dependencies, for example with a locked requirements file using `--require-hashes`. 4. Install only from explicitly trusted package indexes and disable unintended extra indexes. 5. Use a dependency-locking tool to pin transitive dependencies as well as direct dependencies. 6. Add continuous-integration checks that build the Skill in a clean environment and verify the imported module's distribution origin. 7. Run package installation under a minimally privileged account and isolated virtual environment. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (63)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The combination of external HTTP requests, token/auth handling, open-id generation/persistence, workspace file access, and local user lookup is materially broader than the declared farm-tracking recognition function. In this context, concealed identity and persistence features raise privacy and access-control concerns, especially around historical report retrieval tied to internally managed identities.

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
Content
---
name: "smyx-livestock-individual-analysis"
description: "Identifies individual livestock (pigs, cattle, sheep) by facial or body-pattern features and outputs a stable individual ID with confidence for precision farm management and tracking. | 通过面部/体纹识别畜禽个体,实现精准管理追踪。"
version: "1.0.10"
license: "MIT-0"
---

# 🐄 Livestock Individual Identification & Tracking | 畜禽个体识别与追踪

> 通过面部/体纹识别畜禽个体,实现精准管理追踪。
>
> **精准养殖识别中枢** · 面部/体纹智能比对 · 个体身份识别 · 追踪管理 · 历史报告云端查询

---

##
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The manifest says this skill identifies individual livestock and returns a stable individual ID with confidence, but this code accepts any local or remote video input, uploads it to a generic analysis backend, and returns formatted analysis reports and export links. Nothing in this file performs or even specifically orchestrates livestock identity recognition, stable ID extraction, or confidence output tied to pigs/cattle/sheep.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The implementation exposes a generic video-analysis entry point and delegates directly to `skill.get_output_analysis(...)`, which does not enforce the manifest-stated purpose of livestock individual identification. This kind of scope drift is dangerous because users may invoke a broader remote analysis capability than advertised, enabling undisclosed processing of arbitrary videos and undermining informed consent and trust boundaries.

Description-Behavior Mismatch

High
Confidence
95% confidence
Finding
This file exposes a broad, generic API wrapper surface including arbitrary GET/POST/PUT/DELETE helpers and CRUD-style methods that are not narrowly scoped to livestock identification. In the context of a skill that is supposed to identify animals, this excessive capability expands the attack surface and could be repurposed to access, modify, or delete unrelated remote resources if other components can influence the URL or payloads.

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
The skill reads a workspace API-key/open-id file and, if absent, creates fallback local user identities and persists them. For a livestock analysis skill this is unrelated and dangerous because it covertly consumes local identity material and establishes durable identities that can later be used for remote requests, creating tracking and unauthorized account use risks.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The utility layer performs remote account provisioning, login, token retrieval, token caching, and user persistence that are unrelated to livestock identification. In the context of a narrowly scoped vision skill, this is dangerous because it silently expands behavior into identity management and network authentication, enabling undisclosed data transmission and persistent credential handling beyond user expectations.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill advertises execution of local scripts, file handling, network access, and implicit identity handling, but declares no explicit tool/permission scope. This weakens sandboxing and review because the runtime capabilities exceed what is formally disclosed, increasing the chance of unintended shell, filesystem, or network use.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
Most operational instructions, role text, triggers, and examples are specified only in Chinese, and the file does not state that users may interact in another language or choose their preferred locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The trigger phrases for automatic history-report retrieval are broad enough that ordinary conversation could unintentionally invoke cloud queries. Because the skill also ties report access to automatically managed identity, accidental triggering could expose or enumerate sensitive historical records without sufficiently explicit user intent.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The manifest and parser description frame the skill as identifying livestock such as pigs, cattle, and sheep, but the exposed CLI argument restricts `--pet-type` to `cat`, `dog`, and `other`. This is an active contradiction in user-facing intent/documentation versus the implemented interface, not merely missing detail.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The script initializes an internal identity via OpenIdUtil.resolve_current_open_id using a hidden parameter and then uses that identity to access account-scoped history through --list. Because this identity-affecting behavior is not disclosed in normal CLI help and may implicitly bind actions to a current account context, users can unknowingly access or operate on scoped data, creating privacy and authorization risk depending on how OpenIdUtil resolves identity.

Whitespace Padding

Medium
Category
Prompt Injection
Content
result_json = JsonUtil.parse(result_json_pure_text, result_json_pure_text)

        result_json_common_ai_response = result_json.get("commonAiResponse") if isinstance(result_json,
                                                                                           dict) else result_json
        if result_json_common_ai_response:
            result_json = result_json_common_ai_response
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Whitespace Padding

Medium
Category
Prompt Injection
Content
result_json = JsonUtil.parse(result_json_pure_text, result_json_pure_text)

        result_json_common_ai_response = result_json.get("commonAiResponse") if isinstance(result_json,
                                                                                           dict) else result_json
        if result_json_common_ai_response:
            result_json = result_json_common_ai_response
Confidence
70% confidence
Finding
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

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