Skip to content
Heist/ feed
Back to feed
Medium

Undici Uses Insufficiently Random Values

Type: advisorySources: OSV

Undici is an HTTP/1.1 client. Starting in version 4.5.0 and prior to versions 5.28.5, 6.21.1, and 7.2.3, undici uses `Math.random()` to choose the boundary for a multipart/form-data request. It is known that the output of `Math.random()` can be predicted if several of its generated values are known. If there is a mechanism in an app that sends multipart requests to an attacker-controlled website, they can use this to leak the necessary values. Therefore, an attacker can tamper with the requests going to the backend APIs if certain conditions are met. This is fixed in versions 5.28.5, 6.21.1, and 7.2.3. As a workaround, do not issue multipart requests to attacker controlled servers.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2025-22150
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 17:54 UTC · Revision 1

Source evidence

Undici Uses Insufficiently Random Values

core-osv · Original source

Published 21 Jan 2025, 17:46 UTC

Undici is an HTTP/1.1 client. Starting in version 4.5.0 and prior to versions 5.28.5, 6.21.1, and 7.2.3, undici uses `Math.random()` to choose the boundary for a multipart/form-data request. It is known that the output of `Math.random()` can be predicted if several of its generated values are known. If there is a mechanism in an app that sends multipart requests to an attacker-controlled website, they can use this to leak the necessary values. Therefore, an attacker can tamper with the requests going to the backend APIs if certain conditions are met. This is fixed in versions 5.28.5, 6.21.1, and 7.2.3. As a workaround, do not issue multipart requests to attacker controlled servers.

osv:CVE-2025-22150
Complete source record
{
  "id": "0a0451ec61787db11eaa7c5667cce42ab8d095d437859557052da309ed7c18fa",
  "url": "https://osv.dev/vulnerability/CVE-2025-22150",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Undici Uses Insufficiently Random Values",
    "summary": "Undici is an HTTP/1.1 client. Starting in version 4.5.0 and prior to versions 5.28.5, 6.21.1, and 7.2.3, undici uses `Math.random()` to choose the boundary for a multipart/form-data request. It is known that the output of `Math.random()` can be predicted if several of its generated values are known. If there is a mechanism in an app that sends multipart requests to an attacker-controlled website, they can use this to leak the necessary values. Therefore, an attacker can tamper with the requests going to the backend APIs if certain conditions are met. This is fixed in versions 5.28.5, 6.21.1, and 7.2.3. As a workaround, do not issue multipart requests to attacker controlled servers.",
    "evidence": "osv:CVE-2025-22150",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2025-22150",
      "aliases": [
        "CVE-2025-22150",
        "GHSA-c76h-2ccp-4975"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/nodejs/undici",
              "type": "GIT",
              "events": [
                {
                  "introduced": "88403c00140c517c8cfd3590993c02b191fe844f"
                },
                {
                  "fixed": "6139ed2e0c787853243de58ef7c4301b26ca66f2"
                },
                {
                  "introduced": "e218fc61eda46da8784e0cedcaa88cd7e84dee99"
                },
                {
                  "fixed": "e260e7bb173abe3399dabd61338ca4a71fcf8825"
                },
                {
                  "introduced": "1cfe0949053aac6267f11b919cee9315a27f1fd6"
                },
                {
                  "fixed": "83537aa55028bfeef5dd9504abfde63264c2df5d"
                },
                {
                  "fixed": "711e20772764c29f6622ddc937c63b6eefdf07d0"
                },
                {
                  "fixed": "c2d78cd19fe4f4c621424491e26ce299e65e934a"
                },
                {
                  "fixed": "c3acc6050b781b827d80c86cbbab34f14458d385"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "4.5.0"
                      },
                      {
                        "fixed": "5.28.5"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "6.0.0"
                      },
                      {
                        "fixed": "6.21.1"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "7.0.0"
                      },
                      {
                        "fixed": "7.2.3"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "711e20772764c29f6622ddc937c63b6eefdf07d0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c2d78cd19fe4f4c621424491e26ce299e65e934a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c3acc6050b781b827d80c86cbbab34f14458d385"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v5.28.4",
            "v7.2.2",
            "v7.2.1",
            "v7.2.0",
            "v7.1.1",
            "v7.1.0",
            "v7.0.0",
            "v6.21.0",
            "v6.20.1",
            "v6.20.0",
            "v6.19.8",
            "v6.19.7",
            "v6.19.6",
            "v6.19.5",
            "v6.19.4",
            "v6.19.3",
            "v6.19.2",
            "v6.19.1",
            "v6.19.0",
            "v6.18.2",
            "v6.18.1",
            "v6.18.0",
            "v6.17.0",
            "v6.16.1",
            "v6.16.0",
            "v6.15.0",
            "v6.14.1",
            "v6.14.0",
            "v6.13.0",
            "v6.12.0",
            "v6.11.1",
            "v6.11.0",
            "v6.10.2",
            "v6.10.1",
            "v6.10.0",
            "v6.9.0",
            "v6.8.0",
            "v6.7.1",
            "v6.7.0",
            "v6.6.2",
            "v6.6.1",
            "v5.28.3",
            "v5.28.2",
            "v6.6.0",
            "v6.5.0",
            "v6.4.0",
            "v6.3.0",
            "v6.2.1",
            "v6.2.0",
            "v6.1.0",
            "v6.0.1",
            "v6.0.0",
            "v5.28.1",
            "v5.28.0",
            "v5.27.2",
            "v5.27.1",
            "v5.27.0",
            "v5.26.5",
            "v5.26.4",
            "v5.26.3",
            "v5.26.2",
            "v5.26.1",
            "v5.26.0",
            "v5.23.4",
            "v5.25.3",
            "v5.25.2",
            "v5.25.1",
            "v5.25.0",
            "v5.24.0",
            "v5.23.0",
            "v5.22.1",
            "v5.22.0",
            "v5.21.2",
            "v5.21.1",
            "v5.21.0",
            "v5.20.0",
            "v5.19.1",
            "v5.19.0",
            "v5.18.0",
            "v5.17.1",
            "v5.17.0",
            "v5.16.0",
            "v5.15.2",
            "v5.15.1",
            "v5.15.0",
            "v5.14.0",
            "v5.13.0",
            "v5.12.0",
            "v5.11.0",
            "v5.10.0",
            "v5.9.1",
            "v5.8.2",
            "v5.8.1",
            "v5.8.0",
            "v5.7.0",
            "v5.6.1",
            "v5.6.0",
            "v5.5.1",
            "v5.5.0",
            "v5.4.0",
            "v5.3.0",
            "v5.2.0",
            "v5.1.1",
            "v5.1.0",
            "v5.0.0",
            "v4.16.0",
            "v4.15.1",
            "v4.15.0",
            "v4.14.1",
            "v4.14.0",
            "v4.13.0",
            "v4.12.2",
            "v4.12.0",
            "v4.11.3",
            "v4.11.2",
            "v4.11.1",
            "v4.11.0",
            "v4.10.4",
            "v4.10.3",
            "v4.10.2",
            "v4.10.1",
            "v4.10.0",
            "v4.9.5",
            "v4.9.4",
            "v4.9.3",
            "v4.9.2",
            "v4.9.1",
            "v4.9.0",
            "v4.8.2",
            "v4.8.1",
            "v4.8.0",
            "v4.7.3",
            "v4.7.2",
            "v4.7.1",
            "v4.7.0",
            "v4.6.0",
            "v4.5.1",
            "v4.5.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-22150.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:31.002843786Z",
      "provider": "osv",
      "references": [
        "https://github.com/nodejs/undici/blob/8b06b8250907d92fead664b3368f1d2aa27c1f35/lib/web/fetch/body.js#L113",
        "https://hackerone.com/reports/2913312",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/22xxx/CVE-2025-22150.json",
        "https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-22150",
        "https://github.com/nodejs/undici/commit/711e20772764c29f6622ddc937c63b6eefdf07d0",
        "https://github.com/nodejs/undici/commit/c2d78cd19fe4f4c621424491e26ce299e65e934a",
        "https://github.com/nodejs/undici/commit/c3acc6050b781b827d80c86cbbab34f14458d385",
        "https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-330"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/22xxx/CVE-2025-22150.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-22150",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 498052,
  "published_at": "2025-01-21T17:46:58.872+00:00"
}