# Email Address Exposure via Gratipay Migration Tool

Migration conflict page at /migrate?step=2 reflected any existing user's primary email in the log-in.id button value, leaking emails without authorization.

- Payout: $100
- Severity: medium
- Program: Liberapay
- Found by: suprnova
- Disclosed: 2022-10-09
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1727044
- Library page: https://bugbountylibrary.com/r/h1%3A1727044
- Tags: area:web domain:web impact:data-leak impact:pii-leak kind:bounty platform:hackerone sev:medium tech:python vuln:idor vuln:info-disclosure

**Target:** Liberapay /migrate Gratipay migration endpoint
**Root cause:** The conflict-handling template rendered existing_account.email directly into the log-in.id button value for any username supplied, without verifying ownership of that account.
**Steps:**
1. Authenticate and obtain CSRF token.
2. POST `/migrate?step=2` with `email_address=attacker@x.com&username=<victim>` and valid `X-CSRF-TOKEN`.
3. Read response HTML; the `log-in.id` button `value` contains the victim's primary email.
**How found:** Noticed the migration conflict flow auto-populates a login identifier; hypothesized it used the existing account's email and confirmed by inspecting the rendered HTML.
**Exploitation:** Any logged-in user submits a migration step-2 request naming a victim username; the server detects the username conflict and returns a form whose log-in.id button value is populated with the victim's primary email, disclosing it regardless of privacy settings.
**Insight:** On account-migration/merge flows, the conflict-resolution form often pre-fills the existing account's identifiers (email, id) to help the user 'claim' it—enumerate these pre-filled hidden fields for IDOR leaks.

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

**POST /migrate request leaking target email**

```
POST /migrate?step=2 HTTP/1.1
Host: liberapay.com
Cookie: XXXXXXX
X-CSRF-TOKEN: XXXXXXX
Content-Type: application/x-www-form-urlencoded

email_address=suprnova+gratipay@wearehackerone.com&username=suprnova
```

