stream-chat-flutter icon indicating copy to clipboard operation
stream-chat-flutter copied to clipboard

Special characters in filenames can lead to "AccessDeniedAccess denied" page on stream-io-cdn.com on iOS

Open babbage opened this issue 11 months ago • 0 comments

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter: 7.1.0

What happened?

Uploading a file as an attachment to Stream Chat, when selecting it via the files browser, will upload the file and create a link to open the file from Stream's CDN stream-io-cdn.com. However, if that file contains certain special characters, following the link will open a browser window that contains only "AccessDeniedAccess denied".

Steps to reproduce

1. Take an image file.
2. Make two copies, call them `example.png` and `â.png`
3. Place a copy of each file in a location accessible from the files navigator in Stream Chat.
4. In Stream Chat on iOS, click the attachment button.
5. Select the file navigator option, and select one of the files.
6. Upload the file to the chat.
7. Repeat 4-6 for the other file.
8. Both files upload normally, and provide download links to the right of the file preview, which for an image will correctly show an image thumbnail for both.
9. Tap on each of the download links.

Expected behaviour:
For both files, the file will open in a browser window that offers the user to view or download the file.

Actual behaviour:
For the file with the less common character in the filename, the page will just display "AccessDeniedAccess denied" in the top right corner. In contrast, the same image/file when uploaded with a filename that does not contain the triggering characters will display/download fine.

This issue was *not* seen using the same file, with the same filename, in the same implementation of Stream Chat, on Android 14.

Supporting info to reproduce

These filenames trigger the error (on iOS): â.png Ñ.png Снимок-ÑкÑана-2023â12â06-в-18.53.24 2.png (our original filename)

These filenames do not trigger the error, and work fine: example.png Ð.png СнÐ,мок-NкNана-2023a12a06-в-18.53.24 2.png

Relevant log output

No response

Flutter analyze output

Analyzing ios...                                                        
No issues found! (ran in 3.4s)

Flutter doctor output

[✓] Flutter (Channel stable, 3.19.1, on macOS 14.4 23E214 darwin-arm64, locale en-NZ)
    • Flutter version 3.19.1 on channel stable at /Users/[redacted]/Applications/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abb292a07e (2 weeks ago), 2024-02-20 14:35:05 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/[redacted]/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.13.0

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.87.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.84.0

[✓] Connected device (7 available)
    • sdk gphone64 arm64 (mobile)  • emulator-5554                            • android-arm64 • Android 14 (API 34) (emulator)
    • [redacted] (mobile)          • [redacted]                • ios           • iOS 17.3.1 21D61
    • [redacted] (mobile)            • [redacted] • ios           • iOS 16.7.5 20H307
    • iPhone SE (mobile)           • [redacted]     • ios           • com.apple.CoreSimulator.SimRuntime.iOS-17-2
      (simulator)
    • iPhone SE (develop) (mobile) • [redacted]     • ios           • com.apple.CoreSimulator.SimRuntime.iOS-17-2
      (simulator)
    • iPhone SE (zoomed) (mobile)  • [redacted]     • ios           • com.apple.CoreSimulator.SimRuntime.iOS-17-2
      (simulator)
    • macOS (desktop)              • macos                                    • darwin-arm64  • macOS 14.4 23E214 darwin-arm64

[✓] Network resources
    • All expected network resources are available.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

babbage avatar Mar 07 '24 23:03 babbage