Skip to content

Security: Fix CVE-2025-7783 (form-data)#15

Closed
vmrh21 wants to merge 1 commit intotest/workflow-cve-41174from
fix/cve-2025-7783-form-data-attempt-1
Closed

Security: Fix CVE-2025-7783 (form-data)#15
vmrh21 wants to merge 1 commit intotest/workflow-cve-41174from
fix/cve-2025-7783-form-data-attempt-1

Conversation

@vmrh21
Copy link
Copy Markdown
Owner

@vmrh21 vmrh21 commented Feb 17, 2026

Summary

This PR fixes CVE-2025-7783 by upgrading form-data from 3.x to 4.0.5 using npm overrides.

CVE Details

  • CVE ID: CVE-2025-7783
  • Package: form-data
  • Severity: CRITICAL (CVSS 9.1)
  • Impact: Unsafe random function used for choosing boundary in multipart/form-data
  • Vulnerable versions: 3.0.0 - 3.0.3
  • Fixed version: 4.0.5
  • Jira Issues: RHOAIENG-30548, RHOAIENG-30550, RHOAIENG-30546, RHOAIENG-30549, RHOAIENG-30547, RHOAIENG-30724

Vulnerability Description

The form-data package versions 3.0.0 through 3.0.3 use Math.random() for generating multipart boundaries, which is not cryptographically secure. This could allow an attacker to predict boundaries and potentially bypass security controls or manipulate form submissions.

Fix Method

This PR uses npm's overrides feature to force all transitive dependencies to use form-data ^4.0.5.

Why npm overrides?

  • Creates minimal, reviewable PR
  • No lockfile format upgrades
  • Forces consistent version across entire dependency tree
  • Upgrades to latest stable 4.x version

Breaking Changes

Minor API changes in form-data 4.x:

  • Most changes are internal improvements
  • Standard form-data usage patterns remain compatible
  • The primary changes are security improvements and better stream handling

Impact: LOW - The application uses form-data as a transitive dependency, not directly. No code changes required.

Files Changed

  • package.json - Added overrides section
  • package-lock.json - Updated dependencies
  • backend/package-lock.json - Updated dependencies
  • frontend/package-lock.json - Updated dependencies

Total: 4 files changed

Testing Checklist

  • Run npm audit to verify CVE-2025-7783 is resolved
  • Run npm list form-data to verify version 4.0.5 is installed
  • Run unit tests: npm run test
  • Run integration tests: npm run test:integration
  • Verify application builds successfully: npm run build
  • Test any file upload or form submission functionality

Risk Assessment

Risk Factor Level Notes
Breaking Changes LOW Minor API changes, transitive dependency
Dependency Conflicts LOW form-data 4.x is widely compatible
Regression Risk LOW No direct code usage
Security Impact CRITICAL Resolves unsafe random function vulnerability

Generated with CVE Fixer Workflow

- Add npm override for form-data ^4.0.5 to fix CVE-2025-7783 (unsafe random function)
- Update all lock files in monorepo (main, backend, frontend)
- Resolves RHOAIENG-30548, RHOAIENG-30550, RHOAIENG-30546, RHOAIENG-30549, RHOAIENG-30547, RHOAIENG-30724

CVE Details:
- CVE ID: CVE-2025-7783
- Package: form-data
- Severity: CRITICAL (CVSS 9.1)
- Impact: Unsafe random function used for choosing boundary in multipart/form-data
- Vulnerable versions: 3.0.0 - 3.0.3
- Fixed version: 4.0.5

Fix Method:
- Used npm overrides to force form-data ^4.0.5 across all transitive dependencies
- This ensures all instances of form-data use the patched version
- Upgraded from 3.x to 4.x (latest major version)

Files Changed (4 total):
- package.json (added overrides section)
- package-lock.json (updated dependencies)
- backend/package-lock.json (updated dependencies)
- frontend/package-lock.json (updated dependencies)

Breaking Changes:
- form-data 4.x has minor API changes from 3.x
- Most changes are internal improvements
- Existing code using standard form-data APIs should work without modification

Testing:
- Verified form-data@4.0.5 is installed via npm list
- Confirmed CVE-2025-7783 no longer appears in npm audit

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@vmrh21
Copy link
Copy Markdown
Owner Author

vmrh21 commented Feb 18, 2026

Test complete - resetting for fresh test

@vmrh21 vmrh21 closed this Feb 18, 2026
@vmrh21 vmrh21 deleted the fix/cve-2025-7783-form-data-attempt-1 branch February 18, 2026 20:24
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.

2 participants