Project

General

Profile

Actions

Feature #43484

open

Detect attachment content type from file contents instead of trusting client-provided values

Added by Go MAEDA 3 days ago. Updated 2 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Attachments
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Redmine currently stores the content type of uploaded files based on the value provided by the client, such as web browsers and API clients. This approach is not reliable and can lead to incorrect or misleading MIME types, especially when the client declares a spoofed or incorrect type.

According to the OWASP File Upload Cheat Sheet, the Content-Type header for uploaded files cannot be trusted, because it is easy to spoof.

The attached patch changes the behavior so that Redmine no longer trusts the client-provided content type. Instead, it detects the content type by inspecting the actual file contents using Marcel.


Files


Related issues

Related to Redmine - Feature #43473: Reject file uploads when actual MIME type does not match the file extensionNew

Actions
Actions

Also available in: Atom PDF