Repository navigation
Security: replace deepmerge with a prototype-safe merge (10.2.2) - #4
Closed
lane-formio wants to merge 1 commit into
Closed
lane-formio wants to merge 1 commit into
lane-formio wants to merge 1 commit into
Conversation
deepmerge 4.3.1 has a prototype pollution vulnerability (CVE-2026-93753) with no fixed release. Replace both runtime uses (config and template merging) with an internal deepMerge() that ignores __proto__, constructor and prototype keys, and move deepmerge to devDependencies since only the webpack configs still use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part of the formio-enterprise 9.2.x security patch release. @formio/choices.js 10.2.2 is picked up by formiojs 4.21.8. This PR targets the new
10.2.xmaintenance branch, created fromv10.2.1.Why
deepmerge 4.3.1 has a prototype-pollution CVE, CVE-2026-93753 (high), with no fixed release.
mergeObject()doesn't validate keys, so a source object carrying__proto__can inject properties. Choices passes user config and user templates through deepmerge.Changes
deepMerge()insrc/scripts/lib/utils.tsreplaces both call sites:merge.all([DEFAULT_CONFIG, Choices.defaults.options, userConfig], { arrayMerge: replace })merge(templates, userTemplates)arrayMergefor config__proto__,constructorandprototypekeysshadowRootelement passed in config is no longer turned into an empty object. The existing restore line is kept.src/scripts/interfaces/choices.ts: importedOptionsfromdeepmergeby mistake; it now imports Choices' own./optionstype.deepmergemoved todevDependencies: the webpack configs still use it at build time, but it's no longer a runtime dependency, so consumers (formiojs → formio-enterprise) stop installing it.deepMerge: merge semantics, by-reference values and prototype-pollution payloads.Testing
npm run test:unit: 382 passing, including the 3 newdeepMergetests.npm run js:buildpasses. The rebuiltpublic/assets/scripts/choices.jshas 0 deepmerge references; the currently shipped bundle has 16.public/.choices.ts:507,container.ts:64) were already onv10.2.1import type { Options } from './options'avoids animport/no-cycleerrortsc --noEmit: no errors insrc/. The 4 errors from conflicting chai type definitions innode_modules(Cypress and@types/chai) are present before and after the change.🤖 Generated with Claude Code