GHSA-j4h8-vch3-f797 / CVE-2025-24365: Escalation of privilege via variable confusion in OrgHeaders trait
- Published:
- Fetched:
- Updated:
- Affects:
- dani-garcia vaultwarden/server
https://github.com/dani-garcia/vaultwarden/security/advisories/GHSA-j4h8-vch3-f797 ↗
Escalation of privilege via variable confusion in OrgHeaders trait ### Summary Attacker can obtain owner rights of other organization. Hacker should know the ID of victim organization (in real case the user can be a part of the organization as an unprivileged user) and be the owner/admin of other organization (by default you can create your own organization) in order to attack. ### Details Vulnerable part of code is located in `src/auth.rs` in OrgHeaders trait.  Server finds `url_org_id`, then gets membership and type of membership by this var. Lets review how server gets `url_org_id`.  Here we can see two if conditions. Server tries to get organization UUID from the path param and then the same from the GET query. If we specify GET query and path param both, value from GET query will overwrite the value from path param. Also we can see that most of endpoints in `src/api/core/organizations.rs` get organization UUID from path param and do not use `organizationId` GET query value. Thus we can interact with the first organization having rights of the second one. ### PoC 1. Foreign organization deletion `DELETE /api/organizations/?organizationId=` Where **UUID1** -- foreign organization, **UUID2** -- organization where attacker has owner/admin rights. 2. Foreign organization privilege escalation. Inviting user in victim organization ``` POST /api/organizations//users/invite?organizationId= {"emails":["attacker@site.com"],"collections":[],"accessAll":true,"permissions":{"response":null},"type":0,"groups":[],"accessSecretsManager":false} ``` Where **UUID1** -- foreign organization, **UUID2** -- organization where attacker has owner/admin rights. Confirm user enrollment in the victim organization ``` POST /api/organizations//users//confirm?organizationId= {"key":} ``` Where **UUID1** -- foreign organization, **UUID2** -- organization where attacker has owner/admin rights, ATTACKER_USER_UUID -- UUID of attacker. Affected packages: docker hub:vaultwarden/server Patched: vaultwarden/server 1.33.0