T09 · Insecure Skill Coding Practices
- Location
scripts/exchange_link_builder.py:151- Finding
Reusable Authentication Token Disclosed in Generated Product Links
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill performs VIPShop image search, but it reuses a saved login token to generate returned product links without clear disclosure.
Review before installing. Use only with a VIPShop account and non-sensitive images, and avoid sharing generated product links or transcripts because those links may contain encoded session-token data. The publisher should remove token-bearing URLs, redact raw outputs, and require explicit consent before reading saved login state or uploading images.
scripts/exchange_link_builder.py:151Reusable Authentication Token Disclosed in Generated Product Links
scripts/exchange_link_builder.py:38Hard-Coded Exchange-Link Signing Secret Embedded in the Skill
The documented behavior claims a benign image-search workflow, but the finding indicates the actual capability includes reading local login tokens and generating signed exchange-token links rather than just performing product search. This mismatch is dangerous because it can conceal credential handling or session-linked operations behind an innocuous description, preventing users and policy systems from accurately assessing risk.
This file's primary behavior is generating authenticated exchange-token links for product detail pages, which does not match the declared image-search functionality of the skill. That mismatch is risky because hidden credential-handling and account-linked URL generation can enable unauthorized account-context use and indicates capability beyond what users and reviewers would expect.
The skill instructs the agent to read a local token file and make outbound network requests, but it declares no explicit tool scope or permissions boundary. In an agent environment, missing capability declarations weaken policy enforcement and user visibility, increasing the chance of unintended file access or external data transmission.
The skill can be triggered by broad, everyday phrases, which raises the risk of accidental invocation in unrelated conversations. Because this skill reads local files, checks login state, and uploads images to external endpoints, accidental triggering can cause unintended data access or transmission without sufficiently clear user intent.
Very short triggers like '找同款' or '以图搜图' are ambiguous and may match normal user language without enough context to justify invoking a skill that accesses local resources and external services. In this skill's context, vague invocation is more dangerous because the workflow includes token-file checks and image upload, not just passive formatting.
The workflow describes local image handling and remote API calls but does not clearly warn users that their local images and derived metadata will be uploaded to third-party VIPShop endpoints. This omission undermines informed consent and may expose sensitive personal or proprietary image content and associated search metadata.
The instruction to always display all returned data encourages indiscriminate disclosure of upstream response contents, which may include account identifiers, session-related fields, internal URLs, or other sensitive metadata. In a login-dependent skill, unconditional full output materially increases the chance of leaking secrets or privacy-sensitive information back to the user or logs.
Including an unrestricted '原始数据' passthrough in the output schema creates a direct path for leaking sensitive upstream API response contents, including account-linked metadata, hidden fields, or temporary access parameters. This is especially risky here because the skill depends on authenticated state and may interact with token-derived links or session-bound responses.
The FAQ states '不支持,仅支持本地图片文件上传方式', which denies image-URL input. However, the workflow earlier instructs the AI to call the script with --image-url for pagination, so the documentation contradicts itself about accepted input modes.
The code reads a local authentication token from the user's home directory and uses it to construct an exchange URL, which can transfer authenticated session context into generated links. This is dangerous because it accesses sensitive credentials outside the stated image-search purpose and may expose or misuse the user's login state without explicit consent.
The code silently reads a user login token from disk and places token-derived data into a generated URL without any user-facing notice or approval. URLs are commonly logged, shared, cached, or leaked via referrers, so using authentication material in this way increases the chance of credential exposure or unintended authenticated actions.
The skill reads persisted login tokens from ~/.vipshop-user-login/tokens.json and uses them to authenticate requests, which is sensitive credential access. Even if needed for logged-in image search, silently harvesting tokens from a home-directory file creates an unnecessary trust boundary violation and can expose user credentials to unrelated skill logic or future abuse.
The skill accesses stored login tokens from the user's home directory without informing the user that credentials will be read and reused. Undisclosed access to authentication material is dangerous because it normalizes secret scraping and prevents users from making an informed trust decision.
The skill uploads local image content to a remote VIP.com endpoint and also processes arbitrary image URLs against external APIs without any user-facing disclosure or confirmation. Images can contain sensitive personal or commercial information, so silent transmission to third-party services creates a privacy and data-handling risk.
The upload request forces the locale via 'Language/zh_CN' in the User-Agent, and later requests prefer 'zh-CN' in Accept-Language, with no user opt-in or configurability. This can violate language/locale policy expectations when a skill imposes a specific locale rather than allowing user choice or clearly documenting that it is region-specific.
The request headers explicitly prefer 'zh-CN,zh' before English, which imposes a locale preference in outbound requests. The file does not provide any mechanism for user selection or explain that this is a justified region-specific constraint.
The product search request sets Accept-Language to prefer Chinese, but the skill does not ask the user for locale preference or explain the restriction. This is a natural-language policy concern because the skill silently enforces a language/locale choice.