# Server Side Request Forgery (SSRF) in webhook functionality

Webhook test-request feature lacked IPv6 filtering; an attacker-controlled redirect to `[::ffff:a9fe:a9fe]` reached the AWS EC2 metadata endpoint, leaking instance metadata.

- Payout: $2,500
- Severity: medium
- Program: HackerOne
- Found by: madara_
- Disclosed: 2024-01-30
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/2301565
- Library page: https://bugbountylibrary.com/r/h1%3A2301565
- Tags: area:web domain:web impact:data-leak impact:internal-access kind:bounty platform:hackerone sev:medium tech:aws technique:chained vuln:ssrf

**Target:** Webhook creation/test-request endpoint on hackerone.com
**Root cause:** SSRF blocklist filtered IPv4 and literal IPv6 but not IPv4-mapped IPv6 addresses (`::ffff:a9fe:a9fe`), and followed redirects from attacker servers.
**Steps:**
1. Host a PHP page that returns `Location: http://[::ffff:a9fe:a9fe]` (169.254.169.254 mapped).
2. In org program settings, create a webhook pointing to that public URL.
3. Edit the webhook and click 'Test request'.
4. Observe webhook logs: response includes `server: EC2ws`, confirming the request hit the AWS metadata service.
**How found:** Noticed the webhook anti-SSRF filter blocked IPv4 and IPv6 but not IPv6 addresses mapped to IPv4; hypothesized the mapped form would slip past the blocklist and reach link-local metadata.
**Exploitation:** Attacker with an org account registers a webhook to their own server, which 302-redirects to the IPv4-mapped IPv6 form of the metadata IP; the webhook tester follows the redirect and fetches internal metadata, visible in webhook logs.
**Insight:** When testing SSRF blocklists, try IPv4-mapped IPv6 forms like `[::ffff:a9fe:a9fe]` and `[::ffff:127.0.0.1]`; also test redirect-based bypasses since filters often validate only the initial URL, not the redirect target.

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

**PHP redirect to IPv6-mapped AWS metadata IP**

```
<?php
// Obtén los datos de la solicitud
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
header("Content-Type: application/json");
header("Location: http://[::ffff:a9fe:a9fe]"); //IPV6 Compressed
?>
```

