# Organization Takeover via invitation API

Reader-level member of a Helium org abused an IDOR in POST /api/invitations to invite a fake account as admin into another org, then escalated to full admin.

- Payout: $100
- Severity: medium
- Program: Helium
- Found by: azraelsec
- Disclosed: 2020-05-27
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/835005
- Library page: https://bugbountylibrary.com/r/h1%3A835005
- Tags: area:web domain:api domain:web impact:ato impact:privesc kind:bounty platform:hackerone sev:medium tech:graphql tech:rest technique:param-pollution vuln:access-control vuln:idor vuln:privilege-escalation

**Target:** Helium Console GraphQL + /api/invitations REST endpoint
**Root cause:** The invitations endpoint trusted the client-supplied `organization` UUID without verifying the requester held admin rights in that organization, only that they were authenticated.
**Steps:**
1. Query `POST /graphql` with `PaginatedOrganizationsQuery` to enumerate org IDs the attacker can see, capturing the target org UUID `cb23000e-...`.
2. As a reader in own org, send `POST /api/invitations` with body `{"invitation":{"email":"attacker+1@...","role":"admin","organization":"<own-org-id>"}}` and intercept in Burp.
3. Replace `organization` with the victim org UUID `cb23000e-65b3-4628-9ede-656ffa0d5aa8` and replay; server returns `201 Created` with `role:admin`.
4. Log in as the fake account, now admin of target org, and demote/remove the real owner.
**How found:** Noticed the invitation request body carried an `organization` UUID as a client-controlled field, hypothesized the server would not re-check the caller's role against that org, and confirmed by swapping the UUID to a target org discovered through the GraphQL organizations query.
**Exploitation:** Attacker needed only a reader seat in any org. They enumerated org UUIDs via GraphQL, then swapped the `organization` field in the invitation request to the victim org's UUID, minting an admin membership for a controlled email. From that admin seat they could change the original attacker's role to admin and delete the legitimate owner, taking over the organization.
**Escalation:** Reader -> admin in victim org via forged invitation, then admin -> owner by removing the legitimate administrator.
**Insight:** When a create/invite endpoint accepts a parent-tenant UUID in the body, always swap it for a tenant you don't administer; GraphQL list queries often leak those UUIDs even when the UI hides them.

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

**Invitation request with swapped organization ID**

```
{"invitation":{"email":"azraelsec+1@wearehackerone.com","role":"admin","organization":"cb23000e-65b3-4628-9ede-656ffa0d5aa8"}}
```

