[system] Serialize InitColorSchemeScript configuration values - #49091
Open
Janpot wants to merge 1 commit into
Open
[system] Serialize InitColorSchemeScript configuration values#49091Janpot wants to merge 1 commit into
Janpot wants to merge 1 commit into
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
Janpot
force-pushed
the
harden-init-color-scheme-script
branch
from
September 7, 2026 09:15
d25fa7d to
f31b5bf
Compare
Janpot
marked this pull request as ready for review
September 7, 2026 09:29
Member
Author
|
@claude review |
This comment was marked as resolved.
This comment was marked as resolved.
The storage keys and default scheme names were interpolated straight into the inline SSR script. An app that derives any of them from user- or tenant-controlled config could break out of the string literal (or the <script> element), so serialize those values with JSON.stringify (escaping <, U+2028, U+2029) before embedding them. The `attribute` and `colorSchemeNode` props are assumed to be static, developer-defined values and are left as-is.
Janpot
force-pushed
the
harden-init-color-scheme-script
branch
from
September 8, 2026 12:20
f31b5bf to
c24ea4d
Compare
This was referenced Sep 8, 2026
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.
The storage keys and default scheme names were interpolated straight into the inline SSR script, so an app that derives any of them from user- or tenant-controlled config could break out of the string literal (or the
<script>element). This serializes those values withJSON.stringify(escaping<, U+2028, U+2029) before embedding them.attributeandcolorSchemeNodeare assumed to be static, developer-defined values, so they're left as-is (theattributeprop doc now says so).