Back to skill

Security audit

Cat Face Recognition Skill | 猫脸识别技能

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a cloud cat-recognition client, but it silently manages cloud identities and local tokens in ways that could mix or expose report history.

Install only if you are comfortable sending cat images/videos, URLs, and report-history requests to the lifeemergence cloud service. Avoid shared or multi-user workspaces unless identity isolation is fixed, and review the hidden open-id flow, silent registration/login, local SQLite token storage, and history-query behavior before production use.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/cat_face_recognition_analysis.py:44
Finding

Caller-Controlled Open ID Enables Cloud Identity Impersonation

Content
View full analysis

Vulnerability Details

File Location: scripts/cat_face_recognition_analysis.py:44-55; skills/smyx_common/scripts/util.py:460-475, 550-612
Vulnerability Type: Caller-controlled identity used for silent authentication
Risk Level: High

Vulnerable Code

scripts/cat_face_recognition_analysis.py:44-55:

python
parser.add_argument("--open-id", required=False, help=argparse.SUPPRESS)
parser.add_argument("--list", action='store_true', help="显示猫脸识别分析列表清单")
parser.add_argument("--api-url", help="服务端API地址")
parser.add_argument("--api-key", help=argparse.SUPPRESS)
parser.add_argument("--output", help="结果输出文件路径")
parser.add_argument("--detail", choices=["basic", "standard", "json"],
                    default=ConstantEnum.DEFAULT__OUTPUT_LEVEL,
                    help="输出详细程度")
parser.add_argument("--export-env-only", action='store_true',
                    help="仅输出 export 命令设置环境变量,不执行分析")

args = parser.parse_args()

try:
    # 初始化内部用户身份;不要求用户输入,也不在帮助信息中展示。
    OpenIdUtil.resolve_current_open_id(args.open_id, use_current=bool(args.open_id))

skills/smyx_common/scripts/util.py:460-475:

python
@classmethod
def resolve_current_open_id(cls, open_id=None, use_current=True):
    """解析并初始化当前 open-id,返回最终使用值。"""
    resolved_open_id = (open_id or "").strip() if isinstance(open_id, str) else open_id
    if not resolved_open_id and use_current:
        resolved_open_id = ConstantEnum.CURRENT__OPEN_ID or ConstantEnum.CURRENT__USER_NAME
    if not resolved_open_id:
        resolved_open_id = cls.get_api_key_file_open_id()
    if not resolved_open_id:
        resolved_open_id = cls.get_or_create_default_open_id()

    ConstantEnum.CURRENT__OPEN_ID = resolved_open_id
    if not ConstantEnum.CURRENT__USER_NAME:
        ConstantEnum.CURRENT__USER_NAME = resolved_open_id
    return resolved_open_id

skills/smyx_common/scripts/util.py:550-565:

python
def _get_or_create_user(username):
    _url = ApiEnum.BASE_URL_HEALTH + "/sys/phoneLogin"
 
