Skip to content

fix: [form-data] Upgrade form-data from 2.3.3 to 4.0.4 to resolve CVE-2025-7783 - #225

Open
hannahhuh-cog wants to merge 1 commit into
mainfrom
devin/1787559359-fix-formdata-CVE-2025-7783
Open

fix: [form-data] Upgrade form-data from 2.3.3 to 4.0.4 to resolve CVE-2025-7783#225
hannahhuh-cog wants to merge 1 commit into
mainfrom
devin/1787559359-fix-formdata-CVE-2025-7783

Conversation

@hannahhuh-cog

@hannahhuh-cog hannahhuh-cog commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Fixes predictable multipart boundary generation in form-data, reported by the scheduled Snyk MCP scan.

  • Vulnerability: Predictable Value Range from Previous Values / unsafe random boundary — SNYK-JS-FORMDATA-10841150
  • CVE: CVE-2025-7783
  • Severity: Critical, CVSS 9.4
  • Affected: form-data@2.3.3 (transitive)
  • Fixed in: 2.5.4, 3.0.4, 4.0.4; pinned to 4.0.4
  • Risk: Boundaries derived from Math.random() are predictable, so an attacker who controls part of a request body can inject additional multipart parts (parameter/HTTP request smuggling into upstream services).

form-data is transitive, so the fix is an npm overrides entry:

+  "overrides": {
+    "form-data": "4.0.4"
+  }

package-lock.json regenerated with npm install --package-lock-only; resolved node_modules/form-data is now 4.0.4.

Snyk scan reference: snyk test --all-projects --dev / snyk_sca_scan (unmanaged: true), Snyk org 9e26acce-22c7-4efc-b470-21d9587f49fe.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/fc1965e7d98f4966bea1c7aa64a929b0
Requested by: @hannahhuh-cog


Open in Devin Review

Co-Authored-By: Hannah Huh <hannah.huh@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread package.json
Comment on lines +57 to +59
"overrides": {
"form-data": "4.0.4"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Lockfile out of sync with declared overrides

package.json declares an overrides block forcing form-data to 4.0.4, but the committed package-lock.json root node (packages[""]) contains no matching overrides key. The two files are out of sync, so npm ci fails with an EUSAGE error and npm install rewrites the lockfile.

Prompt for agents
The package.json adds an overrides block for form-data, but the committed package-lock.json does not record this in its root packages[""] node (there is no "overrides" key anywhere in the lockfile). npm normally persists the overrides object into the lockfile root when regenerating, so its absence indicates the lockfile is out of sync with package.json. This can cause `npm ci` to fail with an EUSAGE 'package.json and package-lock.json are in sync' error. Regenerate the lockfile from scratch (e.g. delete package-lock.json and run npm install, or run npm install so npm writes the overrides object into packages[""]), and commit the fully regenerated lockfile.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally — npm ci is not broken by this.

I regenerated the lockfile with npm install --package-lock-only on npm 10.8.2. This repo's lockfile is lockfileVersion: 2 (hybrid v1/v2), and npm did not write an overrides key into packages[""] — but it did resolve the overridden version in the tree, and npm only enforces the overrides-sync check when the lockfile records one.

Evidence, from a clean checkout of just package.json + package-lock.json on this branch:

$ npm ci --ignore-scripts
added 947 packages in 5s
$ node -e "console.log(require('form-data/package.json').version)"
4.0.4

No EUSAGE error. Leaving the lockfile as npm generated it.

Comment thread package.json
Comment on lines +57 to +59
"overrides": {
"form-data": "4.0.4"
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: form-data 4.x forced onto request@2.88.0

The override pins form-data 4.0.4 onto request@2.88.0, which declares ~2.3.2. The APIs request uses (append, getHeaders, getLength, pipe) exist in v4, so it is unlikely to break, but this is a two-major-version jump across a transitive consumer.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant