vendredi 4 mars 2016

Laravel validation misinterpreting mp3 and mp4 as bin or application/octet-stream

At work we are using Laravel 5, and we are near the end of completing a project. Within the last week we have suddenly encountered a site breaking issue. The site we are working on allows users to upload various file types to the site which are then manipulated and stored on S3.

Among those filetypes; JPG, PDF, and several others are working. Whenever a request is submitted with an MP3 attached however, the request is refused because Laravel (or maybe PHP or Apache) detects it as being a binary or octect. I have verified this by returning the getMimeType() output and verified that this is the point of failure by simply deleting or adding the mime validation rules.

Letting binary files through seems like a huge security risk, but at the same time this is a critical feature of the project. This issue has only presented itself in the last in the last week, and there are no code changes in git that suggest something was changed regarding validation.

How can I let MP3/MP4 files through validation without letting binaries in as well?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TVeS0b
via IFTTT

Aucun commentaire:

Enregistrer un commentaire