Vulnerability: Cross-Site Scripting attacks
-
Your plugin is great, but it enables cross-site scripting attacks. The front-end registration form is reloaded and repopulated with $_POST data when the username is less than 4 characters. Some of the fields might have been modified to enable third-party javascript. For example, what if $_POST[‘user_email’] has been changed to ‘[email protected]”><sCrIpT>alert(36363)</sCrIpT>’?
I’ve overcome this problem by adding the following code to my functions.php file, but it would be best to fix the plugin itself:
add_action('init', 'sanitize_post_data'); function sanitize_post_data() { // Go through all most and sanitize it to prevent cross-site scripting attacks. foreach($_POST as $key=>$val) { $_POST[$key] = htmlentities($val); } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Vulnerability: Cross-Site Scripting attacks’ is closed to new replies.