T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/search.py:139- Finding
API Authentication Is Optional and User Identity Is Caller-Controlled
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill mostly implements a product-search API client, but its package under-discloses credentials and network behavior and includes conflicting image-search documentation that broadens what users may think they are installing.
Review this before installing. Use it only if you trust AlphaShop/1688 with your product-search queries and can provide credentials through protected environment configuration. Avoid command-line secrets, do not use the plaintext HTTP reference examples with real data, and treat the bundled image-search documentation as an unresolved scope mismatch until the publisher clarifies or removes it.
scripts/search.py:139API Authentication Is Optional and User Identity Is Caller-Controlled
scripts/search.py:292AlphaShop Secret Key Can Be Exposed Through Command-Line Arguments
references/api.md:175Reference Examples Transmit API Request Data over Plaintext HTTP
The documented purpose says this is a product search skill, but the behavior described goes beyond that by using undeclared JWT credential handling, possible local persistence of full API responses, and exposing broader supplier/reference data. This mismatch is dangerous because reviewers and users may authorize the skill under a narrower trust assumption while it actually handles secrets, writes data locally, and sends/returns more information than expected.
The file documents an image-based product recall API while the skill metadata says the skill is for keyword-based product search. This capability mismatch is dangerous because it can hide undeclared functionality, expand the data handled by the skill (image URLs, embeddings, supplier data), and bypass user or reviewer expectations about what the skill actually does.
The security section says userId is required for identity verification, but the shown validation code never checks for userId presence or authenticity. This creates an authentication/authorization gap where requests may be processed without a verified caller, undermining access control, auditing, and abuse prevention.
The referenced documentation describes an image-based product recall API, while the skill manifest claims a keyword-based product search capability. This kind of capability/documentation mismatch can cause an agent or integrator to invoke an unintended interface, send the wrong classes of user data, and apply incorrect safety assumptions, which is a real security and integrity problem rather than a harmless documentation bug.
The file documents and tests an image-based product recall API while the skill is declared as a keyword-based product search skill. This capability mismatch can mislead users, downstream agents, or reviewers into invoking unintended functionality, expanding the skill’s effective scope and potentially enabling unreviewed data flows such as external image fetching.
The skill documentation indicates capabilities involving environment secrets, network access, and possible file writes, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates a transparency and least-privilege failure: operators and policy engines cannot accurately constrain or review what the skill may do, increasing the chance of unintended secret access, external transmission, or local persistence.
The manifest metadata says no environment variables are required, while the documentation requires API credentials via environment/config. This discrepancy can lead to insecure deployments, ad hoc secret handling, and failed policy validation because secret dependencies are hidden from the formal metadata.
This skill performs external network transmission to a third-party production endpoint, which is a genuine security-relevant behavior even if it is core to the skill's function. In context this is expected rather than malicious, but it still creates data exposure and dependency risk because user queries and related metadata leave the local trust boundary.
### 商品搜索 API
- **接口地址**:`POST https://api.alphashop.cn/ai.sel.global1688.productSearchApi/1.0`
- **环境**:生产环境(Production)
- **认证方式**:JWT Token (HS256)
- **请求格式**:JSON
The skill sends user-supplied search queries and filters to an external production API, but the description does not clearly warn users about this external transmission. That omission matters because product queries may contain sensitive business research, strategy, or proprietary market interests, and users cannot make an informed consent decision without disclosure.
The curl example sends data to an internal endpoint over plain HTTP, exposing request contents to interception or tampering on the network path. Even though the sample payload is simple, real usage could include sensitive search terms, internal identifiers, or business intelligence queries.
curl -X POST "http://pre-cbucrm.alibaba-inc.com/api/hsf-test/invoke" \
The examples instruct users to send search queries and parameters to an internal endpoint without any warning about data transmission, environment sensitivity, or handling of potentially sensitive business queries. This can cause inadvertent disclosure of user-entered data to internal services, especially when copied into scripts or shared environments.
The browser fetch example transmits request data to an internal HTTP endpoint, which is risky because it uses plaintext transport and encourages execution from a browser context. This increases exposure of business queries, identifiers, and responses to interception, mixed-content issues, and accidental use from unmanaged client environments.
fetch("http://pre-cbucrm.alibaba-inc.com/api/hsf-test/invoke", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
The manifest describes a narrowly scoped 商品搜索 API skill for keyword-based product discovery, but the file's whitelist guidance explicitly includes additional methods keywordSearchApi and newProductReportExecuteApi. In particular, newProductReportExecuteApi suggests a separate report-execution capability that is not part of the declared search-only purpose, indicating broader behavior than the skill claims.
The API response includes supplier identifiers and names even though the stated skill purpose is product search, not supplier discovery. Exposing extra business-partner data without clear necessity violates data minimization and can leak internal or sensitive commercial relationships to external callers.
The request logging example records the full imageUrl, which may contain personal data, tracking parameters, signed object-store links, or confidential resource locations, and the document does not mention user notice or minimization. Logging such URLs increases exposure in log pipelines, support systems, and audit stores beyond the primary business need.
The document claims an image URL whitelist mechanism, but the provided validation only checks whether the URL is syntactically valid. If the service fetches arbitrary user-supplied URLs, this can enable server-side request forgery or access to unintended internal or restricted resources.
The document instructs users to submit imageUrl and userId to a backend API but does not disclose that these identifiers and referenced image resources are transmitted to external services for processing. That omission can lead users or agent developers to handle personal or sensitive data without informed consent, minimization, or policy controls.
Requiring the image to be publicly accessible creates a privacy and data-exposure risk because users may publish otherwise private assets or stable URLs to third-party-accessible locations. Without warning or compensating controls, this encourages insecure sharing patterns and may expose sensitive content, tokens embedded in URLs, or business-confidential product images.
The HSF example explicitly invokes imageSearchApi and constructs an ImageSearchApiRequest, contradicting the surrounding keyword-search skill context. This increases the chance that downstream users or code-generation agents will call the wrong backend method and transmit image URLs or other data to an unintended service, creating a concrete misuse path.
The testing scope repeatedly frames the feature as image product recall/search, contradicting the stated keyword-search intent of the skill. Such contradictory documentation increases the chance of confused-deputy behavior, incorrect trust assumptions, and accidental exposure of broader functionality than users or policy engines expect.
The top-level docstring describes the script as calling a product search service, while the manifest says the skill searches Amazon/TikTok products. However, the actual endpoint string targets global1688.productSearchApi, and the response formatter explicitly outputs 1688 同款参考价, showing the implementation is tied to 1688-related data as well. This is an active documentation/intent mismatch rather than a mere omission.
The module docstring and all user-facing CLI messages are written in Chinese, and the script does not provide any user opt-in or alternative locale handling. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless the locale restriction is clearly justified.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import jwt
# AlphaShop API 配置
API_ENDPOINT = "https://api.alphashop.cn/ai.sel.global1688.productSearchApi/1.0"
# API 认证配置(需要从环境变量或配置文件获取)
APP_KEY = None # 需要配置
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import jwt
# AlphaShop API 配置
API_ENDPOINT = "https://api.alphashop.cn/ai.sel.global1688.productSearchApi/1.0"
# API 认证配置(需要从环境变量或配置文件获取)
APP_KEY = None # 需要配置
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
import jwt
# AlphaShop API 配置
API_ENDPOINT = "https://api.alphashop.cn/ai.sel.global1688.productSearchApi/1.0"
# API 认证配置(需要从环境变量或配置文件获取)
APP_KEY = None # 需要配置
No suspicious patterns detected.