Skip to content

Commit 26bf94c

Browse files
fix security issue of page import
1 parent f0a44b3 commit 26bf94c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

inc/admin/st-init.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,12 @@ public function save_wp_page_import_track($post_id, $original_id, $postdata, $da
136136
}
137137

138138
function aae_get_latest_imported_pages() {
139-
// Optional nonce check
140-
if (isset($_POST['nonce']) && ! wp_verify_nonce(sanitize_text_field($_POST['nonce']), 'wcf_admin_nonce')) {
141-
wp_send_json_error(['message' => 'Invalid nonce'], 403);
139+
// phpcs:disable WordPress.Security.NonceVerification.Missing
140+
if (
141+
! isset( $_POST['nonce'] ) ||
142+
! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wcf_admin_nonce' )
143+
) {
144+
wp_send_json_error( [ 'message' => 'Invalid or missing nonce' ], 403 );
142145
}
143146

144147
$per_page = isset($_POST['per_page']) ? max(1, (int) $_POST['per_page']) : 1; // latest one by default

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: wealcoder, wcrayhan, jhshakil, ahsanriad, hamimbepari, devsabbirhossain
33
Donate link: https://buy.stripe.com/3cs3dI7DQauI0py9AC
44
Tags: Elementor, Elementor Addons, Elementor Templates, Animation, Templates
5-
Requires at least: 6.0
5+
Requires at least: 6.6
66
Tested up to: 6.8
77
Requires PHP: 7.4
88
Stable tag: 2.4.0

0 commit comments

Comments
 (0)