[Security] Bump form-data and @kubernetes/client-node

Bumps form-data to 4.0.4 and updates ancestor dependency @kubernetes/client-node. These dependencies need to be updated together.

Updates form-data from 2.3.3 to 4.0.4 This update includes a security fix.

Vulnerabilities fixed

form-data uses unsafe random function in form-data for choosing boundary

Summary

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.

Details

The culprit is this line here: https://github.com/form-data/form-data/blob/426ba9ac440f95d1998dac9a5cd8d738043b048f/lib/form_data.js#L347

An attacker who is able to predict the output of Math.random() can predict this boundary value, and craft a payload that contains the boundary value, followed by another, fully attacker-controlled field. This is roughly equivalent to any sort of improper escaping vulnerability, with the caveat that the attacker must find a way to observe other Math.random() values generated by the application to solve for the state of the PRNG. However, Math.random() is used in all sorts of places that might be visible to an attacker (including by form-data itself, if the attacker can arrange for the vulnerable application to make a request to an attacker-controlled server using form-data, such as a user-controlled webhook -- the attacker could observe the boundary values from those requests to observe the Math.random() outputs). A common example would be a x-request-id header added by the server. These sorts of headers are often used for distributed tracing, to correlate errors across the frontend and backend. Math.random() is a fine place to get these sorts of IDs (in fact, opentelemetry uses Math.random for this purpose)

PoC

PoC here: https://github.com/benweissmann/CVE-2025-7783-poc

... (truncated)

Patched versions: 4.0.4; 3.0.4; 2.5.4 Affected versions: >= 4.0.0, = 3.0.0, < 3.0.4; < 2.5.4

Release notes

Sourced from form-data's releases.

v4.0.1

Fixes

  • npmignore temporary build files (#532)
  • move util.isArray to Array.isArray (#564)

Tests

  • migrate from travis to GHA

v4.0.0

  • Merge pull request #382 from wxt2005/custom-stream 8968e01
  • Fix typo e705c0a
  • Merge branch &#39;master&#39; of github.com:form-data/form-data into custom-stream b7b7dee
  • Update README for custom stream behavior 6dd8624
  • Handle custom stream a3e191d

https://github.com/form-data/form-data/compare/v3.0.1...v4.0.0

v3.0.2

Fixes

  • npmignore temporary build files (#532)
  • move util.isArray to Array.isArray (#564)

Tests

  • migrate from travis to GHA

v3.0.1

  • feat: add setBoundary method 55d90ce
  • Merge pull request #451 from arku/patch-1 d702625
  • Fix typo: ads -> adds 714ac8b

https://github.com/form-data/form-data/compare/v3.0.0...v3.0.1

v2.5.2

Fixes

  • Buffer.from and Buffer.alloc require node 4+
  • npmignore temporary build files (#532)
  • move util.isArray to Array.isArray (#564)

Tests

  • migrate from travis to GHA

Dev Improvements

  • Fixed error in the documentations as indicated in #439
  • Added remaining combined-stream options to typedef
  • Bumped rimraf to 2.7.1 (dev-dep)
  • Added constructor options to TypeScript defs
  • Fixed error in callback signatures

Added Types

  • Added TS types

... (truncated)

Changelog

Sourced from form-data's changelog.

v4.0.4 - 2025-07-16

Commits

  • [meta] add auto-changelog 811f682
  • [Tests] handle predict-v8-randomness failures in node < 17 and node > 23 1d11a76
  • [Fix] Switch to using crypto random for boundary values 3d17230
  • [Tests] fix linting errors 5e34080
  • [meta] actually ensure the readme backup isn’t published 316c82b
  • [Dev Deps] update @ljharb/eslint-config 58c25d7
  • [meta] fix readme capitalization 2300ca1

v4.0.3 - 2025-06-05

Fixed

Commits

  • [eslint] use a shared config 426ba9a
  • [eslint] fix some spacing issues 2094191
  • [Refactor] use hasown 81ab41b
  • [Fix] validate boundary type in setBoundary() method 8d8e469
  • [Tests] add tests to check the behavior of getBoundary with non-strings 837b8a1
  • [Dev Deps] remove unused deps 870e4e6
  • [meta] remove local commit hooks e6e83cc
  • [Dev Deps] update eslint 4066fd6
  • [meta] fix scripts to use prepublishOnly c4bbb13

v4.0.2 - 2025-02-14

Merged

Fixed

Commits

  • Merge tags v2.5.3 and v3.0.3 92613b9
  • [Tests] migrate from travis to GHA 806eda7
  • [Tests] migrate from travis to GHA 8fdb3bc

... (truncated)

Commits
Maintainer changes

This version was pushed to npm by ljharb, a new releaser for form-data since your current version.


Updates @kubernetes/client-node from 0.22.3 to 1.3.0

Release notes

Sourced from @​kubernetes/client-node's releases.

1.3.0

What's Changed

Full Changelog: https://github.com/kubernetes-client/javascript/compare/1.2.0...1.3.0

1.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/kubernetes-client/javascript/compare/1.1.2...1.2.0

1.1.2

What's Changed between 1.0.0 and 1.1.2

... (truncated)

Commits
  • 940af26 Merge pull request #2457 from kubernetes-client/dependabot/npm_and_yarn/main/...
  • 5dad6d3 Merge pull request #2456 from kubernetes-client/dependabot/npm_and_yarn/main/...
  • 55e1a8a build(deps-dev): bump typescript-eslint from 8.32.1 to 8.33.0
  • adf25e2 build(deps): bump @​types/node from 22.15.21 to 22.15.23
  • 2ed3379 Merge pull request #2454 from cjihrig/bump
  • 4846def update package versions in preparation for release
  • f809c36 Merge pull request #2452 from kubernetes-client/dependabot/npm_and_yarn/main/...
  • 52c1acf build(deps-dev): bump typedoc from 0.28.4 to 0.28.5
  • 1fcb3a6 Merge pull request #2447 from kubernetes-client/dependabot/npm_and_yarn/main/...
  • affa86a build(deps): bump tar-fs from 3.0.8 to 3.0.9
  • Additional commits viewable in compare view


Dependabot commands
You can trigger Dependabot actions by commenting on this MR
  • $dependabot recreate will recreate this MR rewriting all the manual changes and resolving conflicts

Merge request reports

Loading