...[truncated 4600 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove --open-id from the public CLI rather than merely suppressing its help text.
  2. Obtain identity only from a trusted, authenticated upstream channel.
  3. Require an integrity-protected identity assertion, such as a server-validated signed token containing the caller identity and audience.
  4. Do not issue or retrieve access tokens based only on a caller-supplied Open ID, username, or mobile value.
  5. Disable silent registration during ordinary analysis and report-list operations.
  6. Bind locally cached tokens to the authenticated upstream principal and verify that binding before reuse.
  7. Enforce authorization on the server for every report-list, report-detail, and analysis operation; never rely solely on client-provided pnaUserName.
  8. Reject execution when authenticated identity cannot be established instead of accepting an arbitrary identifier.
  9. Add negative authorization tests demonstrating that one principal cannot request tokens or reports for another Open ID.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
skills/smyx_common/scripts/util.py:430
Finding

Workspace-Wide Fallback Identity Causes Cross-User Report Mixing

Content
View full analysis

Vulnerability Details

File Location: scripts/cat_face_recognition_analysis.py:55; skills/smyx_common/scripts/util.py:430-475; skills/smyx_common/scripts/dao.py:145-164, 467-495
Vulnerability Type: Shared fallback identity across callers
Risk Level: Medium

Vulnerable Code

scripts/cat_face_recognition_analysis.py:55:

python
OpenIdUtil.resolve_current_open_id(args.open_id, use_current=bool(args.open_id))

skills/smyx_common/scripts/util.py:430-475:

python
@classmethod
def get_or_create_default_open_id(cls):
    from .dao import UserDao, User
    import uuid

    user_dao = UserDao()
    user = user_dao.get_first_default_user(cls.DEFAULT_PREFIX, cls.DEFAULT_USERNAME_LENGTH)
    if user and user.username:
        return user.username

    # 极低概率碰撞时重试,避免 username 唯一索引冲突。
    for _ in range(10):
        username = cls.generate_default_open_id()
        if user_dao.get_by_username(username):
            continue
        now = datetime.now()
        user = User(
            id=uuid.uuid4().hex,
            username=username,
            realname=username,
            source=ConstantEnum.APP__SOURCE,
            del_flag=0,
            create_time=now,
            update_time=now
        )
        user_dao.add(user)
        return username

    raise RuntimeError("生成默认 open-id 失败:随机用户名连续冲突")

@classmethod
def resolve_current_open_id(cls, open_id=None, use_current=True):
    """解析并初始化当前 open-id,返回最终使用值。"""
    resolved_open_id = (open_id or "").strip() if isinstance(open_id, str) else open_id
    if not resolved_open_id and use_current:
        resolved_open_id = ConstantEnum.CURRENT__OPEN_ID or ConstantEnum.CURRENT__USER_NAME
    if not resolved_open_id:
        resolved_open_id = cls.get_api_key_file_open_id()
    if not resolved_open_id:
        resolved_open_id = cls.get_or_create_default_open_id()

    ConstantEnum.CURRENT__OPEN_ID = resolved_open_id
    if not ConstantEnum.CURRENT__USER_NAME:
        ConstantEnum.CURRENT__U
...[truncated 3463 chars]
Remediation
View remediation

Remediation Suggestions

  1. Change the entry point to require and use the authenticated current identity rather than deriving use_current from whether a hidden CLI argument was supplied.
  2. Fail closed when no authenticated upstream identity is available.
  3. Do not reuse a workspace-global default cloud identity in multi-user deployments.
  4. Partition token and user storage by authenticated principal, tenant, and Agent context.
  5. Replace the shared smyx-api-key.txt fallback with a protected per-principal credential mechanism, or remove the fallback entirely.
  6. Add explicit ownership filters and server-side authorization to report-list and report-detail APIs.
  7. Migrate existing shared records to distinct user accounts where ownership can be established.
  8. Add integration tests with two independent principals to verify that analysis submissions and history queries remain isolated.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (58)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill’s claim of cat comparison against a registered database conflicts with behavior involving external API communication, authentication/token handling, automatic user creation/login, and local persistence. That combination presents significant privacy and account-safety concerns because it hides identity provisioning and cloud submission behind a deceptively simple pet-analysis description.

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
83% confidence
Finding

The metadata was flagged for tool/manifest poisoning indicators, and in context the skill already shows multiple signs of misleading or contaminated documentation. Poisoned or malformed manifest metadata can mislead agents about purpose and capabilities, increasing the chance of unsafe tool invocation or misplaced trust.

Content

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

md
---
name: "cat-face-recognition-analysis"
description: "Dentifies specific cats by comparing images or videos of their faces. It supports distinguishing between different individuals in multi-cat households, ensuring accurate recognition once the data is registered in the database. | 猫脸识别技能,通过猫脸图片/视频比对识别具体是哪只猫咪,支持多猫家庭区分不同个体,录入底库后可准确识别"
version: "1.0.18"
license: "MIT-0"
---

# 🐱 Cat Face Recognition Skill | 猫脸识别技能

> **智能健康/识别分析中枢** · 图片/视频智能分析 · 结构化报告 · 历史报告云端�

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The implementation is a generic analysis/report submission wrapper rather than a cat-face identification-specific skill, creating a significant scope mismatch with the declared manifest. In practice, this broad backend-facing functionality can be used to submit arbitrary files/URLs and retrieve generic analysis outputs, increasing the chance of unauthorized data processing and user deception about what the skill actually does.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says the skill identifies specific cats by comparing cat face images or videos, but this file exposes a generic 'video analysis tool' and a 'video history list' workflow. The code accepts arbitrary video input/URLs and delegates to generic analysis/list APIs without any cat-specific validation, face-matching logic, or image support matching the declared purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This utility module provisions identities, resolves open-id values, reads local identity files, caches tokens, and persists user auth material in local storage. That behavior is substantially broader than cat-face recognition and creates an unnecessary identity and credential-handling surface, increasing the chance of unauthorized account creation, token misuse, and cross-skill data exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code automatically registers or logs in a user against an external service via /sys/phoneLogin using generated or recovered identifiers, without clear user initiation. In the context of a cat-face recognition skill, silent account creation and login are unrelated and dangerous because they can bind the user/workspace to an external account and enable downstream token issuance and tracking.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill advertises and instructs use of shell execution, local file handling, network access, environment access, and local persistence behavior, but declares no tool scope or permission boundary in the manifest. This creates an unnecessarily broad and opaque execution surface, making it harder for a host agent or reviewer to constrain risky capabilities such as cloud exfiltration, local file writes, and command execution.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation abruptly describes bird-species recognition in a cat-face recognition skill, indicating copy-paste contamination or documentation poisoning. Such inconsistency is dangerous because it undermines reviewers’ ability to determine actual behavior and suggests the skill may route data to a broader or different analysis pipeline than advertised.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases for history-report lookup are broad enough to activate cloud report retrieval during ordinary conversation. In a skill that auto-associates an internal identity, accidental triggering can expose prior report metadata or links without deliberate user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill automatically saves uploaded images/videos as local files but does not clearly warn users at the point of description or consent. Silent local persistence of media, especially home surveillance or personal images, creates privacy and retention risks beyond what users may reasonably expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill omits a clear privacy warning that history queries are performed against a cloud API tied to an automatically managed internal identity. Because users are told not to provide identity information while the system silently reuses or creates one, there is a substantial transparency and privacy risk around account linkage and cross-session data exposure.

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 hard-codes the command description and help text in Chinese, and later prints status/error messages only in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The operational messages shown to users during normal execution and on failure are all Chinese-only. Because the file does not offer a language selection or explain a region-specific requirement, this violates the natural-language locale policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The method returns a fixed Chinese string for output content, which enforces a specific language in the user-facing response. There is no indication in this file that the user can choose the language or that the locale restriction is documented and justified.

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