4 ms·
Then file_name needs to be reasonable and not arbitrary, right? I don't care where you push your checks around to, just as long as they exist.
by paulddraper 10y ago
Then file_name needs to be reasonable and not arbitrary, right?
I don't care where you push your checks around to, just as long as they exist.
- wyager 10y agoA hex-encoded file hash as a file name is a safe bet. You can resolve file names (unsanitized, stored safely in a database) to hashes and load the files from disk. This general approach (whitelisting file URLs) lets us localize any path sanitation to the file upload code, rather than every single request.