π§ Summary
Item | Details |
---|---|
Vulnerability ID | CVE-2022-24434 |
Impact Range | Indirect: dicer β busboy β multer |
Severity | High (DoS - Denial of Service) |
Fixed Version | multer@1.4.4-lts.1 |
Release Date | May 29, 2022 |
Minimum Node.js Version | β₯ 6.0.0 |
Mitigation Summary | Avoid or remove the vulnerable dicer via dependency upgrade (busboy) |
𧨠Vulnerability Overview
- Attack Vector: Crafted
multipart/form-data
header with whitespace/tab prefix causes server crash - Affected Code:
HeaderParser.prototype._parseHeader()
inside Dicer - Report Date: May 20, 2022 (NVD Link)
Express β Multer β Busboy β Dicer (vulnerable layer)
π§ Patch Details
β Multer 1.4.4-lts.1
- Uses
busboy
1.6.0+ to avoid vulnerabledicer
- Adopted by NestJS (PR #9686)
β οΈ No Official Patch from Dicer
- PR exists: #22
- Not merged or released β still vulnerable
π¦ Dependency Chain Analysis
Package | Vulnerable? | Patched? | Notes |
---|---|---|---|
Multer | Indirect | β 1.4.4-lts.1 | Includes updated busboy |
Busboy | Indirect | β β₯ 1.6.0 | Likely avoids or removes dicer |
Dicer | Direct | β No | PR only, no release |
π Mitigation Guide
1οΈβ£ Upgrade Node.js
- Minimum: v6.0.0
- Recommended: v14 or higher
2οΈβ£ Upgrade Multer
npm install multer@1.4.4-lts.1
Or in package.json:
"dependencies": {
"multer": "^1.4.4-lts.1"
}
3οΈβ£ Use npm Overrides (npm β₯ 8.3.0)
"overrides": {
"multer": "^1.4.4-lts.1"
}
4οΈβ£ Apply Manual Patch (if no official fix)
Patch dicer using patch-package
npm install patch-package --save-dev
In package.json:
"scripts": {
"postinstall": "patch-package"
}
Edit node_modules/dicer/lib/Dicer.js
:
@@ -124,7 +124,11 @@
this._bparser.on('info', function(isMatch, data, start, end) {
- self._oninfo(isMatch, data, start, end);
+ try {
+ self._oninfo(isMatch, data, start, end);
+ } catch (e) {
+ self.emit('error', e);
+ }
});
Then:
npx patch-package dicer
β οΈ This is a temporary workaround, not an official fix. You’ll need to reapply the patch if Dicer’s version changes.
π Long-Term Considerations
dicer
is poorly maintained and lacks official updates- Consider switching to alternatives like
@fastify/busboy
orfastify-multipart
π References
- π CVE-2022-24434 (NVD)
- π¦ Multer GitHub Releases
- π Dicer PR #22
- β NestJS PR #9686
- π§ͺ Snyk Report for Multer
- π Stack Overflow Discussion
β Conclusion
Multer@1.4.4-lts.1
provides an indirect fix for CVE-2022-24434- On Node.js β₯6, upgrading Multer may be sufficient
- In the long run, plan for dependency removal or structural replacement