RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.48k stars 10.54k forks source link

Uploading file bigger than the size limit lead to rocketchat server to stop/crash #23583

Open Nono-m0le opened 3 years ago

Nono-m0le commented 3 years ago

Description:

One of our user (admin rights) upload a big file (2GB) when the limit is set to: image at the end of the transfer, (100% uploaded) the server became unresponsive

Steps to reproduce:

  1. set a upload size limit
  2. upload a bigger file than the limit
  3. server crash

Expected behavior:

Message saying that the file is higher than the limit and not start the upload (or stop it when the limit is reached)

Actual behavior:

The rocketchat server went unresponsive, as well as the hosting server (ubuntu).

Server Setup Information:

Client Setup Information

Additional context

Relevant logs:

Exception in callback of async function: RangeError [ERR_INVALID_OPT_VALUE] [ERR_INVALID_OPT_VALUE]: The value "2482641664" is invalid for option "size"
     at Function.allocUnsafe (buffer.js:383:3)
     at Function.concat (buffer.js:564:25)
     at FileStream.<anonymous> (app/api/server/lib/getUploadFormData.js:18:81)
     at FileStream.emit (events.js:326:22)
     at FileStream.EventEmitter.emit (domain.js:483:12)
     at endReadableNT (_stream_readable.js:1241:12)
     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
   code: 'ERR_INVALID_OPT_VALUE'
 }
CoHarsh commented 3 years ago

Can I work on this issue?

dudanogueira commented 3 years ago

@CoHarsh sure!

I would first try to replicated it under the latest version, and then go from there.

Also, try to answer this questions: Does it happen also using the web version? Mobile too?

Let us know your findings :)