Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. form-data
  4. ›
  5. CVE-2025-7783

CVE-2025-7783: form-data uses unsafe random function in form-data for choosing boundary

July 21, 2025 (updated November 10, 2025)

form-data uses Math.random() to select a boundary value for multipart form-encoded data. This can lead to a security issue if an attacker:

  1. can observe other values produced by Math.random in the target application, and
  2. can control one field of a request made using form-data

Because the values of Math.random() are pseudo-random and predictable (see: https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f), an attacker who can observe a few sequential values can determine the state of the PRNG and predict future values, includes those used to generate form-data’s boundary value. The allows the attacker to craft a value that contains a boundary value, allowing them to inject additional parameters into the request.

This is largely the same vulnerability as was recently found in undici by parrot409 – I’m not affiliated with that researcher but want to give credit where credit is due! My PoC is largely based on their work.

References

  • github.com/advisories/GHSA-fjxv-7rqg-78g4
  • github.com/benweissmann/CVE-2025-7783-poc
  • github.com/form-data/form-data
  • github.com/form-data/form-data/commit/3d1723080e6577a66f17f163ecd345a21d8d0fd0
  • github.com/form-data/form-data/security/advisories/GHSA-fjxv-7rqg-78g4
  • nvd.nist.gov/vuln/detail/CVE-2025-7783

Code Behaviors & Features

Detect and mitigate CVE-2025-7783 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 2.5.4, all versions starting from 3.0.0 before 3.0.4, all versions starting from 4.0.0 before 4.0.4

Fixed versions

  • 2.5.4
  • 3.0.4
  • 4.0.4

Solution

Upgrade to versions 2.5.4, 3.0.4, 4.0.4 or above.

Impact 8.7 HIGH

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-330: Use of Insufficiently Random Values

Source file

npm/form-data/CVE-2025-7783.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:34 +0000.