GHSA-rm8c-2cv8-jwf6: Pocket ID: Email verification token remains valid after address change, enabling arbitrary verified-email spoofing
- Source:
- OSV.dev
- Published:
- Fetched:
- Updated:
- Affects:
- github.com/pocket-id/pocket-id/backend
https://osv.dev/vulnerability/GHSA-rm8c-2cv8-jwf6 ↗
Pocket ID: Email verification token remains valid after address change, enabling arbitrary verified-email spoofing ## Summary An authenticated Pocket ID user can request an email-verification token while their account uses an address they control, change the account email address, and then redeem the previously issued token. The token is bound only to the user ID, not to the address to which it was sent, and changing the address does not revoke outstanding tokens. As a result, Pocket ID marks the newly supplied address as verified even though the user never proved control of it. Pocket ID subsequently returns that address with `email_verified: true` in OIDC claims. A relying party that trusts this claim for email-based account linking or provisioning can therefore link the attacker's Pocket ID identity to a victim's existing account, leading to cross-application account takeover. This was verified against commit `9f559788a44cfea790de360da0a74d4bdf8ca5d5`. ## Preconditions - The attacker has an ordinary Pocket ID user account. - Email verification is in use (`emailsVerified=false`, which is the default). - The user can edit their own account (`allowOwnAccountEdit=true`, which is the default). - The target address is not already assigned to another Pocket ID user. - For downstream account takeover, a relying party links or provisions users based on a trusted, verified email address. Applications that rely exclusively on the stable OIDC `sub` claim are not affected by that downstream consequence. No administrator privilege, victim interaction, or access to the victim's mailbox is required. ## Reproduction through the API 1. Sign in as an ordinary user whose current email address is controlled by the attacker, for example `attacker@example.test`. 2. Call `POST /api/users/me/send-email-verification`. 3. Obtain the token from the message delivered to `attacker@example.test`, but do not redeem it yet. 4. Call `PUT /api/users/me` and change the account email to an address the attacker does not control, for example `victim@example.test`. 5. Observe that the new address is initially stored with `emailVerified: false`. 6. Call `POST /api/users/me/verify-email` with the token delivered to `attacker@example.test`. 7. Call `GET /api/users/me`. The current address is now `victim@example.test` and `emailVerified` is `true`. 8. Complete an OIDC flow with the `email` scope. Pocket ID emits: ```json { "email": "victim@example.test", "email_verified": true } ``` The old token has therefore verified a different address from the one to which it was delivered. ## Executable regression test / proof of concept Save this as `backend/internal/service/audit_email_verification_test.go` and run: ```text go test -tags=exclude_frontend,unit ./internal/service -run TestAuditEmailVerificationTokenSurvivesEmailChange -count=1 -v ``` The test passes on the referenced commit and demonstrates the unintended state transition: ```go package service import ( "testing" "time" "github.com/stretchr/testify/require" "github.com/pocket-id/pocket-id/backend/internal/appconfig" " Affected: Go:github.com/pocket-id/pocket-id/backend Fixed in: 0.0.0-20260727180059-43aaccd5bfac References: https://github.com/pocket-id/pocket-id/security/advisories/GHSA-rm8c-2cv8-jwf6 https://nvd.nist.gov/vuln/detail/CVE-2026-115770 https://github.com/pocket-id/pocket-id/pull/1625 https://github.com/pocket-id/pocket-id/commit/43aaccd5bfacb76283b11ce039fb3f0716196fcb https://github.com/pocket-id/pocket-id https://github.com/pocket-id/pocket-id/releases/tag/v2.12.0