Cyber Security News

Critical JavaScript Library Vulnerability Exposes Apps to Remote Attacks

A critical security vulnerability has been discovered in the widely-used form-data JavaScript package, potentially exposing thousands of applications to remote attacks through predictable boundary value generation.

The vulnerability, designated as CVE-2025-7783, was published five days ago by Jordan Harband (ljharb), a prominent JavaScript developer and former TC39 specification editor.

Vulnerability Overview

The security flaw stems from form-data’s reliance on JavaScript’s Math.random() function to generate boundary values for multipart form-encoded data.

This seemingly innocuous design choice creates a critical security weakness because Math.random() produces pseudo-random, predictable values that sophisticated attackers can exploit to inject malicious parameters into HTTP requests.

AttributeValue
CVE IDCVE-2025-7783
SeverityCritical
CVSS 4.0 ScoreCVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:H/SI:H/SA:N
CWE ClassificationCWE-330 (Use of Insufficiently Random Values)
Affected Packageform-data (npm)
Vulnerable Versions< 2.5.4, 3.0.0-3.0.3, 4.0.0-4.0.3
Patched Versions2.5.4, 3.0.4, 4.0.4
Attack VectorNetwork
Attack ComplexityHigh

The vulnerability affects multiple versions of the form-data package, including all versions prior to 2.5.4, versions 3.0.0 through 3.0.3, and versions 4.0.0 through 4.0.3.

Organizations using these versions face immediate risk of parameter injection attacks that could compromise internal systems and expose sensitive data.

Attackers can exploit this vulnerability by observing Math.random() values generated by target applications and using mathematical techniques to predict the pseudo-random number generator’s internal state.

Once the PRNG state is determined, attackers can forecast future boundary values and craft malicious payloads containing predicted boundaries followed by attacker-controlled fields.

The attack scenario requires two conditions: the attacker must observe other Math.random() values produced by the target application, and they must control at least one field in a form-data request.

Common observation vectors include request ID headers used for distributed tracing, which frequently employ Math.random() for generation.

Applications become vulnerable when they use form-data to transmit user-controlled data to backend systems while simultaneously revealing Math.random() values through various channels.

Successful exploitation allows attackers to inject arbitrary parameters into requests, potentially overwriting intended values or adding malicious data that bypasses security controls.

The vulnerability received a critical CVSS 4.0 rating due to its network-based attack vector and potential for high impact on both confidential data and system integrity.

Security researchers have developed proof-of-concept exploits demonstrating practical exploitation scenarios.

Organizations must immediately upgrade to patched versions: 2.5.4, 3.0.4, or 4.0.4, depending on their current implementation.

The patches replace Math.random() with cryptographically secure random number generation, eliminating the predictability that enables these attacks.

Get Free Ultimate SOC Requirements Checklist Before you build, buy, or switch your SOC for 2025 - Download Now

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

2 days ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

2 days ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

2 days ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

2 days ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

2 days ago