Sunday, January 18, 2026

Severe Vulnerability in JavaScript Library Puts Millions of Apps at Risk of Code Execution Attacks

A critical security vulnerability in the widely-used form-data JavaScript library has been disclosed, potentially exposing millions of applications to sophisticated code injection attacks.

The vulnerability, tracked as CVE-2025-7783 and published by prominent JavaScript developer Jordan Harband, exploits predictable random number generation to allow attackers to manipulate multipart form data and execute unauthorized code on target systems.

The vulnerability stems from form-data’s reliance on JavaScript’s Math.random() function to generate boundary values for multipart form-encoded data, a common method for handling file uploads and complex form submissions in web applications.

Security researchers have long warned that Math.random() produces pseudo-random values that can be predicted by attackers who observe sequential outputs from the same random number generator.

The specific issue lies in a single line of code within the library where boundary values are created using “Math.floor(Math.random() * 10).toString(16)”.

This predictable pattern allows sophisticated attackers to determine the internal state of the random number generator and forecast future boundary values.

Once an attacker can predict these boundaries, they can craft malicious payloads that inject additional parameters into form submissions, potentially overriding intended values or adding unauthorized data to requests sent to backend systems.

The vulnerability mirrors a similar vulnerability recently discovered in the undici HTTP client library, suggesting a broader pattern of insecure random number usage across the JavaScript ecosystem.

Jordan Harband, JavaScript specification editor, credited security researcher parrot409 for the original discovery technique while adapting the proof-of-concept for the form-data library.

Severe Vulnerability in JavaScript Library

The form-data library is extensively used throughout the JavaScript ecosystem, making this vulnerability particularly concerning for enterprise applications and web services that handle user-generated content.

Applications become vulnerable when they use form-data to process user-controlled data and simultaneously expose Math.random() values through other application features, such as request IDs in headers or session tokens visible to attackers.

For successful exploitation, attackers need two conditions: the ability to observe multiple Math.random() values from the target application and control over at least one field in a form-data request.

Common attack vectors include analyzing randomly-generated request IDs used for distributed tracing, session identifiers, or boundary values from previous form submissions made to attacker-controlled servers through webhooks or similar mechanisms.

The vulnerability carries a high CVSS v4 score due to its potential for complete system compromise, allowing attackers to make arbitrary requests to internal systems and potentially access sensitive data or execute unauthorized operations.

The attack’s network-based nature and lack of required user interaction make it particularly dangerous for automated exploitation.

Immediate Patching Required

Developers using the form-data library must immediately update to patched versions to mitigate this critical vulnerability.

The affected versions include all releases prior to 2.5.4, versions 3.0.0 through 3.0.3, and versions 4.0.0 through 4.0.3.

The security fixes are available in versions 4.0.4, 3.0.4, and 2.5.4, depending on the major version currently in use.

Organizations should prioritize this update as part of their emergency security maintenance procedures, particularly for applications that handle sensitive data or operate in environments where Math.random() values might be observable to potential attackers through logging, monitoring systems, or user-facing interfaces.

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.

Ethan Brooks
Ethan Brooks
Ethan Brooks is a Senior cybersecurity journalist passionate about threat intelligence and data privacy. His work highlights cyber attacks, hacking, security culture, and cybercrime with The Cyber News.

Recent News

Recent News