Back to skill

Security audit

购物省钱宝 - 淘宝/京东/拼多多优惠查询、商品比价、链接转链

Security checks for vulnerabilities and agentic risk

Overview

This shopping skill is mostly coherent, but it needs Review because it can send ordinary non-URL user text to an external shopping API before local filtering.

Install only if you are comfortable sending shopping queries, pasted share text, and product links to op.squirrel2.cn for processing. Avoid using it on messages that contain private details, credentials, account data, or unrelated personal text unless the skill is narrowed to validate share-code format or asks before sending raw content.

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
skill.py:200
Finding

Unconditional Transmission of Raw Non-URL User Messages to a Third-Party Service

Content
View full analysis

Vulnerability Details

File Location: skill.py:200-205, skill.py:143-145, utils.py:21-32
Vulnerability Type: Excessive transmission of potentially sensitive user input
Risk Level: High

Vulnerable Code

skill.py:200-205:

python
# 1. Detect URL and convert it
url = extract_url(message)
if url:
    result = convert_link(url)
else:
    # 2. Attempt share-code parsing first
    result = parse_share_content(message)

skill.py:143-145:

python
result = _wrapped_call_api('/parse_share', {
    'content': content
})

utils.py:21-32:

python
def call_api(endpoint: str, data: Dict[str, Any]) -> Optional[Dict[str, Any]]:
    """
    Call the server API
    """
    try:
        url = f"{API_BASE_URL}{API_PREFIX}{endpoint}"
        response = requests.post(url, json=data, timeout=API_TIMEOUT)
        response.raise_for_status()
        return response.json()

The configured default destination is https://op.squirrel2.cn, as defined in config.py:11.

Technical Analysis

handle_message() treats every non-empty message that does not contain a URL as possible e-commerce share content. It passes the complete, unmodified message to parse_share_content(), which places it in the content field of a POST request to the external service.

The project already implements is_token_format() in utils.py, which can locally determine whether text resembles a supported share code. However, the router does not use that function before transmitting the message. Thus, unrelated text, personally identifiable information, credentials, private conversation content, or other secrets can be disclosed even when local validation would show that the input is not a share code.

This particularly exceeds minimum necessary access when the caller supplies a separate extracted product keyword: the Skill still sends the original raw message for share-code parsing before ...[truncated 1681 chars]

Remediation
View remediation

Remediation Suggestions

  1. Invoke the existing is_token_format() validator before calling /parse_share. Do not transmit raw content unless it matches a supported share-code format.
  2. If the input is not a share code, send only a narrowly extracted product keyword to the search or comparison endpoint rather than the complete original message.
  3. Require explicit user confirmation before transmitting free-form pasted content that may contain sensitive information.
  4. Add input-length limits and reject unexpectedly large or unrelated payloads locally.
  5. Clearly disclose the destination, data fields transmitted, retention period, logging practices, and applicable privacy policy before network processing.
  6. Configure the server to minimize logs, redact sensitive fields, enforce short retention periods, and prohibit unrelated secondary processing.
  7. Add tests confirming that ordinary messages, credentials, personal data, and other non-token inputs are never sent to /parse_share.
  8. Keep HTTPS mandatory and reject non-HTTPS production API base URLs to preserve transport confidentiality.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The routing rule that sends all 'other text' first to parse_share_content is overly permissive and can forward essentially any non-URL user message to the remote service. In context, this is more dangerous because the API body explicitly sends the user's raw message ('<用户原话>') to an external domain, so unrelated or sensitive text could be exfiltrated without clear need or consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill description and use-cases are very broad and overlap with ordinary shopping conversation, making it easy for an agent to invoke this skill for many generic retail queries without strong user intent confirmation. That increases unnecessary transmission of user messages or extracted product interests to a third-party service, creating over-collection and unintended external data sharing rather than a tightly scoped tool invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains user-facing messages and descriptive text exclusively in Chinese, including error and success messages that appear intended for end users. Because the file provides no indication of language selection, opt-in, or justification for a China-only/Chinese-only scope, it may violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The function call_api sends the supplied data to a remote server via requests.post, which is a network operation that may transmit user or system data. While the docstring says it calls a server API, there is no confirmation prompt, logging, or explicit user-facing warning about the outbound transmission in this file.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · utils.py (reported line 35)May include surrounding context.

python
"""
    try:
        url = f"{API_BASE_URL}{API_PREFIX}{endpoint}"
        response = requests.post(url, json=data, timeout=API_TIMEOUT)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.Timeout:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains docstrings and user-visible output strings exclusively in Chinese, including all success, error, and guidance messages. That effectively forces a specific language/locale on users without opt-in, which matches the language-policy concern for natural-language policy violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill performs an automatic HTTP request to an external service during import and before API calls via _check_version, but there is no user-facing print/log, confirmation, or warning in this file that a background network call will occur. Because this outbound request happens implicitly and is not clearly part of the user-requested shopping action, it lacks the disclosure required for code files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The module docstrings, comments, and user-visible error messages are consistently Chinese-only, with no indication that users can select another language. This can violate a language/locale policy when a skill forces a specific language without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.