Hardening pass: input validation, origin checks, and default-safe field behaviour — legacy/v1 - #741
Closed
shengxi-gt wants to merge 22 commits into
Closed
shengxi-gt wants to merge 22 commits into
shengxi-gt wants to merge 22 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-v1
branch
from
September 18, 2026 06:52
17b9f0a to
7567f98
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-v1
branch
from
September 18, 2026 11:03
7567f98 to
93025b2
Compare
added 8 commits
September 21, 2026 10:15
…odalStyles and imageReviewModalStyles
…ModalStyles argType
…reliable timeout on fast hardware
…NPUT_LENGTH guard in hang test
…AX_MATCHES_INPUT_LENGTH guard
…CHES_INPUT_LENGTH guard
…eld and image-upload specs
qroll
reviewed
Sep 22, 2026
| type: "text", | ||
| }, | ||
| }, | ||
| restrictNonSGLocation: { |
Contributor
There was a problem hiding this comment.
this is not implemented in v1
can we confirm if backporting is needed for v1? most services should migrate to v2 at minimum
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/v1
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
main/v2branch PRs, adapted for v1's codebase (Textinstead ofTypography, styled-components CSS interpolation instead of directcssText). v1 has no Popover field and no OTP field, so those items do not apply here.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 1000 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):
sanitize-htmlconfiguration: stricter attribute allowlist may now strip attributes that previously passed through unsanitized.locationModalStyles/imageReviewModalStyles:url()and@importare now stripped from these CSS strings before they are applied to the modal box. Any background image or external resource passed via these props will silently stop working. Verified against all known consumers — none currently use these props withurl()or@import.Changes covered
sanitize-htmlconfiguration tightened in Text, FilterCheckboxpostMessagenow validates origin by defaultRegExpmaxLengthdefaults to 1000 whenmaskRegexis set@importandurl()referenceslocationModalStylesandimageReviewModalStylesprop descriptions updated in Storybookmatchesrule no longer blocks valid submissions (pre-existing bug fix)Test plan
eslint+tsc --noEmitpass on this branch.