Back to skill

Security audit

1688 Shop Operate

Security checks for vulnerabilities and agentic risk

Overview

This skill has a coherent 1688 shop-diagnosis purpose, but its credential handling exposes the user's AK in command output and runs a network-reachable local callback that can overwrite credentials during authorization.

Review this skill carefully before installing. It accesses 1688 shop/business metrics and handles your AK credential. Avoid running configure --status until the publisher masks the AK, use it only on a trusted single-user machine/network, and rotate the AK if it has appeared in chat, logs, screenshots, or command output.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/callback_server.py:441
Finding

Network-Exposed OAuth Callback Server Allows Unauthenticated AK Overwrite

Content
View full analysis
None: self._server.server_close() self._server = _ThreadingHTTPServerIPv6(("::", port), handler, bind_and_activate=False) self._server.socket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) self._server.server_bind() self._server.server_activate() ``` ```python # scripts/callback_server.py:441-461 def _handle_save_ak(self): origin = self.headers.get("Origin", "") allowed = f"http://localhost:{server_ref._port}" allowed2 = f"http://0.0.0.0:{server_ref._port}" if origin and origin not in (allowed, allowed2): self._send_json(403, {"success": False, "error": "CORS_DENIED"}) return content_length = int(self.headers.get("Content-Length", 0)) body = json.loads(self.rfile.read(content_length)) if content_length > 0 else {} ak = body.get("ak", "") if not ak: self._send_json(400, {"success": False, "error": "MISSING_AK", "error_description": "AK 不能为空"}) return result = server_ref._save_ak(ak) server_ref._result = result if result.get("success"): server_ref._success = True self._send_json(200, result, cors_origin=origin or allowed) ``` ### Technical Analysis On Linux and macOS, the callback service ultimately binds a dual-stack IPv6 socket to `::`, with `IPV6_V6ONLY` disabled. Consequentl ...[truncated 2330 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capabilities/configure/cmd.py:54
Finding

AK Status Command Discloses the Complete Plaintext Credential

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/capabilities/configure/service.py:41
Finding

Encrypted AK Store Is Created Without Explicit Restrictive Permissions

Content
View full analysis
bool: """将 AK 加密后存储到 ak_store 文件""" try: encrypted = _encrypt(ak) AK_STORE_FILE.parent.mkdir(parents=True, exist_ok=True) with open(AK_STORE_FILE, "w", encoding="utf-8") as f: json.dump({"ak": encrypted}, f, ensure_ascii=False) return True except Exception: return False ``` The encryption key is derived from a machine identifier: ```python # scripts/ak_crypto.py:105-113 def derive_key(machine_id: str, kdf_salt: bytes) -> bytes: return hashlib.pbkdf2_hmac( "sha256", machine_id.encode("utf-8"), kdf_salt, _KDF_ITERATIONS, dklen=32, ) ``` ### Technical Analysis The AK directory and file are created without explicitly enforcing owner-only permissions. Their effective modes therefore depend on the process umask. Under common defaults, the directory may be created as `0755` and the file as `0644`, potentially making the encrypted credential readable by other local users. Encryption reduces accidental plaintext disclosure but does not compensate for missing access control. The key material is derived from a machine identifier rather than a user-held secret. On common systems, values such as `/etc/machine-id` are readable by local users. A local attacker who can read both the AK store and the machine identifier can reproduce the PBKDF2 derivation and decrypt the AK. The code also writes directly to the destination rather than using an owner-only temporary file followed by an atomic replacement. This creates avoidable exposure to partial writes and local file manipulation. ### Attack Path 1. The Skill runs un ...[truncated 1171 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (173)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Token retrieval, expiry checks, silent refresh, remote revocation, and authorization-state handling all create an active credential-management subsystem. This is substantially more powerful than read-only diagnosis and can cause users to grant broad trust or network access without understanding the full auth lifecycle behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The declared skill purpose is shop-health diagnosis, but the CLI prominently implements OAuth authorization, token management, and access-key acquisition workflows unrelated to that purpose. This mismatch expands the trust boundary and can enable credential collection or account-authorization operations under a misleading diagnostic label, making users more likely to grant sensitive access they did not intend.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code includes flows to initiate OAuth authorization and obtain credentials even though the advertised function is store analysis. In skill ecosystems, unjustified credential-acquisition logic is dangerous because it can normalize collection of powerful tokens under a benign pretext and broaden exposure if the skill or downstream modules are abused.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

A browser-driven 'get_ak' capability is especially sensitive because it appears designed to obtain an access key through interactive login, which is materially different from passive store-health diagnostics. In this context, it increases the risk of credential harvesting, excessive privilege, and user deception because the feature sits outside the stated purpose of the skill.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · cli.py (reported line 313)May include surrounding context.

python
TOKEN_ENDPOINT = "https://skills-gateway.1688.com/api/get_token_by_auth_code/1.0.0"
# 用 Refresh Token 换取新 Token 的网关端点
REFRESH_TOKEN_ENDPOINT = "https://skills-gateway.1688.com/api/refresh_token/1.0.0"
# Revoke 端点(吊销 Access Token / Refresh Token,通过 tokenTypeHint 区分)
REVOKE_ENDPOINT = "https://skills-gateway.1688.com/api/revoke_token/1.0.0"
# Scope 列表查询端点
SCOPE_LIST_ENDPOINT = "https://skills-gateway.1688.com/api/query_all_scope/1.0.0"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · cli.py (reported line 317)May include surrounding context.

python
TOKEN_ENDPOINT = "https://skills-gateway.1688.com/api/get_token_by_auth_code/1.0.0"
# 用 Refresh Token 换取新 Token 的网关端点
REFRESH_TOKEN_ENDPOINT = "https://skills-gateway.1688.com/api/refresh_token/1.0.0"
# Revoke 端点(吊销 Access Token / Refresh Token,通过 tokenTypeHint 区分)
REVOKE_ENDPOINT = "https://skills-gateway.1688.com/api/revoke_token/1.0.0"
# Scope 列表查询端点
SCOPE_LIST_ENDPOINT = "https://skills-gateway.1688.com/api/query_all_scope/1.0.0"