Repository navigation
fix(security): builder preview, language switch and element requests require an admin and the admin nonce - #264
Merged
Conversation
…require an admin and the admin nonce
RensTillmann
marked this pull request as ready for review
October 20, 2026 15:57
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.
Summary
Security fix for #139 on 6.3 LTS. Five form-builder AJAX handlers had no nonce and no capability check, so any logged-in user (e.g. a subscriber) could render any form or its settings:
super_load_preview(form markup incl. drafts/private/backups),super_switch_language(full form settings HTML),super_undo_redo, and the AJAX entry ofsuper_load_element_settings/super_get_element_builder_html.They now use the existing
authorize_admin_ajax_request()guard (manage_options+super_admin_ajaxnonce); preview also rejects backups/non-forms viarequire_admin_form(). The last two are only guarded on their AJAX path (doing_action), so internal PHP calls keep working. All six builder JS callers send the admin nonce (already localized).No more silent failures: a rejected save/preview request (non-200,
-1/0) restores the button and shows a translatable alert ("The request was rejected (HTTP %s). Your session may have expired or a security plugin blocked it. Please reload the page and try again.") instead of hanging on "Saving...". Saving itself was already protected since 6.3.317.Base branch
lts/6.3.x: security fix for the stable channel. 6.4 counterpart: #260.Tests
Not run: a real-browser builder session.
Merge
Draft: for QA and the next LTS release session.