-
-
Notifications
You must be signed in to change notification settings - Fork 692
Open
Labels
Area: filesThings related to handling files, names, etc.Things related to handling files, names, etc.Priority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After critical issues are fixed, these should be dealt with before any further issues.Status: AcceptedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: EnhancementMost issues will probably be for additions or changes. Expected that this will result in a PR.Most issues will probably be for additions or changes. Expected that this will result in a PR.
Description
Support plan
- which support plan is this issue covered by? (e.g. Community, Sponsor, or
Enterprise): Community - is this issue currently blocking your project? (yes/no): no
- is this issue affecting a production system? (yes/no): yes
Context
- node version: 16.4.2
- module (formidable) version: 3.0.0-canary.20210428
- environment (e.g. node, browser, native, OS): Node.js
- used with (i.e. popular names of modules):
- any other relevant information:
Formidable detects MIME-type according to the file extension and not by the real content. Which means that user can fake the file MIME by changing file's extension and as a result to upload to the server not allowed file types.
BTW, multer detects file's MIME not by the extension only.
What are you trying to achieve or the steps to reproduce?
- Given JPG file
tst.jpg - Rename it to
tst.pdf - Set a break point inside of
uploader.parse(req, async (err, fields, files) => {…} - Try to upload
tst.pdf
uploader.parse(req, async (err, fields, files) => {
if (err) {
reject(err);
} else {…}
});What was the result you got?
mimetype = application/pdf
What result did you expect?
mimetype = image/jpeg
Since this file is actually JPG file but with a from extension.
GrosSacASac and ajmeese7
Metadata
Metadata
Assignees
Labels
Area: filesThings related to handling files, names, etc.Things related to handling files, names, etc.Priority: HighAfter critical issues are fixed, these should be dealt with before any further issues.After critical issues are fixed, these should be dealt with before any further issues.Status: AcceptedIt's clear what the subject of the issue is about, and what the resolution should be.It's clear what the subject of the issue is about, and what the resolution should be.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: EnhancementMost issues will probably be for additions or changes. Expected that this will result in a PR.Most issues will probably be for additions or changes. Expected that this will result in a PR.
