Headline
CVE-2023-5161: shortcode.php in modal-window/tags/5.3.5/public – WordPress Plugin Repository
The Modal Window plugin for WordPress is vulnerable to Stored Cross-Site Scripting via shortcodes in versions up to, and including, 5.3.5 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers with contributor-level and above permissions to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
Last change on this file was 2915607, checked in by , 4 months ago
Update to version 5.3.5
File size: 1.7 KB
Line
1
<?php
2
/**
3
* Shortcode
4
*
5
* @package Wow_Plugin
6
* @copyright Copyright © 2018, Dmytro Lobov
7
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
* @since 1.0
9
*/
10
11
12
if ( ! defined( ‘ABSPATH’ ) ) {
13
exit;
14
}
15
16
extract( shortcode_atts( array( ‘id’ => “” ), $atts ) );
17
global $wpdb;
18
$table = $wpdb->prefix . ‘wow_’ . $this->plugin[‘prefix’];
19
$sSQL = $wpdb->prepare( "select * from $table WHERE id = %d", $id );
20
$result = $wpdb->get_results( $sSQL );
21
22
if ( count( $result ) > 0 ) {
23
24
foreach ( $result as $key \=> $val ) {
25
$param \= unserialize( $val\->param );
26
$check \= $this\->check( $param, $id );
27
if ( $check \=== false ) {
28
return false;
29
}
30
31
if ( empty( $val\->status ) ) {
32
return false;
33
}
34
35
include( 'partials/public.php' );
36
37
$slug \= $this\->plugin\['slug'\];
38
$version \= $this\->plugin\['version'\];
39
$url\_asset \= plugin\_dir\_url( \_\_FILE\_\_ );
40
$pre\_suffix \= defined( 'SCRIPT\_DEBUG' ) && SCRIPT\_DEBUG ? '' : '.min';
41
42
$url\_style \= $url\_asset . 'assets/css/style' . $pre\_suffix . '.css';
43
wp\_enqueue\_style( $slug, $url\_style, null, $version );
44
45
wp\_add\_inline\_style( $slug, $val\->style );
46
47
$effects\_url \= $url\_asset . 'assets/js/jquery.effects' . $pre\_suffix . '.js';
48
wp\_enqueue\_script( $slug . '-effects', $effects\_url, array( 'jquery' ), $version );
49
50
$modal\_url \= $url\_asset . 'assets/js/jquery.modalWindow' . $pre\_suffix . '.js';
51
wp\_enqueue\_script( $slug, $modal\_url, array( 'jquery' ), $version );
52
53
$inline\_js \= 'jQuery(function() {jQuery("#wow-modal-overlay-' . $id . '").ModalWindow(' . $val\->script . '); });';
54
wp\_add\_inline\_script( $slug, $inline\_js );
55
56
57
}
58
59
}
Note: See TracBrowser for help on using the repository browser.