fix: strengthen nonce verification across plugin#225
Merged
sushmak02 merged 5 commits intorelease-candidatefrom Feb 24, 2026
Merged
fix: strengthen nonce verification across plugin#225sushmak02 merged 5 commits intorelease-candidatefrom
sushmak02 merged 5 commits intorelease-candidatefrom
Conversation
- Replace generic 'ajax_nonce' action with 'bsf_meta_box_ajax_nonce' to prevent cross-plugin nonce collision - Replace basename(__FILE__) nonce action with explicit 'bsf_meta_box_nonce_action' string - Gate bsf_reset_options() behind $nonce_verified flag so it only executes after a per-option nonce check passes - Sanitize nonce and option values in reset handler Fixes #220
sushmak02
approved these changes
Feb 24, 2026
Contributor
|
@akshayurankar48 Resolve conflicts in this PR |
Resolved conflicts in init.php and admin/index.php: - bsf_force_send(): sanitize nonce with sanitize_text_field(wp_unslash()) + correct action 'bsf_meta_box_ajax_nonce' - bsf_oembed_ajax_results(): sanitized nonce + capability check + wp_send_json_error() instead of die() - Added isset() guard on $_REQUEST['field_id'] - Replaced die() with wp_die() at end of AJAX handler - admin/index.php: kept $nonce_verified flag initialization, removed extra blank lines
- Align 'post_id' double arrow with 'bsf_meta_box_ajax_nonce' in array - Align $return equals sign with $field_id assignment
Contributor
Author
Updated @sushmak02 |
sushmak02
approved these changes
Feb 24, 2026
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
'ajax_nonce'action with'bsf_meta_box_ajax_nonce'to prevent cross-plugin collisionbasename(__FILE__)nonce action with explicit'bsf_meta_box_nonce_action'bsf_reset_options()behind$nonce_verifiedflag so it only executes after a per-option nonce check passesTest plan
Fixes #220