Skip to content

reject path separators in fileExtensionForResponse - #16387

Merged
ncooke3 merged 1 commit into
firebase:mainfrom
isl-Ramzi:fcm-image-extension-separator
Jul 13, 2026
Merged

ncooke3 merged 1 commit into
firebase:mainfrom
isl-Ramzi:fcm-image-extension-separator

Conversation

@isl-Ramzi

Copy link
Copy Markdown
Contributor

Server-controlled MIME type reaches the image download path
The push payload chooses the image URL, so the responding server controls the Content-Type that fileExtensionForResponse: turns into the downloaded file's extension, and it gets appended to the temp path with stringByAppendingString:. A value like image/../../../../evil becomes a suffix carrying path separators that relocates the saved attachment outside its temp file, so I reject any MIME-derived extension that contains a separator. Added a test that stubs the response the same way the existing extension tests do.

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@ncooke3 ncooke3 self-assigned this Jul 13, 2026

@ncooke3 ncooke3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, @isl-Ramzi!

@ncooke3
ncooke3 merged commit 6ea1714 into firebase:main Jul 13, 2026
63 checks passed
chrisbobbe pushed a commit to rajveermalviya/zulip-flutter that referenced this pull request Sep 15, 2026
This commit is the result of the following commands:
  flutter pub get
  pod update --project-directory=ios/
  pod update --project-directory=macos/
plus capping the firebase_core and firebase_messaging constraints in
pubspec.yaml.

Changelogs:
  https://pub.dev/packages/firebase_core/changelog#4130
  https://pub.dev/packages/firebase_messaging/changelog#1643

Hold firebase_messaging below 16.5.0, where the plugin's launch-time
APNs registration became conditional on an auto-init setting that is
off while we configure Firebase from Dart, so getAPNSToken returns null
and we never register the device:
  firebase/flutterfire#18452

Cap firebase_core too, to hold the rest of the family back with it:
firebase_messaging_platform_interface 4.10.0, firebase_messaging_web
4.2.5 and _flutterfire_internals 1.3.77 each require firebase_core
^4.14.0.

These also bump the Firebase Android BoM (34.15.0 to 34.17.0) and the
Firebase iOS SDK (12.15.0 to 12.17.0):
  https://firebase.google.com/support/release-notes/android
  https://firebase.google.com/support/release-notes/ios

The Android SDK's FCM component now better handles a re-registration
error:
  firebase/firebase-android-sdk#8507

For the iOS SDK's FCM component:
  12.16.0 adds the new FCM registration API, which we do not use,
  we take only the APNs token from Firebase API.
    firebase/firebase-ios-sdk#16133

  12.17.0 rejects path separators in file extensions of downloaded
  image attachments, in Firebase's notification service extension,
  which we do not use, we have implement our own notification service
  extension.
    firebase/firebase-ios-sdk#16387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants