CVE-2018-9206: Unrestricted Upload of File with Dangerous Type in blueimp-file-upload
Summary
CVE-2018-9206: Unrestricted Upload of File with Dangerous Type in blueimp-file-upload. Affects blueimp-file-upload versions < 9.22.1. Fixed in 9.22.1. How to fix ↓
Also tracked for
- libjs-jquery-file-upload · Debian:11
The same CVE-2018-9206 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The blueimp-file-upload package is an npm package that provides a file upload functionality for web applications using jQuery. It allows users to upload files to a server, and it is commonly used in various web applications. However, versions of the package up to v9.22.0 are vulnerable to an unauthenticated arbitrary file upload vulnerability.
Vulnerability Detail
The vulnerability in blueimp-file-upload allows an attacker to upload arbitrary files to the server without any authentication. This can lead to various security issues, such as remote code execution, unauthorized access to sensitive files, or denial of service attacks. The vulnerability is caused by a lack of proper validation and filtering of file types during the upload process. As a result, an attacker can upload files with dangerous types, such as executable files or scripts, which can be executed on the server.
How To Fix
Minimum fixed version
9.22.1
This is the first release that contains the fix.
npm install blueimp-file-upload@9.22.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the package is not immediately possible, a temporary workaround is to disable file uploads or implement additional security measures, such as file type validation and filtering, on the server-side. Here is an example of how to implement file type validation in Node.js using the mime-types package:
const mime = require('mime-types');
function validateFileType(file) {
const allowedTypes = ['image/jpeg', 'image/png', 'application/pdf'];
const fileType = mime.lookup(file.name);
if (!allowedTypes.includes(fileType)) {
throw new Error('Invalid file type');
}
}
Conclusion
The blueimp-file-upload package up to version 9.22.0 is vulnerable to an unauthenticated arbitrary file upload issue. This can lead to severe security risks, including remote code execution and unauthorized access to sensitive files. It is crucial to update the package to version 9.22.1 or later and implement proper file type validation and filtering to mitigate the risk. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for blueimp-file-upload →
FAQ
The vulnerability allows an attacker to upload arbitrary files to the server, which can lead to remote code execution, unauthorized access to sensitive files, or denial of service attacks.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities using package-lock.json.
No, authentication is not required. The vulnerability allows unauthenticated attackers to upload arbitrary files to the server.
The recommended mitigation is to update the blueimp-file-upload package to version 9.22.1 or later. Additionally, implementing proper file type validation and filtering on the server-side can help mitigate the risk.
Yes, the CVSS score for this vulnerability is 9.8, indicating a critical severity.