CVE-2021-23597

7.5 HIGH

📋 TL;DR

This vulnerability in fastify-multipart allows attackers to crash Node.js applications by sending multipart form data with a 'name=constructor' property. It affects applications using fastify-multipart versions before 5.3.1. This is a bypass of the previous CVE-2020-8136 fix.

💻 Affected Systems

Products:
  • fastify-multipart
Versions: All versions before 5.3.1
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Affects any application using fastify-multipart for file uploads or multipart form processing

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Application denial of service causing complete unavailability of the service

🟠

Likely Case

Application crashes leading to service disruption and potential data loss in active sessions

🟢

If Mitigated

No impact if patched or proper input validation is implemented

🌐 Internet-Facing: HIGH - Exploitation requires only HTTP request, no authentication needed
🏢 Internal Only: MEDIUM - Internal attackers could still cause service disruption

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Simple HTTP request with crafted multipart data can trigger the crash

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 5.3.1

Vendor Advisory: https://github.com/fastify/fastify-multipart/releases/tag/v5.3.1

Restart Required: Yes

Instructions:

1. Update package.json to require 'fastify-multipart': '^5.3.1' 2. Run 'npm update fastify-multipart' or 'yarn upgrade fastify-multipart' 3. Restart the Node.js application

🔧 Temporary Workarounds

Input validation middleware

all

Add middleware to reject requests with 'name=constructor' in multipart data

🧯 If You Can't Patch

  • Implement WAF rules to block requests with 'name=constructor' in multipart/form-data
  • Use reverse proxy to filter malicious requests before they reach the application

🔍 How to Verify

Check if Vulnerable:

Check package.json or node_modules for fastify-multipart version <5.3.1

Check Version:

npm list fastify-multipart

Verify Fix Applied:

Verify fastify-multipart version is 5.3.1 or higher in package.json and node_modules

📡 Detection & Monitoring

Log Indicators:

  • Application crash logs
  • Unhandled exception errors mentioning 'constructor'
  • Process termination without normal shutdown

Network Indicators:

  • HTTP POST requests with multipart/form-data containing 'name=constructor'

SIEM Query:

http.method:POST AND http.content_type:'multipart/form-data' AND http.body:'name=constructor'

🔗 References

📤 Share & Export