Prevent XSS Vulnerability

설명

This plugin helps safeguard your website against two common types of Cross-Site Scripting (XSS) vulnerabilities:

  • Reflected XSS: This happens when harmful scripts are hidden in a website’s URL. If a user clicks a link with such a script, it can run in their browser, potentially stealing their data or taking control of their system.
  • Self-XSS: This occurs when a user’s own input on your website is displayed back to them in an unsafe way, allowing malicious scripts to run in their browser.

This plugin provides several layers of protection:

Blocking: When active, the plugin checks URLs for specific characters. If it finds any of these characters in the URL, it redirects the user to prevent a potential XSS attack. You can customize which characters to block or allow.

  • Opening Round Bracket (
  • Closing Round Bracket )
  • Less than Sign <
  • Greater than Sign >
  • Opening Square Bracket [
  • Closing Square Bracket ]
  • Opening Curly Bracket {
  • Pipe or Vertical Bar |
  • Closing Curly Bracket }

Encoding: For an extra layer of security, the plugin encodes certain characters found in URL parameters. This stops harmful code from running, even if it’s present in the URL. You can also choose to exclude specific parameters from being encoded.

  • Exclamation Mark !
  • Double Quotation "
  • Single Quotation '
  • Opening Round Bracket (
  • Closing Round Bracket )
  • Asterisk Sign *
  • Less than Sign <
  • Greater than Sign >
  • Grave Accent “`
  • Cap Sign ^
  • Opening Square Bracket [
  • Closing Square Bracket ]
  • Opening Curly Bracket {
  • Pipe or Vertical Bar |
  • Closing Curly Bracket }

Escaping HTML in $_GET: This plugin automatically makes HTML characters safe within the $_GET variable. This is vital if your website pulls data from URLs and displays it as part of your web page. It helps prevent malicious scripts from being injected through user-provided input.

Important Notes:

  • After activating the plugin, thoroughly test your website forms, especially if you use WooCommerce. Make sure the plugin doesn’t interfere with your shopping cart and checkout processes.
  • We welcome bug reports for this plugin on GitHub: https://github.com/samiahmedsiddiqui/prevent-xss-vulnerability/issues. Please remember that GitHub is for bug reports only, not general support.

By using this plugin and following these recommendations, you can significantly improve your website’s defense against XSS attacks.

스크린샷

  • It removes the parameters from the URL which are used in XSS Attack and redirects the user (Recommended).

  • It encodes the parameters from the URL which are used in XSS Attack.

  • It escapes the HTML from the $_GET PHP variable which is mostly used to read the data from the URL (Recommended).

  • Add the message in developer console for the user to alert about the XSS attack.

  • Show message in developer console to alert user about the Self-XSS attack. This message can be customized from the settings page.

설치

You can install this plugin either through your WordPress dashboard or manually via FTP.

From within WordPress

  1. Go to ‘Plugins > Add New’.
  2. Search for Prevent XSS Vulnerability.
  3. Click “Activate” for Prevent XSS Vulnerability on your Plugins page.
  4. Then, follow the after activation steps below.

Manually

  1. Upload the prevent-xss-vulnerability folder to the /wp-content/plugins/ directory.
  2. Activate Prevent XSS Vulnerability through the ‘Plugins’ menu in WordPress.
  3. Then, follow the after activation steps below.

After activation

  1. Go to the Prevent XSS Vulnerability page in your WordPress Admin Dashboard.
  2. Adjust the settings to fit your website’s needs.
  3. That’s it! You’re done.

FAQ

Q. Why should I install this plugin?

A. Installing this plugin is the easiest way to protect your site from XSS Vulnerabilities.

Q. Does this plugin escape HTML when printing search results?

A. Yes, this plugin escapes HTML in the $_GET variable, which is often used to display data from the URL in HTML. However, if your site heavily relies on $_GET for other functions, you might need to do thorough testing to ensure everything works correctly.

Q. Does this plugin conflict with any other plugins

A. While we haven’t received reports of major conflicts, it’s always a good idea to thoroughly test your website after installing any new plugin.

후기

2021년 6월 22일 답글 1개
Thanks for the awesome plugin. it helps to fix the XSS attacks. But we need to add more special charter to include manually like exclude list. this helps for every one-> feature Request. keep rocking!!!… Regards, Saravanan
2021년 1월 22일
We were being harassed by our ISOs because the Acunetix scans kept coming back with HIGHs. Always XSS. We tried everything the report recommended as a remediation…nothing worked. This plugin should come bundled with WP. Or at the very least be added to the list of recommendations Acunetix suggests. Thank you for creating and sharing it.
2019년 12월 4일
We were directed by a security researcher to an XSS vulnerability on our site, and this plugin seems to have solved the issue. Only plugin with this functionality I was able to find. Fairly straightforward and flexible.
모든 7 평가 읽기

기여자 & 개발자

“Prevent XSS Vulnerability”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“Prevent XSS Vulnerability”(이)가 1 개 언어로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Prevent XSS Vulnerability”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

2.1.0 – July 03, 2025

  • Key Changes & Improvements:
    • Enhanced Console Visibility: The prominent “Stop!” message now appears in a much larger (48px), bold, red font with a black text shadow to grab immediate attention. The main warning message also uses a larger, more readable font (20px).
    • Improved Console Grouping: The entire Self-XSS warning is now grouped within a console.group('Self-XSS Warning') block. This keeps all related messages together in the developer console, making the warning stand out and preventing it from getting lost among other console output.

Earlier versions

  • For a detailed changelog of earlier versions, please refer to the separate changelog.txt file.