Asger
TTCTheo's Typesafe Cult
•Created by Asger on 5/16/2024 in #questions
Security: How to genuinely not allow HTML?
How do you guys do it?
I can create a
FileRouter
and not include blob
or text
as file types
And now when I use the UploadDropzone
or UploadButton
component, I cannot select files with the file extension .html
. Partial success!
I can still upload HTML files though, as long as I disguise them as PDFs or something else that I allow. This file is fine, according to UploadThing:
So my question is what do you guys do?
Do you read and sanitize files? That's a lot of computation.
Maybe you can use something like the Unix file command?
Looking for ideas here 🙂
Best regards,
Asger3 replies