Inconsistent Image Upload Restriction Between "Attach Files" and Direct Attachment #6042
Replies: 3 comments 1 reply
-
A related issue was fixed recently: #5881 Make sure to update, provide any logs and the version you are using, along with the exact If using Docker, please run and provide the output of: docker images | grep librechat If running from source, please run and provide the output of: git rev-parse HEAD Please paste relevant logs that were created when reproducing the error. Log locations:
There are two types of logs that can help diagnose the issue:
Error logs contain exact stack traces and are especially helpful, but both can provide valuable information. Please only include the relevant portions of logs that correspond to when you reproduced the error.Updating Instructions (docker): # Linux command to Remove all existing images
docker images -a | grep "librechat" | awk '{print $3}' | xargs docker rmi
# Windows Powershell
docker images -a | findstr "librechat" | ForEach-Object { docker rmi $_.Split()[2] } Then follow the directions here: https://www.librechat.ai/docs/local/docker#update-librechat |
Beta Was this translation helpful? Give feedback.
-
@danny-avila 1. Docker Images Outputghcr.io/danny-avila/librechat-dev-api latest 2176088be80d 4 days ago 998MB
ghcr.io/danny-avila/librechat-rag-api-dev-lite latest 095db2c2ff3b 2 months ago 1.29GB 2. Content of the librechat.yaml Configuration FilefileConfig:
endpoints:
assistants:
fileLimit: 100
fileSizeLimit: 1024 # Maximum size for each file (MB)
totalSizeLimit: 10240 # Maximum total size for all files in a single request (MB)
openAI:
disabled: true # Disable file uploads to the OpenAI endpoint
Deepseek:
fileLimit: 5
fileSizeLimit: 1024 # Maximum size for each file (MB)
totalSizeLimit: 10240 # Maximum total size for all files in a single request (MB)
supportedMimeTypes:
- "text/.*"
- "application/.*"
- "application/x-sh"
default:
totalSizeLimit: 10240
supportedMimeTypes:
- "image/.*"
- "text/.*"
- "application/.*"
- "application/x-sh"
YourCustomEndpointName:
fileLimit: 5
fileSizeLimit: 1024
serverFileSizeLimit: 102400 # Global server file size limit (MB)
avatarSizeLimit: 2 # Maximum size for user avatar images (MB) 3. Correct Behavior: Blocking Video Uploads
4. Incorrect Behavior: Allowing Image Uploads
5. Debug Log (2025-03-01)
6. Error Log (2025-03-01)
Summary: |
Beta Was this translation helpful? Give feedback.
-
Does anyone have other ideas or solutions? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
Hi team,
I've encountered an inconsistency in how image uploads are handled when using the file attachment feature, specifically with Deepseek-R1. The behavior differs depending on how the file is attached.
Observed Behavior:
"Attach Files" Button (Expected Behavior):
fileConfig.endpoints.supportedMimeTypes
to excludeimage/.*
, attempting to upload an image through the "Attach Files" button (highlighted in the first screenshot) is correctly blocked. I see the "Unsupported file type for endpoint" error message, as expected. This is good!Direct Attachment (Paperclip Icon - Unexpected Behavior):
image/.*
is excluded infileConfig.endpoints
. This bypasses the intended restriction.Screenshots:
Screenshot 1: "Attach Files" area and error message (Correct behavior)
Screenshot 2: Paperclip icon (Incorrect behavior)
Expected Behavior:
The image upload restriction defined in
fileConfig.endpoints
should apply consistently, regardless of whether the user clicks "Attach Files" or uses the direct attachment (paperclip) method. Ifimage/.*
is excluded, images should be blocked in both cases.Request:
Could you please investigate and modify the file upload logic to ensure consistent behavior? The direct attachment method (paperclip icon) should respect the
fileConfig.endpoints
settings in the same way as the "Attach Files" button.Context:
fileConfig.endpoints
: My configuration intentionally excludes image MIME types (image/.*
) to prevent image uploads.I believe this inconsistency could represent a potential security issue, as it allows users to bypass intended file type restrictions. Thank you for your time and attention to this matter!
Version Information
v0.7.7-rc1
Steps to Reproduce
Screenshots:
Screenshot 1: "Attach Files" area and error message (Correct behavior)
Screenshot 2: Paperclip icon (Incorrect behavior)
Expected Behavior:
The image upload restriction defined in
fileConfig.endpoints
should apply consistently, regardless of whether the user clicks "Attach Files" or uses the direct attachment (paperclip) method. Ifimage/.*
is excluded, images should be blocked in both cases.What browsers are you seeing the problem on?
No response
Relevant log output
Screenshots
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions