google / google/GoogleSignIn-iOS

Profile data are retrieved from ID token without verifying the token

Open
#281 0 comments 0 reactions 0 assignees View on GitHub
bug triage
Dominant language
Objective-C
Stars
750
Forks
282
Avg merge
2d 15h
Merged PRs (30d)
9

Description

**Describe the bug**
Bug location: https://github.com/google/GoogleSignIn-iOS/blob/7932d33686c1dc4d7df7a919aae47361d1cdfda4/GoogleSignIn/Sources/GIDSignIn.m#L803
Here, profile data (email, name, profile picture, etc.) are being retrieved from the ID Token without verifying the integrity of the token. Ideally, an ID Token would be sent over to the backend server, which first [verifies the signature of the token](https://developers.google.com/identity/sign-in/ios/backend-auth) before using the profile information from the payload.

But, in this case, since we are directly retrieving the sensitive profile information (from ID Token's payload) to sign in a user, should we not verify the token first? Especially for mobile or desktop apps (which is the case here) where intermediary-free TLS cannot always be guaranteed?

Additionally, we are not using any CSRF protection (e.g, [PKCE](https://www.rfc-editor.org/rfc/rfc7636)), so I think it is critical to verify the integrity of the ID Token before accepting the profile information from it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.