fix: security audit round 2 - XSS, JSON-LD injection, die() replacement#230
Merged
sushmak02 merged 2 commits intorelease-candidatefrom Mar 10, 2026
Merged
fix: security audit round 2 - XSS, JSON-LD injection, die() replacement#230sushmak02 merged 2 commits intorelease-candidatefrom
sushmak02 merged 2 commits intorelease-candidatefrom
Conversation
- Sanitize $_SERVER values in get_the_ip() to prevent XSS - Escape IP output in rating form hidden field - Use wp_json_encode with JSON_HEX_TAG to prevent JSON-LD script injection - Escape product_rating option output to prevent stored XSS - Replace die() with wp_send_json_error/success in rating handlers - Sanitize nonce field in submit_color before wp_verify_nonce Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Strip CRLF from name/email in From: header to prevent email header injection - Replace die() with wp_send_json_success/error in submit_request() and submit_color() - Add sanitize_text_field(wp_unslash()) around nonce values in admin/index.php form handlers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sushmak02
approved these changes
Mar 10, 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
Fixes #229
$_SERVERvalues inget_the_ip()to prevent XSSwp_json_encodewithJSON_HEX_TAGto prevent JSON-LD script injectionproduct_ratingoption output to prevent stored XSSdie()withwp_send_json_error/wp_send_json_successin rating handlerssubmit_color()beforewp_verify_nonce()Test plan
🤖 Generated with Claude Code