Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't cache FCM registration token operations. #14355

Merged
merged 1 commit into from
Jan 16, 2025
Merged

Conversation

leojaygoogle
Copy link
Contributor

@leojaygoogle leojaygoogle commented Jan 16, 2025

We are using defaultSessionConfiguration as the HTTP session configuration for FCM registration token operations. https://github.com/firebase/firebase-ios-sdk/blob/a34d7ae4ed3ce143bc22d57cbda9e9341fee3df6/FirebaseMessaging/Sources/Token/FIRMessagingTokenFetchOperation.m#L111C65-L111C92

As a result, HTTP requests and responses are cached in the Cache.db file.

This probably isn't a security risk. Other apps cannot access the file, and even if someone got the FCM registration token, they couldn't do anything with it. They cannot just send notifications with the token alone. https://firebase.google.com/docs/cloud-messaging/auth-server

But still, caching the HTTP requests and responses are unnecessary. We don't use the cache in any way.

Fix #14352

We are using `defaultSessionConfiguration` as the HTTP session configuration for FCM registration token operations.
https://github.com/firebase/firebase-ios-sdk/blob/a34d7ae4ed3ce143bc22d57cbda9e9341fee3df6/FirebaseMessaging/Sources/Token/FIRMessagingTokenFetchOperation.m#L111C65-L111C92

As a result, all HTTP requests and responses are cached in the `Cache.db` file.

This probably isn't a security risk. Other apps cannot access the file, and even if someone got the FCM registration token, they couldn't do anything with it. They cannot just send notifications with the token alone. https://firebase.google.com/docs/cloud-messaging/auth-server

But still, caching the HTTP requests and responses are unnecessary. We don't use the cache in any way.
Copy link
Member

@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@leojaygoogle leojaygoogle marked this pull request as ready for review January 16, 2025 22:00
@leojaygoogle leojaygoogle merged commit 8d75fef into main Jan 16, 2025
57 checks passed
@leojaygoogle leojaygoogle deleted the token-cache branch January 16, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FCM Device token is getting stored in Cache.db file as plaintext
3 participants