Skip to content

Commit a183cbf

Browse files
committed
fix: xss vulnerability
1 parent 9e9ee40 commit a183cbf

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

assets/src/js/event-actions.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222

2323
// if data is type of array, we send it as JSON anyway,
2424
// change characters to make it look like associative array
25-
if ( data.type === 'array' ) {
26-
formattedData = `(${data.type}) ` + JSON.stringify(JSON.parse(data.msg), null, 2)
27-
.replace(/\{/g, '[')
28-
.replace(/}/g, ']')
29-
.replace(/:/g, ' =>')
30-
}
25+
if ( data.type === 'array' ) {
26+
formattedData = `(${data.type}) ` + JSON.stringify(JSON.parse(data.msg), null, 2)
27+
.replace(/\{/g, '[')
28+
.replace(/}/g, ']')
29+
.replace(/:/g, ' =>')
30+
}
31+
3132
arr.push(formattedData);
3233

3334
} else {

inc/AdminScreen.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public static function prepare_event_arguments( $event ) {
295295
} else {
296296
$parsed_args[] = array(
297297
'type' => gettype( $arg ),
298-
'msg' => $arg,
298+
'msg' => wp_filter_nohtml_kses( sanitize_text_field( html_entity_decode( $arg ) ) ),
299299
);
300300
}
301301

inc/Cron/EventsActions.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function insert() {
8787
if ( ! empty( $data['arguments'] ) ) {
8888
foreach ( $data['arguments'] as $arg_raw ) {
8989
if ( ! empty( $arg_raw ) ) {
90-
$args[] = sanitize_text_field( $arg_raw );
90+
$args[] = wp_filter_nohtml_kses( sanitize_text_field( html_entity_decode( $arg_raw ) ) );
9191
}
9292
}
9393
}

readme.txt

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ Yes! We're offering a [custom plugin development](https://bracketspace.com/custo
101101

102102
== Changelog ==
103103

104+
= [Next] =
105+
* [Fixed] Security vulnerability.
106+
104107
= 2.5.5 =
105108
* [Added] Custom schedules availability info.
106109

0 commit comments

Comments
 (0)