# GHSA-GFG4-7MG4-WPM2: Apple connector trusts the unsigned user.email form field, allowing account takeover

- Database: GitHub
- Severity: CVSS 9.1 (Critical)
- Published: 2026-11-09
- Modified: 2026-11-09

## Affected versions

- @logto/connector-apple (npm): from 1.2.0, through 1.6.10

## Description

### Summary

`@logto/connector-apple` takes a user's email from the `user` field of Apple's sign-in callback in preference to the email claim in Apple's signed ID token. Apple delivers `user` as an ordinary form field that the browser relays to Logto (`response_mode=form_post`), and it is not covered by any signature, so the person signing in can replace it with any address. Logto then treats that address as the Apple account's email.

An attacker with any Apple ID can therefore use a victim's email address to get into the victim's existing Logto account, or to register an account under the victim's address before the victim does.

### Impact

Every tenant that enables the Apple social connector is affected. The attacker needs only their own Apple ID and the victim's email address. The victim does not have to do anything.

- **Takeover of an existing account.** When a social sign-in carries an email that already belongs to a Logto user, Logto offers to link the new social identity to that user, and the linking request is not tied to any proof that the person signing in owns the address. With a forged email, the attacker's Apple ID is linked to the victim's account and the attacker is signed in as the victim.
- **Pre-account takeover.** If no user has the address yet, social sign-up creates a new user with the forged address as its primary email, without verifying it. When the real owner later signs in to that tenant with an email verification code, they land in the account the attacker created, which the attacker can still enter with their Apple ID.

### Patches

Fixed in `@logto/connector-apple` 1.6.11 and Logto 1.46.0. The connector now uses only the email in Apple's signed ID token, and only when Apple marks it as verified.

### Workarounds

Disable the Apple social connector until you can upgrade.

### Details

`packages/connectors/connector-apple/src/index.ts`, `getUserInfo`:

```ts
email:
  user?.email ??
  (payload.email && payload.email_verified === true ? String(payload.email) : undefined),
```

`payload` holds the verified claims of Apple's ID token. `user` is parsed from the callback form data, so `??` lets the unsigned value win. This was introduced in `@logto/connector-apple` 1.2.0 (Logto 1.14.0) by "support apple sign-in with email" (#5454).

Core uses the email the connector returns without verifying it again:

- `packages/core/src/libraries/social.ts`, `findSocialRelatedUser`, looks up an existing user by that email so the identity can be linked to them.
- `packages/core/src/routes/experience/classes/verifications/social-verification.ts`, `toSyncedProfile`, sets it as a new user's `primaryEmail` when no other user has it. The deprecated `/api/interaction` API does the same in `packages/core/src/routes/interaction/actions/helpers.ts`.

Apple includes the `email` claim in the ID token on every authorization when the email scope was granted, so the form field is never needed for the email. Apple may send `email_verified` as either a boolean or the string `"true"`.

## References

- https://github.com/logto-io/logto/security/advisories/GHSA-gfg4-7mg4-wpm2

Page: https://cve.now/GHSA-GFG4-7MG4-WPM2

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
