Changeset 3212153
- Timestamp:
- 12/23/2024 12:06:24 PM (16 months ago)
- Location:
- prevent-xss-vulnerability
- Files:
-
- 6 added
- 6 deleted
- 10 edited
- 9 copied
-
tags/2.0.2 (copied) (copied from prevent-xss-vulnerability/trunk)
-
tags/2.0.2/admin/class-prevent-xss-vulnerability-admin.php (modified) (4 diffs)
-
tags/2.0.2/admin/class-prevent-xss-vulnerability-reflected-settings.php (modified) (11 diffs)
-
tags/2.0.2/admin/class-prevent-xss-vulnerability-self-settings.php (modified) (4 diffs)
-
tags/2.0.2/admin/index.php (copied) (copied from prevent-xss-vulnerability/trunk/admin/index.php)
-
tags/2.0.2/assets/css/about-plugins-2.0.0.min.css (deleted)
-
tags/2.0.2/assets/css/about-plugins-2.0.2.min.css (added)
-
tags/2.0.2/assets/css/admin-style-2.0.0.min.css (deleted)
-
tags/2.0.2/assets/css/admin-style-2.0.2.min.css (added)
-
tags/2.0.2/assets/js/script-2.0.0.min.js (deleted)
-
tags/2.0.2/assets/js/script-2.0.2.min.js (added)
-
tags/2.0.2/changelog.txt (copied) (copied from prevent-xss-vulnerability/trunk/changelog.txt) (1 diff)
-
tags/2.0.2/includes/class-prevent-xss-vulnerability-frontend.php (copied) (copied from prevent-xss-vulnerability/trunk/includes/class-prevent-xss-vulnerability-frontend.php)
-
tags/2.0.2/includes/class-prevent-xss-vulnerability.php (copied) (copied from prevent-xss-vulnerability/trunk/includes/class-prevent-xss-vulnerability.php) (1 diff)
-
tags/2.0.2/includes/index.php (copied) (copied from prevent-xss-vulnerability/trunk/includes/index.php)
-
tags/2.0.2/index.php (copied) (copied from prevent-xss-vulnerability/trunk/index.php)
-
tags/2.0.2/prevent-xss-vulnerability.php (copied) (copied from prevent-xss-vulnerability/trunk/prevent-xss-vulnerability.php) (2 diffs)
-
tags/2.0.2/readme.txt (copied) (copied from prevent-xss-vulnerability/trunk/readme.txt) (5 diffs)
-
trunk/admin/class-prevent-xss-vulnerability-admin.php (modified) (4 diffs)
-
trunk/admin/class-prevent-xss-vulnerability-reflected-settings.php (modified) (11 diffs)
-
trunk/admin/class-prevent-xss-vulnerability-self-settings.php (modified) (4 diffs)
-
trunk/assets/css/about-plugins-2.0.1.min.css (deleted)
-
trunk/assets/css/about-plugins-2.0.2.min.css (added)
-
trunk/assets/css/admin-style-2.0.1.min.css (deleted)
-
trunk/assets/css/admin-style-2.0.2.min.css (added)
-
trunk/assets/js/script-2.0.1.min.js (deleted)
-
trunk/assets/js/script-2.0.2.min.js (added)
-
trunk/changelog.txt (modified) (1 diff)
-
trunk/includes/class-prevent-xss-vulnerability.php (modified) (1 diff)
-
trunk/prevent-xss-vulnerability.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
prevent-xss-vulnerability/tags/2.0.2/admin/class-prevent-xss-vulnerability-admin.php
r2564460 r3212153 40 40 'Prevent XSS Vulnerability', 41 41 'Prevent XSS Vulnerability', 42 'a dministrator',42 'activate_plugins', 43 43 'prevent-xss-vulnerability-reflected-settings', 44 44 array( $this, 'reflected_settings' ), … … 49 49 'Reflected Cross-site scripting Settings', 50 50 'Reflected XSS', 51 'a dministrator',51 'activate_plugins', 52 52 'prevent-xss-vulnerability-reflected-settings', 53 53 array( $this, 'reflected_settings' ) … … 57 57 'Self Cross-site scripting Settings', 58 58 'Self-XSS', 59 'a dministrator',59 'activate_plugins', 60 60 'prevent-xss-vulnerability-self-settings', 61 61 array( $this, 'self_xss_settings' ) … … 65 65 'About Cross-site scripting', 66 66 'About', 67 'a dministrator',67 'activate_plugins', 68 68 'prevent-xss-vulnerability-about', 69 69 array( $this, 'about_xss' ) -
prevent-xss-vulnerability/tags/2.0.2/admin/class-prevent-xss-vulnerability-reflected-settings.php
r2564460 r3212153 46 46 <?php 47 47 esc_html_e( 48 'This Plugin Block/Remove the following Entities in the URL:',48 'This plugin blocks or removes the following entities from website URLs:', 49 49 'prevent-xss-vulnerability' 50 50 ); … … 149 149 <?php 150 150 esc_html_e( 151 'This Plugin Encodes the following Entities in the URL:',151 'This plugin encodes the following entities within website URLs:', 152 152 'prevent-xss-vulnerability' 153 153 ); … … 305 305 * 306 306 * @param string $enabled Whether the escape is enabled or not. 307 *308 * @return void309 307 */ 310 308 private function get_escape_output( $enabled ) { … … 320 318 <?php 321 319 esc_html_e( 322 'It strips the HTML in $_GET variable in PHP. So, where ever the $_GET is used in either theme or plugin will get the escaped HTML. It prevents the XSS Attack using HTML and JS Events. If any plugin directly fetching the parameters from the URL without using $_GET variable will get the values without HTML escaped.', 320 'This plugin strips HTML tags from the $_GET variable in PHP. Consequently, any part of your theme or plugin that utilizes $_GET to retrieve data from the URL will receive the HTML-escaped value. This effectively prevents XSS attacks that exploit HTML and JavaScript events.', 321 'prevent-xss-vulnerability' 322 ); 323 ?> 324 </p> 325 326 <p> 327 <?php 328 esc_html_e( 329 'Important Note: If any plugin or custom code directly fetches URL parameters without using the $_GET variable, the retrieved values will not be HTML-escaped by this plugin.', 323 330 'prevent-xss-vulnerability' 324 331 ); … … 343 350 344 351 /** 345 * Generate Reflec cted page note HTML352 * Generate Reflected page note HTML. 346 353 * 347 354 * @access private … … 354 361 <?php 355 362 esc_html_e( 356 'Reflected Cross-site Scripting (XSS) occur when an attacker injects browser executable code within a single HTTP response. You can read more about XSS from',363 'Reflected XSS occurs when malicious code is injected into a website\'s URL. This code can then be executed by a user\'s browser, potentially stealing information or compromising their system. For more information on XSS, please visit', 357 364 'prevent-xss-vulnerability' 358 365 ); … … 371 378 <?php 372 379 esc_html_e( 373 'After configuring the settings please check some pages randomly to verify that your site isworking as expected.',380 'After configuring these settings, please thoroughly test your website by randomly navigating through different pages to ensure all functionalities are working as expected.', 374 381 'prevent-xss-vulnerability' 375 382 ); … … 379 386 <?php 380 387 esc_html_e( 381 'If you are using WooCommerce, then in that case it is highly recommended to go through with all the steps of the Product Purchase (Cart, Checkout etc) to make sure that your online store is working fine.',388 'If you are using WooCommerce, it is crucial to test the entire product purchase process, including cart, checkout, and order completion, to verify that the plugin does not interfere with any core functionalities of your online store.', 382 389 'prevent-xss-vulnerability' 383 390 ); … … 396 403 * @access private 397 404 * @since 1.0.0 398 *399 * @return void400 405 */ 401 406 private function save_reflected_settings() { … … 469 474 * @access private 470 475 * @since 0.1 471 *472 * @return void473 476 */ 474 477 private function xss_reflected_settings() { … … 523 526 <h2> 524 527 <?php 525 esc_html_e( 'Reflected Cross-site scripting(XSS) Settings', 'prevent-xss-vulnerability' );528 esc_html_e( 'Reflected Cross-site Scripting (XSS) Settings', 'prevent-xss-vulnerability' ); 526 529 ?> 527 530 </h2> -
prevent-xss-vulnerability/tags/2.0.2/admin/class-prevent-xss-vulnerability-self-settings.php
r2564460 r3212153 22 22 * @access private 23 23 * @since 1.0.0 24 *25 * @return void26 24 */ 27 25 private function save_self_xss_settings() { … … 59 57 * @access private 60 58 * @since 0.3.0 61 *62 * @return void63 59 */ 64 60 private function self_xss_settings_page() { 65 if ( ! current_user_can( 'a dministrator' ) ) {61 if ( ! current_user_can( 'activate_plugins' ) ) { 66 62 wp_die( 67 63 esc_html_e( … … 98 94 <div class="wrap"> 99 95 <h2> 100 <?php 101 esc_html_e( 'Self-XSS Settings', 'prevent-xss-vulnerability' ); 102 ?> 96 <?php esc_html_e( 'Self-XSS Settings', 'prevent-xss-vulnerability' ); ?> 103 97 </h2> 104 98 <div> 105 <p> 106 <?php 107 esc_html_e( 'Self-XSS is a social engineering attack used to gain control of victims\' web accounts. In a self-XSS attack, the victim of the attack unknowingly runs malicious code in their own web browser, thus exposing it to the attacker.', 'prevent-xss-vulnerability' ); 108 ?> 109 </p> 99 <p> 100 <?php 101 esc_html_e( 'Self-XSS is a type of security vulnerability where an attacker tricks a user into executing malicious code within their own web browser. This can occur through social engineering tactics, such as convincing the user to copy and paste malicious code into their browser\'s console.', 'prevent-xss-vulnerability' ); 102 ?> 103 </p> 104 <p> 105 <?php 106 esc_html_e( 'Here\'s a breakdown of how it works:', 'prevent-xss-vulnerability' ); 107 ?> 108 </p> 109 <ol> 110 <li> 111 <?php 112 esc_html_e( 'Social Engineering: The attacker employs social engineering techniques (e.g., phishing, promises of rewards) to convince the victim to perform a specific action.', 'prevent-xss-vulnerability' ); 113 ?> 114 </li> 115 <li> 116 <?php 117 esc_html_e( 'Code Execution: The victim is tricked into executing the malicious code, often by pasting it into the browser\'s console or through other means.', 'prevent-xss-vulnerability' ); 118 ?> 119 </li> 120 <li> 121 <?php 122 esc_html_e( 'Compromised Browser: Once executed, the malicious code can potentially steal sensitive information, hijack user sessions, or spread malware.', 'prevent-xss-vulnerability' ); 123 ?> 124 </li> 125 </ol> 126 127 <p> 128 <?php 129 esc_html_e( 'Self-XSS attacks exploit user trust and curiosity. It\'s crucial for users to be vigilant and avoid executing any code they don\'t fully understand or trust.', 'prevent-xss-vulnerability' ); 130 ?> 131 </p> 110 132 </div> 111 133 <form enctype="multipart/form-data" action="" method="POST" id="reflected-xss"> … … 131 153 <?php 132 154 esc_html_e( 133 ' Add warning message when users open the web developer console. Leave empty to use default.',155 'Customize the warning message that appears in the console. Leave empty to use the default message.', 134 156 'prevent-xss-vulnerability' 135 157 ); -
prevent-xss-vulnerability/tags/2.0.2/changelog.txt
r2772468 r3212153 2 2 3 3 This file contains only old changelog. See readme.txt for newer versions. 4 5 = 2.0.0 - Jul 14, 21 = 6 7 * Bug 8 * [Unable to execute bulk actions of WooCommerce orders when this plugin is enabled](https://wordpress.org/support/topic/unable-to-execute-bulk-actions-of-woocommerce-orders-when-this-plugin-is-enabled/) 9 * [Bulk actions dont work (ie bulk delete pages, images)](https://wordpress.org/support/topic/bulk-actions-dont-work-ie-bulk-delete-pages-images/) 10 * [Facing conflict issue while perform bulk delete option on post](https://wordpress.org/support/topic/facing-conflict-issue-while-perform-bulk-delete-option-on-post/) 11 12 * Enhancements 13 * [Include other/extra parameters](https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues/3) 14 * Fixed WPCS issues 4 15 5 16 = 1.0.0 - Aug 24, 20 = -
prevent-xss-vulnerability/tags/2.0.2/includes/class-prevent-xss-vulnerability.php
r2772468 r3212153 19 19 * @var string 20 20 */ 21 public $version = '2.0. 1';21 public $version = '2.0.2'; 22 22 23 23 /** -
prevent-xss-vulnerability/tags/2.0.2/prevent-xss-vulnerability.php
r2772468 r3212153 3 3 * Plugin Name: Prevent XSS Vulnerability 4 4 * Plugin URI: https://www.yasglobal.com/web-design-development/wordpress/prevent-xss-vulnerability/ 5 * Description: Secure your site from the XSS Attack. 6 * Version: 2.0.1 5 * Description: This WordPress plugin enhances website security by preventing Cross-Site Scripting (XSS) vulnerabilities. It blocks and encodes malicious characters in URLs, escapes HTML in `$_GET` variables, and provides customizable settings for website owners. 6 * Version: 2.0.2 7 * Requires at least: 3.5 8 * Requires PHP: 5.6 7 9 * Author: Sami Ahmed Siddiqui 8 10 * Author URI: https://www.linkedin.com/in/sami-ahmed-siddiqui/ 9 11 * License: GPLv3 12 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 13 * 11 14 * Text Domain: prevent-xss-vulnerability … … 16 19 17 20 /** 18 * Prevent XSS Vulnerability - Secure your website from XSS Attacks 19 * Copyright (C) 2017-202 1, Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com>21 * Prevent XSS Vulnerability - Secure your website from XSS Attacks. 22 * Copyright (C) 2017-2024, Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com> 20 23 * 21 24 * This program is free software: you can redistribute it and/or modify -
prevent-xss-vulnerability/tags/2.0.2/readme.txt
r3109212 r3212153 1 1 === Prevent XSS Vulnerability === 2 2 Contributors: sasiddiqui 3 Tags: attack, cross-site scripting, security, vulnerability, xss , self-xss3 Tags: attack, cross-site scripting, security, vulnerability, xss 4 4 Requires at least: 3.5 5 Tested up to: 6. 56 Stable tag: 2.0. 15 Tested up to: 6.7 6 Stable tag: 2.0.2 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html 9 9 10 This WordPress plugin enhances website security by preventing Cross-Site Scripting (XSS) vulnerabilities. It blocks and encodes malicious characters in URLs, escapes HTML in `$_GET` variables, and provides customizable settings for website owners. 11 10 12 == Description == 11 13 12 This plugin provides the functionality for `Reflected XSS` and `Self-XSS`.14 This plugin helps safeguard your website against two common types of Cross-Site Scripting (XSS) vulnerabilities: 13 15 14 For Reflected XSS, it checks the URL and redirects it if you enabled the `Enable Blocking` option and URL contains any Vulnerable code in it. It only block some parameters which are not allowed in URL and shown Block Parameters section. You can skip some of the parameters from it if you still like them to be used. 16 * **Reflected XSS:** In Reflected XSS, malicious scripts are injected into the URL of a website. When a user clicks on a link containing this malicious script, it can be executed on their browser, potentially stealing their information or compromising their system. 17 * **Self-XSS:** This occurs when a user's own input on the website is reflected back to them in an insecure manner, allowing malicious scripts to be executed in their browser. 15 18 16 T o provide more security, this plugin also escape the HTML in the `$_GET` parameter which is commonly used to get parameters in PHP from the URL and print them in the HTML. This way, HTML properties will not work if anyone provided it in the URL.19 This plugin provides several layers of protection: 17 20 18 There are many ways by which the plugin can be tested but it may varies for different sites according to their structure and development functionality. 19 20 === Block Parameters === 21 22 This plugin block the following parameters in the URL if enabled from the Plugin Settings page. 21 **Blocking:** When enabled, the plugin scans URLs for specific parameters. If any of the listed parameters are found in the URL, the plugin redirects the user to prevent potential XSS attacks. You can customize the list by excluding specific parameters you still want to allow. 23 22 24 23 * Opening Round Bracket `(` … … 32 31 * Closing Curly Bracket `}` 33 32 34 You can exclude any of the pre-defined parameter(s) or include any other parameter(s) from the Plugin Settings page. 35 36 === Encode Parameters === 37 38 This plugin encode the following parameters in the URL if enabled from the Plugin Settings page. 33 **Encoding:** For additional security, the plugin encodes certain characters within the URL parameters. This prevents malicious code from being executed even if it's included in the URL. You can also exclude specific parameters from being encoded. 39 34 40 35 * Exclamation Mark `!` … … 54 49 * Closing Curly Bracket `}` 55 50 56 You can exclude any of the pre-defined parameter(s) to being encoded from the Plugin Settings page.51 **Escaping HTML in `$_GET`:** This plugin automatically escapes HTML characters within the `$_GET` variable. This is crucial if your website retrieves data from URLs and displays it in the HTML content. This helps prevent malicious scripts from being injected through user-controlled input. 57 52 58 === Escape HTML in `$_GET` Variable===53 === Important Notes: === 59 54 60 This plugin escape HTML in `$_GET` variable. `$_GET` variable is mostly used to put the values in HTML from the URL. This Check is quite useful if your site using/getting anything from the URL and printing it in HTML. It secures your Search and other sections as per your site functionality. 55 * After activating the plugin, thoroughly test your website forms, especially if you use WooCommerce. Ensure the plugin doesn't disrupt your cart and checkout processes. 56 * Bug reports for this plugin are welcome on GitHub: [https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues](). Please note that GitHub is not a support forum, and only genuine bug reports will be addressed. 61 57 62 > NOTE: Make sure to check your forms after activating the plugin and if you have woocommerce site then please also check the cart and checkout process. 63 64 === Bug reports === 65 66 Bug reports for `Prevent XSS Vulnerability` are [welcomed on GitHub](https://github.com/yasglobal/prevent-xss-vulnerability). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed. 58 By implementing this plugin and following the recommendations, you can significantly enhance your website's security against XSS attacks. 67 59 68 60 == Installation == … … 104 96 105 97 = Q. Why should I install this plugin? = 106 A. Installing this plugin is the easiest way to prevent your site from XSS Vulnerability. 98 99 A. Installing this plugin is the easiest way to protect your site from XSS Vulnerabilities. 107 100 108 101 = Q. Does this plugin escape HTML in printing search? = 109 A. Yes, this plugin escape HTML in `$_GET` variable which is mostly use to print the data from the URL to HTML. If your site is using `$_GET` then it is safe and the HTML will be escaped otherwise you need to check.110 102 111 = Q. Does this plugin has any conflict with any other plugin? = 112 A. No, this plugin doesn't have any conflict with any plugin. 103 A. Yes, this plugin escapes HTML in `$_GET` variable, which is commonly used to print data from the URL to HTML. However, if your site relies heavily on `$_GET` for other purposes, you may need to conduct thorough testing to ensure compatibility. 104 105 = Q. Does this plugin have any conflict with any other plugin? = 106 107 A. While no major conflicts have been reported, it's always a good practice to test your website thoroughly after installing any new plugin. 113 108 114 109 == Changelog == 110 111 = 2.0.2 - Dec 23, 24 = 112 113 Fix minor WPCS issues and change text for better understanding. 115 114 116 115 = 2.0.1 - Aug 19, 22 = … … 119 118 * [Please fix Notices for use in WP_DEBUG mode](https://wordpress.org/support/topic/please-fix-notices-for-use-in-wp_debug-mode/) 120 119 121 = 2.0.0 - Jul 14, 21 =122 123 * Bug124 * [Unable to execute bulk actions of WooCommerce orders when this plugin is enabled](https://wordpress.org/support/topic/unable-to-execute-bulk-actions-of-woocommerce-orders-when-this-plugin-is-enabled/)125 * [Bulk actions dont work (ie bulk delete pages, images)](https://wordpress.org/support/topic/bulk-actions-dont-work-ie-bulk-delete-pages-images/)126 * [Facing conflict issue while perform bulk delete option on post](https://wordpress.org/support/topic/facing-conflict-issue-while-perform-bulk-delete-option-on-post/)127 128 * Enhancements129 * [Include other/extra parameters](https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues/3)130 * Fixed WPCS issues131 132 120 = Earlier versions = 133 121 -
prevent-xss-vulnerability/trunk/admin/class-prevent-xss-vulnerability-admin.php
r2564460 r3212153 40 40 'Prevent XSS Vulnerability', 41 41 'Prevent XSS Vulnerability', 42 'a dministrator',42 'activate_plugins', 43 43 'prevent-xss-vulnerability-reflected-settings', 44 44 array( $this, 'reflected_settings' ), … … 49 49 'Reflected Cross-site scripting Settings', 50 50 'Reflected XSS', 51 'a dministrator',51 'activate_plugins', 52 52 'prevent-xss-vulnerability-reflected-settings', 53 53 array( $this, 'reflected_settings' ) … … 57 57 'Self Cross-site scripting Settings', 58 58 'Self-XSS', 59 'a dministrator',59 'activate_plugins', 60 60 'prevent-xss-vulnerability-self-settings', 61 61 array( $this, 'self_xss_settings' ) … … 65 65 'About Cross-site scripting', 66 66 'About', 67 'a dministrator',67 'activate_plugins', 68 68 'prevent-xss-vulnerability-about', 69 69 array( $this, 'about_xss' ) -
prevent-xss-vulnerability/trunk/admin/class-prevent-xss-vulnerability-reflected-settings.php
r2564460 r3212153 46 46 <?php 47 47 esc_html_e( 48 'This Plugin Block/Remove the following Entities in the URL:',48 'This plugin blocks or removes the following entities from website URLs:', 49 49 'prevent-xss-vulnerability' 50 50 ); … … 149 149 <?php 150 150 esc_html_e( 151 'This Plugin Encodes the following Entities in the URL:',151 'This plugin encodes the following entities within website URLs:', 152 152 'prevent-xss-vulnerability' 153 153 ); … … 305 305 * 306 306 * @param string $enabled Whether the escape is enabled or not. 307 *308 * @return void309 307 */ 310 308 private function get_escape_output( $enabled ) { … … 320 318 <?php 321 319 esc_html_e( 322 'It strips the HTML in $_GET variable in PHP. So, where ever the $_GET is used in either theme or plugin will get the escaped HTML. It prevents the XSS Attack using HTML and JS Events. If any plugin directly fetching the parameters from the URL without using $_GET variable will get the values without HTML escaped.', 320 'This plugin strips HTML tags from the $_GET variable in PHP. Consequently, any part of your theme or plugin that utilizes $_GET to retrieve data from the URL will receive the HTML-escaped value. This effectively prevents XSS attacks that exploit HTML and JavaScript events.', 321 'prevent-xss-vulnerability' 322 ); 323 ?> 324 </p> 325 326 <p> 327 <?php 328 esc_html_e( 329 'Important Note: If any plugin or custom code directly fetches URL parameters without using the $_GET variable, the retrieved values will not be HTML-escaped by this plugin.', 323 330 'prevent-xss-vulnerability' 324 331 ); … … 343 350 344 351 /** 345 * Generate Reflec cted page note HTML352 * Generate Reflected page note HTML. 346 353 * 347 354 * @access private … … 354 361 <?php 355 362 esc_html_e( 356 'Reflected Cross-site Scripting (XSS) occur when an attacker injects browser executable code within a single HTTP response. You can read more about XSS from',363 'Reflected XSS occurs when malicious code is injected into a website\'s URL. This code can then be executed by a user\'s browser, potentially stealing information or compromising their system. For more information on XSS, please visit', 357 364 'prevent-xss-vulnerability' 358 365 ); … … 371 378 <?php 372 379 esc_html_e( 373 'After configuring the settings please check some pages randomly to verify that your site isworking as expected.',380 'After configuring these settings, please thoroughly test your website by randomly navigating through different pages to ensure all functionalities are working as expected.', 374 381 'prevent-xss-vulnerability' 375 382 ); … … 379 386 <?php 380 387 esc_html_e( 381 'If you are using WooCommerce, then in that case it is highly recommended to go through with all the steps of the Product Purchase (Cart, Checkout etc) to make sure that your online store is working fine.',388 'If you are using WooCommerce, it is crucial to test the entire product purchase process, including cart, checkout, and order completion, to verify that the plugin does not interfere with any core functionalities of your online store.', 382 389 'prevent-xss-vulnerability' 383 390 ); … … 396 403 * @access private 397 404 * @since 1.0.0 398 *399 * @return void400 405 */ 401 406 private function save_reflected_settings() { … … 469 474 * @access private 470 475 * @since 0.1 471 *472 * @return void473 476 */ 474 477 private function xss_reflected_settings() { … … 523 526 <h2> 524 527 <?php 525 esc_html_e( 'Reflected Cross-site scripting(XSS) Settings', 'prevent-xss-vulnerability' );528 esc_html_e( 'Reflected Cross-site Scripting (XSS) Settings', 'prevent-xss-vulnerability' ); 526 529 ?> 527 530 </h2> -
prevent-xss-vulnerability/trunk/admin/class-prevent-xss-vulnerability-self-settings.php
r2564460 r3212153 22 22 * @access private 23 23 * @since 1.0.0 24 *25 * @return void26 24 */ 27 25 private function save_self_xss_settings() { … … 59 57 * @access private 60 58 * @since 0.3.0 61 *62 * @return void63 59 */ 64 60 private function self_xss_settings_page() { 65 if ( ! current_user_can( 'a dministrator' ) ) {61 if ( ! current_user_can( 'activate_plugins' ) ) { 66 62 wp_die( 67 63 esc_html_e( … … 98 94 <div class="wrap"> 99 95 <h2> 100 <?php 101 esc_html_e( 'Self-XSS Settings', 'prevent-xss-vulnerability' ); 102 ?> 96 <?php esc_html_e( 'Self-XSS Settings', 'prevent-xss-vulnerability' ); ?> 103 97 </h2> 104 98 <div> 105 <p> 106 <?php 107 esc_html_e( 'Self-XSS is a social engineering attack used to gain control of victims\' web accounts. In a self-XSS attack, the victim of the attack unknowingly runs malicious code in their own web browser, thus exposing it to the attacker.', 'prevent-xss-vulnerability' ); 108 ?> 109 </p> 99 <p> 100 <?php 101 esc_html_e( 'Self-XSS is a type of security vulnerability where an attacker tricks a user into executing malicious code within their own web browser. This can occur through social engineering tactics, such as convincing the user to copy and paste malicious code into their browser\'s console.', 'prevent-xss-vulnerability' ); 102 ?> 103 </p> 104 <p> 105 <?php 106 esc_html_e( 'Here\'s a breakdown of how it works:', 'prevent-xss-vulnerability' ); 107 ?> 108 </p> 109 <ol> 110 <li> 111 <?php 112 esc_html_e( 'Social Engineering: The attacker employs social engineering techniques (e.g., phishing, promises of rewards) to convince the victim to perform a specific action.', 'prevent-xss-vulnerability' ); 113 ?> 114 </li> 115 <li> 116 <?php 117 esc_html_e( 'Code Execution: The victim is tricked into executing the malicious code, often by pasting it into the browser\'s console or through other means.', 'prevent-xss-vulnerability' ); 118 ?> 119 </li> 120 <li> 121 <?php 122 esc_html_e( 'Compromised Browser: Once executed, the malicious code can potentially steal sensitive information, hijack user sessions, or spread malware.', 'prevent-xss-vulnerability' ); 123 ?> 124 </li> 125 </ol> 126 127 <p> 128 <?php 129 esc_html_e( 'Self-XSS attacks exploit user trust and curiosity. It\'s crucial for users to be vigilant and avoid executing any code they don\'t fully understand or trust.', 'prevent-xss-vulnerability' ); 130 ?> 131 </p> 110 132 </div> 111 133 <form enctype="multipart/form-data" action="" method="POST" id="reflected-xss"> … … 131 153 <?php 132 154 esc_html_e( 133 ' Add warning message when users open the web developer console. Leave empty to use default.',155 'Customize the warning message that appears in the console. Leave empty to use the default message.', 134 156 'prevent-xss-vulnerability' 135 157 ); -
prevent-xss-vulnerability/trunk/changelog.txt
r2772468 r3212153 2 2 3 3 This file contains only old changelog. See readme.txt for newer versions. 4 5 = 2.0.0 - Jul 14, 21 = 6 7 * Bug 8 * [Unable to execute bulk actions of WooCommerce orders when this plugin is enabled](https://wordpress.org/support/topic/unable-to-execute-bulk-actions-of-woocommerce-orders-when-this-plugin-is-enabled/) 9 * [Bulk actions dont work (ie bulk delete pages, images)](https://wordpress.org/support/topic/bulk-actions-dont-work-ie-bulk-delete-pages-images/) 10 * [Facing conflict issue while perform bulk delete option on post](https://wordpress.org/support/topic/facing-conflict-issue-while-perform-bulk-delete-option-on-post/) 11 12 * Enhancements 13 * [Include other/extra parameters](https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues/3) 14 * Fixed WPCS issues 4 15 5 16 = 1.0.0 - Aug 24, 20 = -
prevent-xss-vulnerability/trunk/includes/class-prevent-xss-vulnerability.php
r2772468 r3212153 19 19 * @var string 20 20 */ 21 public $version = '2.0. 1';21 public $version = '2.0.2'; 22 22 23 23 /** -
prevent-xss-vulnerability/trunk/prevent-xss-vulnerability.php
r2772468 r3212153 3 3 * Plugin Name: Prevent XSS Vulnerability 4 4 * Plugin URI: https://www.yasglobal.com/web-design-development/wordpress/prevent-xss-vulnerability/ 5 * Description: Secure your site from the XSS Attack. 6 * Version: 2.0.1 5 * Description: This WordPress plugin enhances website security by preventing Cross-Site Scripting (XSS) vulnerabilities. It blocks and encodes malicious characters in URLs, escapes HTML in `$_GET` variables, and provides customizable settings for website owners. 6 * Version: 2.0.2 7 * Requires at least: 3.5 8 * Requires PHP: 5.6 7 9 * Author: Sami Ahmed Siddiqui 8 10 * Author URI: https://www.linkedin.com/in/sami-ahmed-siddiqui/ 9 11 * License: GPLv3 12 * License URI: https://www.gnu.org/licenses/gpl-3.0.html 10 13 * 11 14 * Text Domain: prevent-xss-vulnerability … … 16 19 17 20 /** 18 * Prevent XSS Vulnerability - Secure your website from XSS Attacks 19 * Copyright (C) 2017-202 1, Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com>21 * Prevent XSS Vulnerability - Secure your website from XSS Attacks. 22 * Copyright (C) 2017-2024, Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com> 20 23 * 21 24 * This program is free software: you can redistribute it and/or modify -
prevent-xss-vulnerability/trunk/readme.txt
r3109212 r3212153 1 1 === Prevent XSS Vulnerability === 2 2 Contributors: sasiddiqui 3 Tags: attack, cross-site scripting, security, vulnerability, xss , self-xss3 Tags: attack, cross-site scripting, security, vulnerability, xss 4 4 Requires at least: 3.5 5 Tested up to: 6. 56 Stable tag: 2.0. 15 Tested up to: 6.7 6 Stable tag: 2.0.2 7 7 License: GPLv3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html 9 9 10 This WordPress plugin enhances website security by preventing Cross-Site Scripting (XSS) vulnerabilities. It blocks and encodes malicious characters in URLs, escapes HTML in `$_GET` variables, and provides customizable settings for website owners. 11 10 12 == Description == 11 13 12 This plugin provides the functionality for `Reflected XSS` and `Self-XSS`.14 This plugin helps safeguard your website against two common types of Cross-Site Scripting (XSS) vulnerabilities: 13 15 14 For Reflected XSS, it checks the URL and redirects it if you enabled the `Enable Blocking` option and URL contains any Vulnerable code in it. It only block some parameters which are not allowed in URL and shown Block Parameters section. You can skip some of the parameters from it if you still like them to be used. 16 * **Reflected XSS:** In Reflected XSS, malicious scripts are injected into the URL of a website. When a user clicks on a link containing this malicious script, it can be executed on their browser, potentially stealing their information or compromising their system. 17 * **Self-XSS:** This occurs when a user's own input on the website is reflected back to them in an insecure manner, allowing malicious scripts to be executed in their browser. 15 18 16 T o provide more security, this plugin also escape the HTML in the `$_GET` parameter which is commonly used to get parameters in PHP from the URL and print them in the HTML. This way, HTML properties will not work if anyone provided it in the URL.19 This plugin provides several layers of protection: 17 20 18 There are many ways by which the plugin can be tested but it may varies for different sites according to their structure and development functionality. 19 20 === Block Parameters === 21 22 This plugin block the following parameters in the URL if enabled from the Plugin Settings page. 21 **Blocking:** When enabled, the plugin scans URLs for specific parameters. If any of the listed parameters are found in the URL, the plugin redirects the user to prevent potential XSS attacks. You can customize the list by excluding specific parameters you still want to allow. 23 22 24 23 * Opening Round Bracket `(` … … 32 31 * Closing Curly Bracket `}` 33 32 34 You can exclude any of the pre-defined parameter(s) or include any other parameter(s) from the Plugin Settings page. 35 36 === Encode Parameters === 37 38 This plugin encode the following parameters in the URL if enabled from the Plugin Settings page. 33 **Encoding:** For additional security, the plugin encodes certain characters within the URL parameters. This prevents malicious code from being executed even if it's included in the URL. You can also exclude specific parameters from being encoded. 39 34 40 35 * Exclamation Mark `!` … … 54 49 * Closing Curly Bracket `}` 55 50 56 You can exclude any of the pre-defined parameter(s) to being encoded from the Plugin Settings page.51 **Escaping HTML in `$_GET`:** This plugin automatically escapes HTML characters within the `$_GET` variable. This is crucial if your website retrieves data from URLs and displays it in the HTML content. This helps prevent malicious scripts from being injected through user-controlled input. 57 52 58 === Escape HTML in `$_GET` Variable===53 === Important Notes: === 59 54 60 This plugin escape HTML in `$_GET` variable. `$_GET` variable is mostly used to put the values in HTML from the URL. This Check is quite useful if your site using/getting anything from the URL and printing it in HTML. It secures your Search and other sections as per your site functionality. 55 * After activating the plugin, thoroughly test your website forms, especially if you use WooCommerce. Ensure the plugin doesn't disrupt your cart and checkout processes. 56 * Bug reports for this plugin are welcome on GitHub: [https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues](). Please note that GitHub is not a support forum, and only genuine bug reports will be addressed. 61 57 62 > NOTE: Make sure to check your forms after activating the plugin and if you have woocommerce site then please also check the cart and checkout process. 63 64 === Bug reports === 65 66 Bug reports for `Prevent XSS Vulnerability` are [welcomed on GitHub](https://github.com/yasglobal/prevent-xss-vulnerability). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed. 58 By implementing this plugin and following the recommendations, you can significantly enhance your website's security against XSS attacks. 67 59 68 60 == Installation == … … 104 96 105 97 = Q. Why should I install this plugin? = 106 A. Installing this plugin is the easiest way to prevent your site from XSS Vulnerability. 98 99 A. Installing this plugin is the easiest way to protect your site from XSS Vulnerabilities. 107 100 108 101 = Q. Does this plugin escape HTML in printing search? = 109 A. Yes, this plugin escape HTML in `$_GET` variable which is mostly use to print the data from the URL to HTML. If your site is using `$_GET` then it is safe and the HTML will be escaped otherwise you need to check.110 102 111 = Q. Does this plugin has any conflict with any other plugin? = 112 A. No, this plugin doesn't have any conflict with any plugin. 103 A. Yes, this plugin escapes HTML in `$_GET` variable, which is commonly used to print data from the URL to HTML. However, if your site relies heavily on `$_GET` for other purposes, you may need to conduct thorough testing to ensure compatibility. 104 105 = Q. Does this plugin have any conflict with any other plugin? = 106 107 A. While no major conflicts have been reported, it's always a good practice to test your website thoroughly after installing any new plugin. 113 108 114 109 == Changelog == 110 111 = 2.0.2 - Dec 23, 24 = 112 113 Fix minor WPCS issues and change text for better understanding. 115 114 116 115 = 2.0.1 - Aug 19, 22 = … … 119 118 * [Please fix Notices for use in WP_DEBUG mode](https://wordpress.org/support/topic/please-fix-notices-for-use-in-wp_debug-mode/) 120 119 121 = 2.0.0 - Jul 14, 21 =122 123 * Bug124 * [Unable to execute bulk actions of WooCommerce orders when this plugin is enabled](https://wordpress.org/support/topic/unable-to-execute-bulk-actions-of-woocommerce-orders-when-this-plugin-is-enabled/)125 * [Bulk actions dont work (ie bulk delete pages, images)](https://wordpress.org/support/topic/bulk-actions-dont-work-ie-bulk-delete-pages-images/)126 * [Facing conflict issue while perform bulk delete option on post](https://wordpress.org/support/topic/facing-conflict-issue-while-perform-bulk-delete-option-on-post/)127 128 * Enhancements129 * [Include other/extra parameters](https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues/3)130 * Fixed WPCS issues131 132 120 = Earlier versions = 133 121
Note: See TracChangeset
for help on using the changeset viewer.