form-data Boundary Value Prediction Vulnerability Allowing HTTP Parameter Pollution

Vulnerability

A vulnerability in the form-data package, specifically in versions prior to 2.5.4, 3.0.0 through 3.0.3, and 4.0.0 through 4.0.3, allows for HTTP Parameter Pollution (HPP) due to the use of insufficiently random values. The vulnerability arises because form-data uses Math.random() to generate boundary values for multipart form data. This can be exploited by an attacker who can predict the output of Math.random() and inject additional parameters into the request by crafting a payload that includes a predicted boundary value.

Impact

Exploitation of this vulnerability could lead to arbitrary requests being made to internal systems, potentially allowing for unauthorized actions or access.

Reproduction

To reproduce this vulnerability, observe the output of Math.random() in the target application to predict future values. Then, use form-data to send a request that includes a crafted boundary value based on the predicted output. This can be done by injecting the boundary value into a field of the request, which may overwrite or append to existing parameters, depending on how the server handles multipart data.

Remediation

Users can update to form-data versions 4.0.4, 3.0.4, or 2.5.4, which have patched this vulnerability.

Added: Jul 18, 2025, 5:20 PM
Updated: Jul 18, 2025, 5:20 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
0.6
exploitability
8.7
remediation
7.7
relevance
0.3
threat
6.4
urgency
2.9
incentive
5.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.