CWE-646
Description
The product allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors.
This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion, causing the wrong action to occur.
Consequences
If an attacker can provide a file that is treated as executable, then code execution might be possible. For example, in a web application, an attacker could supply a file that ends in a ".php.gif" extension that appears to be a GIF image, but would be processed as PHP code by the server.
An attacker may be able to read sensitive data, e.g., exposure of debug or system data (including application source code)
An attacker may be able to cause a denial of service.
An attacker may be able to gain privileges.
Mitigations
Make decisions on the server side based on file content and not on file name or extension.