T09 · Insecure Skill Coding Practices
- Location
references/shopify-api.md:94- Finding
Shopify access token can be disclosed through unvalidated pagination URLs
- Content
View full analysis
")[0] return products ``` ### Technical Analysis The Shopify access token is correctly required for authenticated product retrieval, but the implementation reuses that sensitive header for every pagination request. The next URL is extracted directly from the remotely supplied `Link` response header without validating its scheme, hostname, port, or origin. Consequently, a malicious, compromised, intercepted, or unexpected Shopify response could provide an attacker-controlled pagination URL. The next loop iteration would send the `X-Shopify-Access-Token` header to that destination. Because this is a custom authentication header, applications must not assume that the HTTP client will remove it when the destination changes. Sending a least-privilege token to the canonical Shopify Admin API is necessary for the declared product-import functionality. Forwarding it to an arbitrary origin is not necessary and violates least-privilege and credential-boundary requirements. The code also omits a request timeout, explicit status validation, and response-schema validation, increasing the potential for denial of service or unsafe failure behavior. ### Attack Path 1. ...[truncated 1458 chars]- Remediation
View remediation
