Back to skill

Security audit

Amazon Deep Research V4

Security checks for vulnerabilities and agentic risk

Overview

This Amazon research skill is mostly coherent, but it asks the agent to copy and reuse logged-in SellerSprite session cookies, creating a real credential exposure risk.

Review carefully before installing. Use only if you are comfortable with browser-based research across these marketplaces, and avoid allowing the agent to copy SellerSprite cookies or tokens into prompts, logs, files, or reports. Prefer an official API key or keeping authenticated actions inside the browser session, and treat the generated HTML report as active content built from untrusted marketplace data.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
references/sellersprite-api.md:10
Finding
Reusable SellerSprite Session Credentials Are Exposed to the Agent Context<![CDATA[ ## Vulnerability Details **File Location**: `references/sellersprite-api.md:10-23` **Additional Locations**: `SKILL.md:69-74`, `references/multi-platform.md:43-59` **Vulnerability Type**: Exposure and insecure handling of reusable session credentials **Risk Level**: Medium ### Vulnerable Code Snippet ```javascript document.cookie ``` ```http POST https://www.sellersprite.com/v3/api/product-research Content-Type: application/json Cookie: ecookie=...; rank-login-user=...; Sprite-X-Token=... ``` The same credential-handling workflow is also prescribed in `SKILL.md` and `references/multi-platform.md`. ### Technical Analysis The Skill instructs the Agent to extract three reusable SellerSprite session credentials—`ecookie`, `rank-login-user`, and `Sprite-X-Token`—from an authenticated browser session and manually place them into a request header. This unnecessarily exposes authentication material to the Agent's working context, browser-tool results, API-call history, diagnostic output, or execution logs. These values function as bearer-style session credentials: possession may be sufficient to authenticate requests without knowing the account password. No instruction was found that explicitly sends these credentials to an unrelated domain, so this is not confirmed malicious exfiltration. Nevertheless, extracting raw tokens from the browser violates least-exposure principles and creates an avoidable credential-disclosure risk. ### Attack Path 1. The user signs in to SellerSprite by scanning a QR code or entering account credentials. 2. The Agent executes `document.cookie` in the authenticated browser context. 3. SellerSprite cookie and token values are returned to the Agent or browser-tool transcript. 4. The Agent manually places those values in the `Cookie` request header. 5. An attacker obtains the values through exposed logs, shared transcripts, compromised tool output, or accidental inclusion in a generated artifact. 6. The attacker replays t ...[truncated 874 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Keep authentication inside an isolated browser profile and avoid returning raw cookie values to the Agent. 2. Perform authenticated requests through the existing same-origin browser session rather than manually reconstructing the `Cookie` header. 3. If API credentials must be handled outside the browser, store them in a dedicated secret manager and expose them only to the request transport layer. 4. Prevent credentials from appearing in prompts, browser results, debug logs, reports, exception messages, and tool-call histories. 5. Add automatic redaction for `Cookie`, `Authorization`, `ecookie`, `rank-login-user`, and `Sprite-X-Token` values. 6. Restrict requests using these credentials to an explicit allowlist of trusted SellerSprite HTTPS origins. 7. Delete temporary credential material immediately after use and do not persist it in generated JSON or HTML output. 8. Require explicit user confirmation before accessing authenticated account data. 9. Document session revocation and reauthentication procedures in case credential disclosure is suspected. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
references/html-template.md:3
Finding
Untrusted Marketplace Data May Be Injected into the Generated HTML Report<![CDATA[ ## Vulnerability Details **File Location**: `references/html-template.md:3-7,75-78` **Related Data Fields**: `SKILL.md:176-180` **Vulnerability Type**: HTML and inline-script injection through unsafe report generation **Risk Level**: Medium ### Vulnerable Code Snippet The HTML-generation instructions prescribe the following behavior: ```text - ECharts 5 loaded from a CDN - Inline CSS - Data embedded as JSON inside a <script> element ``` ```text Python directly concatenates HTML strings and embeds JSON data. Output: output/amazon-research-v4.html ``` The generated report includes externally sourced values such as product names, supplier names, keywords, image URLs, Amazon links, and 1688 offer links. ### Technical Analysis The prescribed implementation uses direct Python string concatenation to construct HTML and embeds scraped data as JSON inside an executable `script` element. The instructions do not require contextual output encoding, HTML sanitization, URL validation, or safe JSON serialization. Marketplace fields must be treated as untrusted because their content can be controlled or influenced by third-party sellers and suppliers. A malicious value containing HTML markup can escape an HTML text or attribute context. A value containing a closing script sequence can terminate an inline JSON script block and introduce executable markup or JavaScript. For example, an attacker-controlled product or supplier field containing a script-closing sequence could escape the intended JSON context if it is serialized without escaping characters significant to HTML parsing. Attribute injection is also possible if externally sourced URLs or names are directly concatenated into `href`, `src`, or other attributes. The risk is amplified because generated reports are intended to be opened in a browser and load active JavaScript through ECharts. ### Attack Path 1. An attacker publishes or modifies a product listing or supplier record on a data source que ...[truncated 1535 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not construct HTML by directly concatenating untrusted strings. 2. Use a template engine with automatic contextual escaping enabled. 3. Insert dynamic text through DOM `textContent`, not `innerHTML`. 4. HTML-escape all text fields and attribute-encode all values inserted into attributes. 5. Validate every external URL before use: - Permit only `https`. - Allowlist expected Amazon and 1688 hostnames where appropriate. - Reject `javascript:`, `data:`, `file:`, and other unexpected schemes. 6. Store report data in a non-executable element such as: ```html <script id="report-data" type="application/json"></script> ``` 7. Serialize embedded JSON safely by escaping characters that can affect HTML parsing, including `<`, `>`, `&`, U+2028, and U+2029. In particular, prevent literal script-closing sequences from appearing in an inline script block. 8. Apply a restrictive Content Security Policy. Avoid inline scripts where possible and restrict network destinations with `connect-src`, `img-src`, and `script-src`. 9. Pin third-party JavaScript to a reviewed version and use Subresource Integrity if a CDN remains necessary. 10. Add automated tests containing adversarial values in every scraped field, including quotes, HTML tags, event-handler attributes, unexpected URL schemes, and script-closing sequences. 11. Consider generating a static report without JavaScript when interactive charts are not required. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Missing User Warnings

High
Confidence
94% confidence
Finding
The skill asks for handling authenticated account cookies/tokens but provides no warning that these are sensitive credentials or that they should not be retained, shared, or output. In context, this omission is dangerous because the skill targets a manual login flow and then normalizes secret extraction as part of routine operation.

Ssd 3

High
Confidence
98% confidence
Finding
The instruction to extract and reuse authenticated session cookies from a manual login flow is a direct unsafe-secret-handling pattern. It can enable account misuse, session theft, policy violations, and unintended access to the user's paid SellerSprite account beyond the immediate research task.

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill instructs an agent to extract authentication cookies and session tokens from a logged-in browser and replay them in API calls without any safeguards, consent flow, or handling restrictions. This creates a credential-handling vulnerability because those tokens can grant full access to the user's authenticated account and may be exposed in logs, prompts, reports, or downstream tools.

Ssd 3

High
Confidence
99% confidence
Finding
The document explicitly directs reuse of authenticated session artifacts (ecookie, rank-login-user, Sprite-X-Token) from an interactive login session to access protected endpoints. In this skill context, that is especially dangerous because the agent is designed for multi-platform automated collection and concurrent processing, increasing the chance of session theft, unauthorized account actions, and accidental propagation of tokens across tools or tasks.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The trigger list includes generic phrases such as '市场调研', '快速调研', '产品分析', and '竞品分析', which are broad enough to match many ordinary research or analysis requests outside this skill’s intended Amazon product-selection workflow. The file does not provide limiting context, explicit activation constraints, or negative examples to narrow when these triggers should or should not invoke the skill.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
The skill explicitly instructs the operator to extract authenticated SellerSprite session cookies and tokens from a logged-in browser and reuse them for API access. That is broader than ordinary product research and creates a credential-handling and session-hijacking risk, especially if those secrets are logged, persisted, or reused outside the original browser context.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explicitly instructs extracting an Amazon page image URL and sending it to a third-party 1688 endpoint, but provides no user disclosure, consent step, or data-handling constraint. Even if the transmitted value is only an image URL, it is page-derived data sent cross-platform and may expose browsing targets, identifiers in signed image URLs, or commercially sensitive research activity.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The fallback section says to use Chinese keywords for search, which imposes a specific language/locale behavior. Because the file does not offer opt-in, alternatives, or a clear region-specific justification, this is a natural-language policy violation under the language/locale rule.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file’s headings and instructions are entirely in Chinese, including operational guidance such as filtering categories and logic descriptions. There is no indication that the skill is region-specific or that users can opt into this locale, which creates a natural-language locale policy concern under the stated rules.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The entire skill description and operational instructions are written exclusively in Chinese, with no indication that users may choose another language or locale. Per the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is clearly documented and justified.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This file contains user-facing operational instructions only in Chinese, which can impose a fixed language on users without opt-in. The policy allows locale constraints only when they are explicitly offered as a choice or clearly justified as region-specific, which is not stated here.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The entire skill is written in Chinese and provides mandatory workflow instructions without offering any language or locale choice. This can violate a language/locale policy when users or downstream systems are not explicitly opting into Chinese-only operation.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The document is written entirely in Chinese and defines report labels and structure in Chinese, which indicates a fixed language/locale for generated output. There is no indication that users can opt into another language or that the template is restricted to a China-specific compliance or regional workflow.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
This file contains user-facing natural-language instructions exclusively in Chinese, which can impose a language constraint on users without opt-in. Under the policy, forced language or locale without choice or justification is a natural-language policy concern.

Static analysis

No suspicious patterns detected.