Hardening pass: input validation, origin checks, and default-safe field behaviour — legacy/v2 - #740
Open
shengxi-gt wants to merge 14 commits into
Open
shengxi-gt wants to merge 14 commits into
shengxi-gt wants to merge 14 commits into
Conversation
added 6 commits
September 18, 2026 14:21
…aults (no wildcard)
…xp (prevent ReDoS)
shengxi-gt
force-pushed
the
clean/MOL-22453-v2
branch
from
September 18, 2026 06:52
412a153 to
f78a7cc
Compare
added 8 commits
September 18, 2026 18:30
…lid file submissions
…MAX_MATCHES_INPUT_LENGTH, bump to 1000
…ang on ReDoS regression
shengxi-gt
force-pushed
the
clean/MOL-22453-v2
branch
from
September 18, 2026 11:03
f78a7cc to
6126ecd
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.
Hardening pass — legacy/v2
Covers several hardening changes and default-safe behaviour updates across fields and shared utilities. One commit — review the diff directly since the changes span multiple independent areas with varying blast radius.
Same changes as the
mainbranch PR, adapted for v2's codebase (Textinstead ofTypography, styled-components CSS interpolation instead of directcssText).Four changes alter default runtime behaviour unconditionally, no opt-out, for every existing schema as soon as this ships:
IframepostMessageorigin check is now hard default-on. Messages from a mismatched origin are silently dropped.matches,notMatches, andfilenameMatchesrules.maxLengthnow defaults to 500 whenevermaskRegexis set and nomax/lengthrule already narrows it./pattern/flagsslashes are no longer silently skipped. They previously landed in a catch block and validation was skipped entirely (value always passed). The shared parsing helper now falls back to treating the whole string as a raw pattern and applies it — any schema relying on the old silent no-op will now get real validation applied.Narrower breaking changes (only affect a consumer that relied on the specific permissive behaviour being fixed): stricter
sanitize-htmlconfiguration may now strip attributes that previously passed through; the ButtonField URL scheme check may block non-standard schemes; custom modal style strings now have@import/url()stripped.Changes covered
sanitize-htmlconfiguration tightened in Text, FilterCheckbox, PopoverpostMessagenow validates origin by defaultRegExpstatefield documented as client-asserted (no code change)maxLengthdefaults to 500 whenmaskRegexis set@importandurl()referencesmatchesrule no longer blocks valid submissions (pre-existing bug fix)Test plan
eslint+tsc --noEmitpass on this branch.