Dreamer's avatar

Found some .bin files in upload folder

I use Laravel 5.6.

So i have a website where people can upload their cv's. I validate all my uploads with

$validator = Validator::make($request->all(), [
            'uploadfile' => 'required|file|mimes:pdf,txt,doc,docx,jpeg,png,jpg,gif,svg|max:10048',
        ]);

if ($validator->fails()) {
            return json_encode(['success' => false]);
        }

But i found some *.bin files inside the upload folder and they are uploaded files. How is this possible? Should i be worried? I tried those download links and it downloads file, it does not run them. I deleted those files as soon as i found them but they probably have been there for some time.

What should i do to protect myself from it?

I also looked into it more. The upload folder also contains files that i have not allowed, there are some html files and some image files with extensions i have not allowed. How can that be when i validate all my uploads?

EDIT: I researched it more... It seems that the original file names saved for those *.bin files are docx... SO it seems the files have been uploaded as those files... So how they became .bin files?

I saved them like this:

$request->uploadfile->store('profile')
0 likes
0 replies

Please or to participate in this conversation.