Disable or restrict the theme_preview parameter on the front end #50188
Labels
[Feature] Themes
Questions or issues with incorporating or styling blocks in a theme.
[Type] Bug
An existing feature does not function as intended
Description
In Add Theme Previews for block themes
a special GET parameter makes it possible to preview block themes in the site editor.
Because to make this work the PR filtered
stylesheet
andtemplate
options, this special parameter is also taking effect on the front end effectively allowing one to switch the current theme to whatever is installed.This is problematic security wise because:
The
theme_preview
GET param should only work if the user is logged in and has the correct permissions for editing themes.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
N/A
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: