[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:
- can observe other values produced by Math.random in the target application, and
- 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
undicibyparrot409-- 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-idheader 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
... (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
Tests
- migrate from travis to GHA
v4.0.0
- Merge pull request #382 from wxt2005/custom-stream 8968e01
- Fix typo e705c0a
- Merge branch 'master' 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
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.fromandBuffer.allocrequire 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-changelog811f682- [Tests] handle predict-v8-randomness failures in node < 17 and node > 23
1d11a76- [Fix] Switch to using
cryptorandom for boundary values3d17230- [Tests] fix linting errors
5e34080- [meta] actually ensure the readme backup isn’t published
316c82b- [Dev Deps] update
@ljharb/eslint-config58c25d7- [meta] fix readme capitalization
2300ca1v4.0.3 - 2025-06-05
Fixed
- [Fix]
append: avoid a crash on nullish values[#577](https://github.com/form-data/form-data/issues/577)Commits
- [eslint] use a shared config
426ba9a- [eslint] fix some spacing issues
2094191- [Refactor] use
hasown81ab41b- [Fix] validate boundary type in
setBoundary()method8d8e469- [Tests] add tests to check the behavior of
getBoundarywith non-strings837b8a1- [Dev Deps] remove unused deps
870e4e6- [meta] remove local commit hooks
e6e83cc- [Dev Deps] update
eslint4066fd6- [meta] fix scripts to use prepublishOnly
c4bbb13v4.0.2 - 2025-02-14
Merged
- [Fix] set
Symbol.toStringTagwhen available[#573](https://github.com/form-data/form-data/issues/573)- [Fix] set
Symbol.toStringTagwhen available[#573](https://github.com/form-data/form-data/issues/573)- fix (npmignore): ignore temporary build files
[#532](https://github.com/form-data/form-data/issues/532)- fix (npmignore): ignore temporary build files
[#532](https://github.com/form-data/form-data/issues/532)Fixed
- [Fix] set
Symbol.toStringTagwhen available (#573)[#396](https://github.com/form-data/form-data/issues/396)- [Fix] set
Symbol.toStringTagwhen available (#573)[#396](https://github.com/form-data/form-data/issues/396)- [Fix] set
Symbol.toStringTagwhen available[#396](https://github.com/form-data/form-data/issues/396)Commits
... (truncated)
Commits
- See full diff in compare view
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
- Update README.md by
@brendandburnsin kubernetes-client/javascript#2418- ci: test on Node v24 by
@cjihrigin kubernetes-client/javascript#2419- build(deps): bump openid-client from 6.4.2 to 6.5.0 by
@dependabotin kubernetes-client/javascript#2422- build(deps): bump
@types/nodefrom 22.15.11 to 22.15.14 by@dependabotin kubernetes-client/javascript#2423- build(deps): bump
@types/nodefrom 22.15.14 to 22.15.15 by@dependabotin kubernetes-client/javascript#2426- build(deps): bump
@types/nodefrom 22.15.15 to 22.15.17 by@dependabotin kubernetes-client/javascript#2428- Cherry-pick in two watch changes from the 0.x branch, clean up tests, fix list -> resourceVersion handling by
@brendandburnsin kubernetes-client/javascript#2429- build(deps-dev): bump typescript-eslint from 8.32.0 to 8.32.1 by
@dependabotin kubernetes-client/javascript#2431- build(deps): bump
@types/nodefrom 22.15.17 to 22.15.18 by@dependabotin kubernetes-client/javascript#2436- feat: add model registry to object serializer by
@schroditin kubernetes-client/javascript#2433- build(deps-dev): bump
@eslint/jsfrom 9.26.0 to 9.27.0 by@dependabotin kubernetes-client/javascript#2439- build(deps): bump
@types/nodefrom 22.15.18 to 22.15.19 by@dependabotin kubernetes-client/javascript#2440- build(deps-dev): bump eslint from 9.26.0 to 9.27.0 by
@dependabotin kubernetes-client/javascript#2441- chore: readd ws as a dependency by
@mstruebingin kubernetes-client/javascript#2442- build(deps): bump
@types/nodefrom 22.15.19 to 22.15.21 by@dependabotin kubernetes-client/javascript#2445- fix: readd AbortError export by
@xkabylgSICKAGin kubernetes-client/javascript#2446- build(deps): bump tar-fs from 3.0.8 to 3.0.9 by
@dependabotin kubernetes-client/javascript#2447- build(deps-dev): bump typedoc from 0.28.4 to 0.28.5 by
@dependabotin kubernetes-client/javascript#2452- update package versions in preparation for release by
@cjihrigin kubernetes-client/javascript#2454- build(deps): bump
@types/nodefrom 22.15.21 to 22.15.23 by@dependabotin kubernetes-client/javascript#2456- build(deps-dev): bump typescript-eslint from 8.32.1 to 8.33.0 by
@dependabotin kubernetes-client/javascript#2457Full Changelog: https://github.com/kubernetes-client/javascript/compare/1.2.0...1.3.0
1.2.0
What's Changed
- Reintroduce timeout and keep-alive for watch requests to match client-go by
@rossanthonyin kubernetes-client/javascript#2367- watch: prevent done callback from being called twice on connection loss by
@bverhoevenin kubernetes-client/javascript#2389- config: support username impersonation by
@cjihrigin kubernetes-client/javascript#2373- fix(object): properly serialize objects on create/replace/patch by
@schroditin kubernetes-client/javascript#2400- Regenerate for Kubernetes 1.33 by
@brendandburnsin kubernetes-client/javascript#2416New Contributors
@rossanthonymade their first contribution in kubernetes-client/javascript#2367@juldrixxmade their first contribution in kubernetes-client/javascript#2388@bverhoevenmade their first contribution in kubernetes-client/javascript#2389Full 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
- test: support testing transpiled code by
@cjihrigin kubernetes-client/javascript#2122- Add proxy support by
@krmodelskiin kubernetes-client/javascript#2111- Fix type definition for KubernetesObjectApi.read() by
@jportnerin kubernetes-client/javascript#2129- export
ApiConstructor-type by@mstruebingin kubernetes-client/javascript#2139- websocket: do not close when protocol supports it by
@cjihrigin kubernetes-client/javascript#2144- Improve loadFromCluster testing by
@brendandburnsin kubernetes-client/javascript#2191
... (truncated)
Commits
-
940af26Merge pull request #2457 from kubernetes-client/dependabot/npm_and_yarn/main/... -
5dad6d3Merge pull request #2456 from kubernetes-client/dependabot/npm_and_yarn/main/... -
55e1a8abuild(deps-dev): bump typescript-eslint from 8.32.1 to 8.33.0 -
adf25e2build(deps): bump@types/nodefrom 22.15.21 to 22.15.23 -
2ed3379Merge pull request #2454 from cjihrig/bump -
4846defupdate package versions in preparation for release -
f809c36Merge pull request #2452 from kubernetes-client/dependabot/npm_and_yarn/main/... -
52c1acfbuild(deps-dev): bump typedoc from 0.28.4 to 0.28.5 -
1fcb3a6Merge pull request #2447 from kubernetes-client/dependabot/npm_and_yarn/main/... -
affa86abuild(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 recreatewill recreate this MR rewriting all the manual changes and resolving conflicts