Update dependency form-data@<2.5.4 to v4 [SECURITY]#28616
Open
tryghost-renovate[bot] wants to merge 1 commit into
Open
Update dependency form-data@<2.5.4 to v4 [SECURITY]#28616tryghost-renovate[bot] wants to merge 1 commit into
tryghost-renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
07aff8e to
3a96cc0
Compare
f2bd720 to
3a96cc0
Compare
3a96cc0 to
cb8ed09
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^2.5.4→^4.0.0Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
form-data: CRLF injection in form-data via unescaped multipart field names and filenames
CVE-2026-12143 / GHSA-hmw2-7cc7-3qxx
More information
Details
Summary
form-databuildsmultipart/form-datarequest bodies. Through v4.0.5, thefieldname passed toFormData#appendand thefilenameoption are concatenated directly into theContent-Dispositionheader with no escaping of CR (\r), LF (\n), or". An application that uses untrusted input as a field name or filename therefore lets an attacker terminate the header line and either inject additional headers or smuggle whole additional multipart parts into the request the application forwards to a backend.This is CWE-93 (CRLF injection). It is a divergence from how browsers and the WHATWG HTML spec serialize form-data (they escape these characters), so the fix is to match that behavior. Severity is conditional: it depends on the consuming application passing attacker-controlled data as a field name or filename. Applications that only use fixed/trusted field names are not affected.
Details
In
lib/form_data.js,_multiPartHeaderbuilds the part header as:and
_getContentDispositionbuildsfilename="' + filename + '"'. Neither escapes control characters, so a\r\ninfield/filenameends the header line. The same applies to", which can break out of the quoted parameter.Proof of concept
Before the fix this emits an injected
X-Injected: trueheader line. A field name that also includes--<boundary>sequences can introduce additional parts (e.g. an extraname="is_admin"field), which a downstream parser accepts as legitimate.Impact
For an application that uses untrusted field names/filenames:
is_admin,role) — the primary demonstrated impact.Claims of guaranteed privilege escalation, authentication bypass, high confidentiality impact, and availability impact are application-dependent downstream consequences, not properties of
form-dataitself, and are not demonstrated by the PoC.Severity
The demonstrated, library-attributable impact is integrity (field/header injection); there is no demonstrated confidentiality disclosure or availability impact in
form-dataitself, and exploitation requires the consuming app to feed untrusted data into field names/filenames. A Moderate (≈5.3,I:L) rating is also defensible given that precondition.Patch
Fixed in 4.0.6, 3.0.5, and 2.5.6. Users on older 0.x/1.x/2.x releases should upgrade to 2.5.6 or later.
The fix escapes
\r,\n, and"as%0D,%0A, and%22in field names and filenames, matching the WHATWG HTMLmultipart/form-dataencoding algorithm that browsers implement. This neutralizes the injection while leaving ordinary field names (includingname[0], dotted, and unicode names) unchanged.Workaround
Until upgrading, validate or reject field names/filenames that contain control characters before calling
append:Credit
Reported by yueyueL.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
form-data/form-data (form-data@<2.5.4)
v4.0.6Compare Source
Commits
"in field names and filenames8dff42c@ljharb/eslint-config,auto-changelog,tapef31d21ehasown,mime-types92ae0ebjs-randomness-predictor67b0f65v4.0.5Compare Source
Commits
16e0076@ljharb/eslint-config,eslint582246776d0deev4.0.4Compare Source
Commits
auto-changelog811f6821d11a76cryptorandom for boundary values3d172305e34080316c82b@ljharb/eslint-config58c25d72300ca1v4.0.3Compare Source
Fixed
append: avoid a crash on nullish values#577Commits
426ba9a2094191hasown81ab41bsetBoundary()method8d8e469getBoundarywith non-strings837b8a1870e4e6e6e83cceslint4066fd6c4bbb13v4.0.2Compare Source
Merged
Symbol.toStringTagwhen available#573Symbol.toStringTagwhen available#573#532#532Fixed
Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available#396Commits
92613b9806eda78fdb3bcObject.prototype.hasOwnProperty.call7fecefeObject.prototype.hasOwnProperty.call6e682d4Object.prototype.hasOwnProperty.calldf3c1e6@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescript8261fcb@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescriptfb66cb7@types/node,browserify,coveralls,eslint,formidable,in-publish,phantomjs-prebuilt,pkgfiles,pre-commit,request,tape,typescript819f6b73217b3d3a9d480Buffer.fromandBuffer.allocrequire node 4+c499f76b82f590b170ee2combined-stream,mime-types6b1ca1drequestwhich viatough-cookie^2.4 depends onpsle5df7f2mime-types5a5bafe9457283requestwhich viatough-cookie^2.4 depends onpsl9dbe192d53265d7020dd4cross-spawn3fc1a9bedb555a10418d1v4.0.1Compare Source
Commits
757b4e3e8f0d80335ad19440d3bev4.0.0Compare Source
Merged
#382Commits
e705c0a6dd8624v3.0.5Compare Source
Commits
"in field names and filenames8777e67@ljharb/eslint-config,auto-changelog,eslint,tape27c61a5hasown6a8a1c6v3.0.4Compare Source
Fixed
append: avoid a crash on nullish values#577Commits
f5e7eb0auto-changelogd2eb290e8c574ccryptorandom for boundary valuesc6ced61hasown1a78b5dsetBoundary()method70bbaa0getBoundarywith non-stringsb22a64e0150851fc42bb9a14d09e11d9f73fc38b48v3.0.3Compare Source
Merged
Symbol.toStringTagwhen available#573Symbol.toStringTagwhen available#573#532#532Fixed
Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available#396Commits
92613b9806eda78fdb3bcObject.prototype.hasOwnProperty.call7fecefeObject.prototype.hasOwnProperty.call6e682d4Object.prototype.hasOwnProperty.calldf3c1e6@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescript8261fcb@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescriptfb66cb7@types/node,browserify,coveralls,eslint,formidable,in-publish,phantomjs-prebuilt,pkgfiles,pre-commit,request,tape,typescript819f6b73217b3d3a9d480Buffer.fromandBuffer.allocrequire node 4+c499f76b82f590b170ee2combined-stream,mime-types6b1ca1drequestwhich viatough-cookie^2.4 depends onpsle5df7f2mime-types5a5bafe9457283requestwhich viatough-cookie^2.4 depends onpsl9dbe192d53265d7020dd4cross-spawn3fc1a9bedb555a10418d1v3.0.2Compare Source
Merged
Symbol.toStringTagwhen available#573Symbol.toStringTagwhen available#573#532#532Fixed
Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available (#573)#396Symbol.toStringTagwhen available#396Commits
92613b9806eda78fdb3bcObject.prototype.hasOwnProperty.call7fecefeObject.prototype.hasOwnProperty.call6e682d4Object.prototype.hasOwnProperty.calldf3c1e6@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescript8261fcb@types/node,browserify,coveralls,cross-spawn,eslint,formidable,in-publish,pkgfiles,pre-commit,puppeteer,request,tape,typescriptfb66cb7@types/node,browserify,coveralls,eslint,formidable,in-publish,phantomjs-prebuilt,pkgfiles,pre-commit,request,tape,typescript819f6b73217b3d3a9d480Buffer.fromandBuffer.allocrequire node 4+c499f76b82f590b170ee2combined-stream,mime-types6b1ca1drequestwhich viatough-cookie^2.4 depends onpsle5df7f2mime-types5a5bafe9457283requestwhich viatough-cookie^2.4 depends onpsl9dbe192d53265d7020dd4cross-spawn3fc1a9bedb555a10418d1v3.0.1Compare Source
Merged
#451Commits
55d90cev3.0.0Compare Source
Merged
#449#448#447#442#446#434#424Fixed
#422#422Commits
80c8f74f4ca7f84bde68e2b4e478Configuration
📅 Schedule: (in timezone Etc/UTC)
* * * * 0,6)* 23 * * 1-5)* 0-4 * * 1-6)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.