Last active
September 5, 2024 01:39
-
-
Save trepmal/5753200 to your computer and use it in GitHub Desktop.
See how many widgets are not escaping properly.
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
<?php | |
add_filter( 'widget_display_callback', 'exploit_widget_display_callback', 10, 3 ); | |
function exploit_widget_display_callback( $instance, $widget_obj, $args ) { | |
foreach( $instance as $k => $v ) | |
$instance[ $k ] .= '<script>alert("'.esc_js( $widget_obj->name ." \n". $widget_obj->id ) .'");</script>'; | |
return $instance; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment