Skip to content

[system] Prevent prototype pollution in cssVarsParser#48822

Open
Janpot wants to merge 5 commits into
mui:masterfrom
Janpot:fix/csvars-parser-prototype-pollution
Open

[system] Prevent prototype pollution in cssVarsParser#48822
Janpot wants to merge 5 commits into
mui:masterfrom
Janpot:fix/csvars-parser-prototype-pollution

Conversation

@Janpot

@Janpot Janpot commented Jul 16, 2026

Copy link
Copy Markdown
Member

assignNestedKeys walked and wrote through key paths without guarding __proto__/constructor/prototype, so a theme containing such a nested key (e.g. one parsed from untrusted JSON) could write onto Object.prototype. Added the same key blocklist already used by fastDeepAssign (#48580).

Blast radius is very small in practice: the theme passed to createTheme/extendTheme/cssVarsParser is developer-authored config and essentially never comes from user input — this is defensive hardening on the exported unstable_cssVarsParser surface.

@Janpot Janpot added security Pull requests that address a security vulnerability. scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). labels Jul 16, 2026
@code-infra-dashboard

code-infra-dashboard Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-48822--material-ui.netlify.app/
QR code for https://deploy-preview-48822--material-ui.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/material 🔺+92B(+0.02%) 🔺+59B(+0.04%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 🔺+92B(+0.13%) 🔺+37B(+0.15%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@Janpot
Janpot marked this pull request as ready for review July 20, 2026 16:45
@Janpot
Janpot requested a review from siriwatknp July 20, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: code-infra Involves the code-infra product (https://www.notion.so/mui-org/5562c14178aa42af97bc1fa5114000cd). security Pull requests that address a security vulnerability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant