Skip to content

Commit 9479f61

Browse files
Merge pull request #122 from TycheSoftwares/Fix-#security
Fixed Cross Site Request Forgery (CSRF) vulnerability.
2 parents 446d4ab + 544b60f commit 9479f61

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

includes/component/tracking-data/assets/js/dismiss-notice.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ jQuery(document).ready( function() {
2828
jQuery(this).slideUp( 100, function() {
2929
jQuery(this).remove();
3030
var data = {
31-
action: ts_dismiss_notice.ts_prefix_of_plugin + "_admin_notices"
31+
action: ts_dismiss_notice.ts_prefix_of_plugin + "_admin_notices",
32+
tracking_notice : ts_dismiss_notice.tracking_notice
3233
};
3334
var admin_url = ts_dismiss_notice.ts_admin_url;
3435

includes/component/tracking-data/ts-tracking.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public static function ts_schedule_cron_job () {
277277
* @access public
278278
*/
279279
public static function ts_admin_notices_scripts() {
280-
280+
$nonce = wp_create_nonce( 'tracking_notice' );
281281
wp_enqueue_script(
282282
'ts_dismiss_notice',
283283
self::$ts_file_path . '/assets/js/dismiss-notice.js',
@@ -300,6 +300,10 @@ public static function ts_admin_notices_scripts() {
300300
*/
301301

302302
public static function ts_admin_notices() {
303+
$nonce = $_POST['tracking_notice'];//phpcs:ignore
304+
if ( ! wp_verify_nonce( $nonce, 'tracking_notice' ) ) {
305+
return;
306+
}
303307
update_option( self::$plugin_prefix . '_allow_tracking', 'dismissed' );
304308
FAQ_TS_Tracker::ts_send_tracking_data( false );
305309
die();

plugin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://www.tychesoftwares.com/
55
* Description: Plugin to handle the display of FAQs
66
*
7-
* Version: 1.9.2
7+
* Version: 1.9.3
88
*
99
* Author: Tyche Softwares
1010
* Author URI: https://www.tychesoftwares.com/
@@ -44,7 +44,7 @@ class Arconix_FAQ {
4444
* @since 1.6.0
4545
*/
4646
public function __construct() {
47-
$this->version = '1.9.2';
47+
$this->version = '1.9.3';
4848
$this->inc = trailingslashit( plugin_dir_path( __FILE__ ) . '/includes' );
4949
$this->load_dependencies();
5050
$this->load_admin();

readme.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: jgardner03, tychesoftwares, shasvat
33
Tags: arconix, faq, toggle, accordion, faq plugin, frequently asked questions
44
Requires at least: 3.8
5-
Tested up to: 5.7
5+
Tested up to: 6.4.3
66
Stable tag: trunk
77

88
Arconix FAQ provides an easy way to add FAQ items to your website.
@@ -101,6 +101,9 @@ That's fantastic! Feel free to open an issue or submit a pull request over at [G
101101

102102
== Changelog ==
103103

104+
= 1.9.3 =
105+
* Fix - Cross Site Request Forgery (CSRF) vulnerability.
106+
104107
= 1.9.2 =
105108
* Compatibility with WordPress 5.5
106109

0 commit comments

Comments
 (0)