[DataGridPremium] Escape singleSelect values in Excel export with escapeFormulas enabled#22851
Merged
michelengelen merged 5 commits intoJun 26, 2026
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Author
|
@rita-codes @michelengelen Kindly have review on this pr. Thanks! |
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
michelengelen
approved these changes
Jun 25, 2026
michelengelen
left a comment
Member
There was a problem hiding this comment.
LGTM, but I would like to wait for a second review from the core datagrid team (especially @cherniavskii) since they have the most experience with this code section
Contributor
Author
|
Sure. |
arminmeh
approved these changes
Jun 26, 2026
singleSelect values in Excel export with escapeFormulas enabled
Contributor
|
Cherry-pick PRs will be created targeting branches: v8.x |
mbrookes
pushed a commit
to mbrookes/mui-x
that referenced
this pull request
Jun 27, 2026
…escapeFormulas` enabled (mui#22851) Co-authored-by: Armin Mehinovic <[email protected]>
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.
Changelog
The Excel exporter applies the
escapeFormulasguard (on by default) only to string values held in the localcellValue. ThesingleSelectbranch ofserializeRowUnsafewrote the formatted label straight to the serialized row and never setcellValue, so a singleSelect label beginning with=,+,-,@, tab or carriage return was exported without the neutralizing apostrophe (OWASP CSV/Excel formula injection), while the CSV exporter and the other column types escaped it correctly.This routes the singleSelect label through
cellValueso it flows through the shared escape guard. Adds tests asserting a singleSelect formula label is escaped whenescapeFormulasis enabled (default) and left untouched when it is disabled.Closes #22819