# URL Path Manipulation Enables Cache Poisoning of Amazon Affiliate Products in Shopify Linkpop

Path traversal in Linkpop's Amazon URL parser let an attacker poison the product cache so victims adding a legit Amazon product instead displayed the attacker's product.

- Payout: $500
- Severity: low
- Program: Shopify
- Found by: saltymermaid
- Disclosed: 2025-08-14
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1848940
- Library page: https://bugbountylibrary.com/r/h1%3A1848940
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:low tech:cdn technique:incomplete-fix vuln:cache-poisoning vuln:path-traversal

**Target:** Linkpop Amazon product link resolver/cache
**Root cause:** URL parsing regex accepted `../` path segments in Amazon product URLs, so the cache key resolved to the victim product ID while the fetched content was the attacker's product.
**Steps:**
1. Pick two uncached Amazon product IDs: victim `████` and attacker `██████`.
2. In attacker's Linkpop account add product with crafted link `https://amazon.ca/dp/[VICTIM-ID]/../[ATTACKER-ID]`.
3. This caches the attacker product under the victim product's key.
4. In victim's Linkpop account add `https://www.amazon.ca/dp/[VICTIM-ID]`; attacker's product is shown and linked.
**How found:** Follow-up to a prior fix that blocked cross-domain redirects; researcher suspected the URL-parsing regex still mishandled path segments and tested `../` traversal within the allowed Amazon domain.
**Exploitation:** Attacker submits a traversal-crafted Amazon URL to Linkpop, which normalizes to the victim product path but fetches/caches the attacker product. Any subsequent user adding the victim product gets the poisoned cached entry, causing spoofed affiliate links.
**Insight:** When a fix whitelists the domain but still regex-parses the path, test `../` and encoded traversal inside the allowed domain to poison shared caches keyed on the normalized path.

## Proof of concept (copied exactly from the original report)

**Crafted Amazon URL with path traversal to poison cache**

```
https://amazon.ca/dp/[VICTIM-PRODUCT-ID]/../[ATTACKER-PRODUCT-ID], anyone who will then try to use the "victim" product link https://amazon.ca/dp/[VICTIM-PRODUCT-ID] will be shown the attacker controlled product. This way works even better because when you click the link button on the victim's page, it will even redirect to the attacker's product.

# Steps to Reproduce
1. Have two Amazon products ID in hands (which haven't been cached yet)
 1.1. Attacker Product ID: `██████` (https://www.amazon.ca/dp/███)
 1.2. Victim Product ID: `████` (https://www.amazon.ca/dp/███████)

2. In your attacker's Linkpop account, add a new Amazon product using the following crafted link `https://amazon.ca/dp/[VICTIM-PRODUCT-ID]/../[ATTACKER-PRODUCT-ID]` and make sure to replace the placholders
 2.1. Based on the ID's in step \#1, you could use the following link `https://amazon.ca/dp/███/../████████
```

**Victim product link that resolves to attacker product**

```
https://www.amazon.ca/dp/█████████, which is the "victim" product ID from step \#1. At that point you should be faced with the attacker's product (███) instead of the victim's product (███s).
```

