Fix 4 critical security vulnerabilities in multer by upgrading to v2.0.2 #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses 4 security vulnerabilities (1 CRITICAL, 3 HIGH) in the
multerpackage by upgrading from version 1.4.4 to 2.0.2.Security Vulnerabilities Resolved
1. CVE-2025-7338 (CRITICAL) - Uncaught Exception in makeMiddleware
2. CVE-2025-47944 (HIGH) - Uncaught Exception from busboy
errorevents thrown by busboy during multipart upload processing3. CVE-2025-47935 (HIGH) - Memory Leak
4. Additional Uncaught Exception (HIGH)
Changes Made
multerfrom^1.4.3to^2.0.2Testing & Verification
✅ Server starts successfully with multer 2.0.2
✅ File upload functionality works correctly
✅ No breaking changes - API is backward compatible
✅ All 4 security vulnerabilities confirmed resolved
✅ GitHub Advisory Database reports no vulnerabilities in [email protected]
Compatibility Notes
The upgrade from multer 1.x to 2.0.2 requires Node.js 10.16.0 or higher. The current environment is running Node.js 20.19.5, which exceeds this requirement.
The multer 2.x API is backward compatible with the existing code - no changes to
server/app.jswere required.References
Fixes #[issue number]
Original prompt
This section details on the original issue you should resolve
<issue_title>Security Vulnerability Scan - 2025-10-15 - 4 vulnerabilities found</issue_title>
<issue_description># Security Vulnerability Analysis Report
Repository: denukedissanayake/ai-bug-fix
Scan Date: 2025-10-15T21:26:00.607Z
Workflow Run: 18543101954
Total Vulnerabilities: 4
Detected Vulnerabilities
Uncaught Exception in [email protected] (HIGH)
Package:
[email protected]CVE ID: SNYK-JS-MULTER-10185673
CVSS Score: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:P
Fixed In:
No direct fix availableUpgradable: true
Patchable: false
Dependency Path: [email protected] → [email protected]
Description: ## Overview
Affected versions of this package are vulnerable to Uncaught Exception due to an
errorevent thrown bybusboy. An attacker can cause a full nodejs application to crash by sending a specially crafted multi-part upload request.PoC
Remediation
Upgrade
multerto version 2.0.0 or higher.References
Fix Command Needed:
Missing Release of Memory after Effective Lifetime in [email protected] (HIGH)
Package:
[email protected]CVE ID: SNYK-JS-MULTER-10185675
CVSS Score: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fixed In:
No direct fix availableUpgradable: true
Patchable: false
Dependency Path: [email protected] → [email protected]
Description: ## Overview
Affected versions of this package are vulnerable to Missing Release of Memory after Effective Lifetime due to improper handling of error events in HTTP request streams, which fails to close the internal
busboystream. An attacker can cause a denial of service by repeatedly triggering errors in file upload streams, leading to resource exhaustion and memory leaks.Note:
This is only exploitable if the server is handling file uploads.
Remediation
Upgrade
multerto version 2.0.0 or higher.References
Fix Command Needed:
Uncaught Exception in [email protected] (CRITICAL)
Package:
[email protected]CVE ID: SNYK-JS-MULTER-10299078
CVSS Score: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H
Fixed In:
No direct fix availableUpgradable: true
Patchable: false
Dependency Path: [email protected] → [email protected]
Description: ## Overview
Affected versions of this package are vulnerable to Uncaught Exception in
makeMiddleware, when processing a file upload request. An attacker can cause the application to crash by sending a request with a field name containing an empty string.Remediation
Upgrade
multerto version 2.0.1 or higher.References
Fix Command Needed:
Uncaught Exception in [email protected] (HIGH)
Package:
[email protected]CVE ID: SNYK-JS-MULTER-10773732
CVSS Score: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Fixed In:
No direct fix availableUpgradable: true
Patchable: false
Dependency Path: [email protected] → [email protected]
Description: ## Overview
Affected versions of this package are vulnerable to Uncaught Exception due to improper handling of multipart requests. An attacker can cause the application to ...
Fixes #103
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.