Skip to content

[compiler][playground] parse compiler configs using json5#36159

Open
mofeiZ wants to merge 1 commit intomainfrom
pr36159
Open

[compiler][playground] parse compiler configs using json5#36159
mofeiZ wants to merge 1 commit intomainfrom
pr36159

Conversation

@mofeiZ
Copy link
Copy Markdown
Contributor

@mofeiZ mofeiZ commented Mar 27, 2026

Compiler config parsing is currently done with new Function(...) which is a XSS vulnerability. Replacing this with json parsing for safety reasons.

Almost all compiler options (except for moduleTypeProvider) are json compatible, so this isn't a big change to capabilities. Previously created playground URLs with non-default configs may not be compatible with this change, but we should be able to get the correct config manually (by reading the JS version)

Compiler config parsing is currently done with new Function(...) which is a XSS vulnerability. Replacing this with json parsing for safety reasons.

Almost all compiler options (except for moduleTypeProvider) are json compatible, so this isn't a big change to capabilities. Previously created playground URLs with non-default configs may not be compatible with this change, but we should be able to get the correct config manually (by reading the JS version)
@meta-cla meta-cla bot added the CLA Signed label Mar 27, 2026
@mofeiZ mofeiZ requested a review from EugeneChoi4 March 27, 2026 20:48
@mofeiZ mofeiZ marked this pull request as ready for review March 27, 2026 20:48
@EugeneChoi4
Copy link
Copy Markdown
Contributor

Seems like there's some test errors, accepting to unblock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants