Back to skill

Security audit

人人商城龙虾助手

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for managing a Renren Mall store, but it handles live store credentials, customer data, and business-changing actions with insufficient URL and privacy safeguards.

Install only if you control the Renren Mall store and trust the configured API endpoint. Use a least-privileged, revocable API key, configure only an HTTPS merchant API URL, rotate the key if it may have been sent to an untrusted or plaintext endpoint, and avoid displaying or logging customer phone numbers, addresses, balances, birthdays, or order details unless the operator is authorized and the data is necessary.

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/request_client.py:24
Finding

Unvalidated API Base URL Can Expose the Bearer Credential over Insecure Transport

Content
View full analysis

Vulnerability Details

File Location: scripts/request_client.py:24-54
Vulnerability Type: Unvalidated request destination and plaintext credential exposure
Risk Level: High

Vulnerable Code

python
if not base_url:
    raise ValueError("base_url 不能为空")
if not api_key:
    raise ValueError("api_key 不能为空")

self.base_url = base_url
self.api_key = api_key
self.timeout = timeout

self.session = requests.Session()
self.session.headers.update({
    "Authorization": f"Bearer {self.api_key}",
})

def _build_url(self, path: str) -> str:
    base_url = self.base_url.rstrip("/")
    path = path.lstrip("/")
    return f"{base_url}/{path}"

def _request(
    self,
    method: str,
    path: str,
    *,
    params: Optional[dict[str, Any]] = None,
    data: Optional[dict[str, Any]] = None,
    json: Optional[dict[str, Any] | list[Any]] = None,
    **kwargs: Any,
) -> dict[str, Any] | list[Any] | None:
    url = self._build_url(path)
    response = self.session.request(
        method,
        url,
        params=params,
        data=data,
        json=json,
        timeout=self.timeout,
        **kwargs,
    )

Technical Analysis

The client checks only whether base_url is nonempty. It does not parse or validate the URL, require HTTPS, restrict the destination hostname, or reject loopback, link-local, private-network, and otherwise unintended destinations.

The API key is installed as a session-wide Authorization header. Consequently, every request generated by this client sends the privileged bearer credential to the configured destination. If RR_CLAW_BASE_URL is accidentally or maliciously configured with an attacker-controlled http:// endpoint, the credential is sent to that endpoint without transport encryption. Plain HTTP also permits interception or modification by an on-path attacker.

Because the destination is unrestricted, the client can additionally be directed toward unintended internal HTTP services. The confirmed security ...[truncated 1918 chars]

Remediation
View remediation

Remediation Suggestions

  1. Parse base_url with urllib.parse.urlparse and reject malformed values.
  2. Require the https scheme in production; do not permit plaintext HTTP for credential-bearing requests.
  3. Reject embedded usernames or passwords, fragments, missing hostnames, and ambiguous URL forms.
  4. Maintain an administrator-approved hostname allowlist where deployment architecture permits it.
  5. Resolve and reject loopback, link-local, multicast, and private-network addresses unless a documented private deployment explicitly requires them.
  6. Disable automatic redirects for authenticated requests, or validate every redirect target before forwarding the Authorization header.
  7. Bind credentials to an expected origin and avoid using a session-wide authorization header when requests could reach any other origin.
  8. Use least-privileged, revocable API keys and rotate a key immediately if it may have been transmitted over HTTP or to an untrusted endpoint.
  9. Add automated tests covering HTTP URLs, attacker-controlled hosts, malformed URLs, internal addresses, and cross-origin redirects.

A hardened validation pattern should resemble:

python
from urllib.parse import urlparse

parsed = urlparse(base_url)
if parsed.scheme != "https":
    raise ValueError("base_url must use HTTPS")
if not parsed.hostname:
    raise ValueError("base_url must contain a valid hostname")
if parsed.username or parsed.password or parsed.fragment:
    raise ValueError("base_url contains prohibited URL components")
if parsed.hostname not in APPROVED_API_HOSTS:
    raise ValueError("base_url host is not approved")

Redirect handling should then be disabled with allow_redirects=False, or implemented with explicit destination validation before credentials are resent.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill performs network requests to a user-configured商城 API endpoint but does not declare an explicit tool scope such as allowed network access. Without a clear permission boundary, the runtime may permit broader outbound connectivity than users or the platform expect, increasing the risk of unintended data exfiltration or misuse of injected API credentials if the skill is modified or abused.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 22)May include surrounding context.

md
**请求参数:**

| 字段        | 类型     | 必传 | 说明                                                                                                                                |
|-----------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------|
| keywords  | string | 否  | 搜索关键字(可匹配商品标题、编码、条码)                                                                                                              |
| type      | int    | 否  | 商品类型:`0` 实体商品 / `1` 虚拟商品 / `2` 虚拟卡密 / `3` 预约到店 / `5` 计次时商品 / `8` 批发商品 / `9` 智慧药房 / `13` 海淘商品 / `20` 社区团购 / `21` 期刊商品 / `22` 供应链商品 |

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 24)May include surrounding context.

md
| 字段        | 类型     | 必传 | 说明                                                                                                                                |
|-----------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------|
| keywords  | string | 否  | 搜索关键字(可匹配商品标题、编码、条码)                                                                                                              |
| type      | int    | 否  | 商品类型:`0` 实体商品 / `1` 虚拟商品 / `2` 虚拟卡密 / `3` 预约到店 / `5` 计次时商品 / `8` 批发商品 / `9` 智慧药房 / `13` 海淘商品 / `20` 社区团购 / `21` 期刊商品 / `22` 供应链商品 |
| status    | int    | 否  | 商品状态:不传=全部 / `1` 上架 / `2` 售罄 / `3` 下架 / `4` 已删除                                                                                   |
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 26)May include surrounding context.

md
|-----------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------|
| keywords  | string | 否  | 搜索关键字(可匹配商品标题、编码、条码)                                                                                                              |
| type      | int    | 否  | 商品类型:`0` 实体商品 / `1` 虚拟商品 / `2` 虚拟卡密 / `3` 预约到店 / `5` 计次时商品 / `8` 批发商品 / `9` 智慧药房 / `13` 海淘商品 / `20` 社区团购 / `21` 期刊商品 / `22` 供应链商品 |
| status    | int    | 否  | 商品状态:不传=全部 / `1` 上架 / `2` 售罄 / `3` 下架 / `4` 已删除                                                                                   |
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |
| by        | string | 否  | 排序方式:`asc` 升序 / `desc` 降序                                                                                                         |
| page      | int    | 否  | 页码(默认 1)                                                                                                                          |

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 27)May include surrounding context.

md
| keywords  | string | 否  | 搜索关键字(可匹配商品标题、编码、条码)                                                                                                              |
| type      | int    | 否  | 商品类型:`0` 实体商品 / `1` 虚拟商品 / `2` 虚拟卡密 / `3` 预约到店 / `5` 计次时商品 / `8` 批发商品 / `9` 智慧药房 / `13` 海淘商品 / `20` 社区团购 / `21` 期刊商品 / `22` 供应链商品 |
| status    | int    | 否  | 商品状态:不传=全部 / `1` 上架 / `2` 售罄 / `3` 下架 / `4` 已删除                                                                                   |
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |
| by        | string | 否  | 排序方式:`asc` 升序 / `desc` 降序                                                                                                         |
| page      | int    | 否  | 页码(默认 1)                                                                                                                          |
| page_size | int    | 否  | 每页数量(默认 6)                                                                                                                        |

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 28)May include surrounding context.

md
| type      | int    | 否  | 商品类型:`0` 实体商品 / `1` 虚拟商品 / `2` 虚拟卡密 / `3` 预约到店 / `5` 计次时商品 / `8` 批发商品 / `9` 智慧药房 / `13` 海淘商品 / `20` 社区团购 / `21` 期刊商品 / `22` 供应链商品 |
| status    | int    | 否  | 商品状态:不传=全部 / `1` 上架 / `2` 售罄 / `3` 下架 / `4` 已删除                                                                                   |
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |
| by        | string | 否  | 排序方式:`asc` 升序 / `desc` 降序                                                                                                         |
| page      | int    | 否  | 页码(默认 1)                                                                                                                          |
| page_size | int    | 否  | 每页数量(默认 6)                                                                                                                        |

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 29)May include surrounding context.

md
| status    | int    | 否  | 商品状态:不传=全部 / `1` 上架 / `2` 售罄 / `3` 下架 / `4` 已删除                                                                                   |
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |
| by        | string | 否  | 排序方式:`asc` 升序 / `desc` 降序                                                                                                         |
| page      | int    | 否  | 页码(默认 1)                                                                                                                          |
| page_size | int    | 否  | 每页数量(默认 6)                                                                                                                        |

**响应字段:**

Whitespace Padding

Medium
Category
Prompt Injection
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.

Content

Scanner excerpt · references/goods.md (reported line 30)May include surrounding context.

md
| sort      | string | 否  | 排序字段:`real_sales` 真实销量 / `create_time` 创建时间                                                                                       |
| by        | string | 否  | 排序方式:`asc` 升序 / `desc` 降序                                                                                                         |
| page      | int    | 否  | 页码(默认 1)                                                                                                                          |
| page_size | int    | 否  | 每页数量(默认 6)                                                                                                                        |

**响应字段:**

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document describes endpoints that expose highly sensitive personal data, including real names, mobile numbers, balances, birthdays, and member identifiers, but provides no privacy handling guidance, authorization expectations, masking requirements, or warnings about safe disclosure. In a skill designed for data query and order management, this increases the risk that an agent or integrator will retrieve and display PII too broadly or to unauthorized users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation includes a concrete example response for the member ranking API that contains a full mobile phone number, which is personally identifiable information. Even if presented as sample data, exposing realistic phone-number fields without masking, minimization guidance, or privacy warning normalizes unnecessary disclosure and can lead downstream users or agents to collect, log, or display sensitive member data more broadly.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The summary table states that '会员详情' uses GET /member/list/get, but the detailed section later documents the member detail API as GET /member/detail/get. This is an active contradiction within the file's documentation about what endpoint should be used for the same capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file presents all natural-language instructions and descriptions exclusively in Chinese and does not offer a language option or explain that the skill is intended only for a Chinese-speaking or region-specific audience. This can violate language/locale policy when a specific language is effectively forced without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains natural-language strings and documentation entirely in Chinese, including exception messages and class/method docstrings, with no indication that language choice is configurable. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.