Attachements always exceed Size Limit #666

Closed
opened 2026-02-04 22:08:37 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @bokkabonga on GitHub (Mar 30, 2020).

Subject of the issue

Attachements wont be uploaded with Error "Attachment size limit exceeded with this file: SizeLimit" even with SizeLimit beeing set above the file SIze.

Your environment

  • Bitwarden_rs version: 1.14.1-91dd1947
  • Install method: Docker-Image
  • Clients used: Web Vault, Windows Client
  • Reverse proxy and version:
  • Version of mysql/postgresql: mariadb 10.4
  • Other relevant information:

Steps to reproduce

Set per User attachement Limit to 1000KB. Tried it in the admin page as well as in the docker-compose. Tried to upload files way below this limit, which throws the error above.

Expected behaviour

The attachement should be abloaded.

Actual behaviour

Uploading the attachement gets rejected by the error "Attachment size limit exceeded with this file: SizeLimit".

Relevant logs

[2020-03-30 12:52:36][multipart::server][INFO] Multipart::with_boundary(_, "----WebKitFormBoundaryzCinABGOv5R6D0d0")
[2020-03-30 12:52:36][error][ERROR] Attachment size limit exceeded with this file: SizeLimit
[2020-03-30 12:52:36][response][INFO] POST /api/ciphers//attachment multipart/form-data (post_attachment) => 400 Bad Request

Originally created by @bokkabonga on GitHub (Mar 30, 2020). <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unneccessary for your issue, feel free to remove them. Remember to hide/obfuscate personal and confidential information, such as names, global IP/DNS adresses and especially passwords, if neccessary. --> ### Subject of the issue <!-- Describe your issue here.--> Attachements wont be uploaded with Error "Attachment size limit exceeded with this file: SizeLimit" even with SizeLimit beeing set above the file SIze. ### Your environment <!-- The version number, obtained from the logs or the admin page --> * Bitwarden_rs version: 1.14.1-91dd1947 <!-- How the server was installed: Docker image / package / built from source --> * Install method: Docker-Image * Clients used: Web Vault, Windows Client * Reverse proxy and version: <!-- if applicable --> * Version of mysql/postgresql: mariadb 10.4 * Other relevant information: ### Steps to reproduce <!-- Tell us how to reproduce this issue. What parameters did you set (differently from the defaults) and how did you start bitwarden_rs? --> Set per User attachement Limit to 1000KB. Tried it in the admin page as well as in the docker-compose. Tried to upload files way below this limit, which throws the error above. ### Expected behaviour <!-- Tell us what should happen --> The attachement should be abloaded. ### Actual behaviour <!-- Tell us what happens instead --> Uploading the attachement gets rejected by the error "Attachment size limit exceeded with this file: SizeLimit". ### Relevant logs <!-- Share some logfiles, screenshots or output of relevant programs with us. --> [2020-03-30 12:52:36][multipart::server][INFO] Multipart::with_boundary(_, "----WebKitFormBoundaryzCinABGOv5R6D0d0") [2020-03-30 12:52:36][error][ERROR] Attachment size limit exceeded with this file: SizeLimit [2020-03-30 12:52:36][response][INFO] POST /api/ciphers/<uuid>/attachment multipart/form-data (post_attachment) => 400 Bad Request
Author
Owner

@manofthepeace commented on GitHub (Mar 30, 2020):

The size limit is not per attachment, but total, per user or org. So 1000kb means in total you cannot have files that are more than 1000kb. ex. 2x500kb then you cannot upload anymore.

@manofthepeace commented on GitHub (Mar 30, 2020): The size limit is not per attachment, but total, per user or org. So 1000kb means in total you cannot have files that are more than 1000kb. ex. 2x500kb then you cannot upload anymore.
Author
Owner

@BlackDex commented on GitHub (Mar 30, 2020):

I don't know exactly what is shown to the user in the web-interface or clients, but if it is the same as "Attachment size limit exceeded with this file: SizeLimit" Then we could change this to be a bit better. Now it looks like the specific attachment is to large, instead of the total allowed size has been reached.

Also, an upload limit per file is a bit tricky, since the file gets encrypted and probably will increase in size.

You can limit the upload size a bit if you limit the request/body size in the reverse-proxy, but you should take into account that there will be some overhead because of headers, and encryption.

And if you do this for the whole site/api, then items like importing or re-ncrypting/password change will probably fail also.

@BlackDex commented on GitHub (Mar 30, 2020): I don't know exactly what is shown to the user in the web-interface or clients, but if it is the same as "Attachment size limit exceeded with this file: SizeLimit" Then we could change this to be a bit better. Now it looks like the specific attachment is to large, instead of the total allowed size has been reached. Also, an upload limit per file is a bit tricky, since the file gets encrypted and probably will increase in size. You can limit the upload size a bit if you limit the request/body size in the reverse-proxy, but you should take into account that there will be some overhead because of headers, and encryption. And if you do this for the whole site/api, then items like importing or re-ncrypting/password change will probably fail also.
Author
Owner

@bokkabonga commented on GitHub (Mar 31, 2020):

Thanks for the answers so far! I really appreciate your help.

The size limit is not per attachment, but total, per user or org. So 1000kb means in total you cannot have files that are more than 1000kb. ex. 2x500kb then you cannot upload anymore.

Yeah I already knew this. The size limit per user is set to 1000kb for testing and no files have been uploaded so far. Still i can´t upload a single file, even if it is a 2kb .txt

Concerning what BlackDex said: I am totally fine with a limit per user, i actually prefer it over a limit per file. However it doesn´t seem to work at the moment.

@bokkabonga commented on GitHub (Mar 31, 2020): Thanks for the answers so far! I really appreciate your help. > > > The size limit is not per attachment, but total, per user or org. So 1000kb means in total you cannot have files that are more than 1000kb. ex. 2x500kb then you cannot upload anymore. Yeah I already knew this. The size limit per user is set to 1000kb for testing and no files have been uploaded so far. Still i can´t upload a single file, even if it is a 2kb .txt Concerning what BlackDex said: I am totally fine with a limit per user, i actually prefer it over a limit per file. However it doesn´t seem to work at the moment.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#666