Upload MimeTypes: Server-side validation #1431
Replies: 2 comments 1 reply
-
|
Hey @MentalGear — I believe it does both! But honestly I can't remember. Gonna ping @PatrikKozak to do some testing here and report back with his findings. If it doesn't work on front / backend, it will shortly. 👍 Also, is your name a play off Metal Gear? Because if it is, big fan. There are Metal Gear references littered throughout our site and docs.... 😇 |
Beta Was this translation helpful? Give feedback.
-
|
This is exactly the gap I’ve seen in a lot of upload pipelines. Restricting what the browser picker allows is useful UX, but it’s not the same thing as making a trust decision on the server. Filenames and client-declared MIME are easy to spoof, so the real boundary is the backend route that receives the bytes. I built an OSS package for this exact step in Node.js: It focuses on inspect-before-storage decisions for untrusted uploads: content-based type checks, MIME/extension mismatch detection, archive risk signals, suspicious document/binary hints, and optional quarantine/promote workflows. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was very pleased to read that payload does uniform validation across front/backend.
When reading about settable mimeTypes, it's easy to assume the same would apply here. Yet, reading a bit more in detail, the docs state
mimeTypes property can restrict what files are allowed from the user's file picker.. So frontend only.It would make sense to have the backend check mimetypes too, to be in line with the rest of validation and what developers expect. Thx!
Beta Was this translation helpful? Give feedback.
All reactions