CVE-2021-38341: CWE-79 Cross-site Scripting (XSS) in WooCommerce Payment Gateway Per Category WooCommerce Payment Gateway Per Category
The WooCommerce Payment Gateway Per Category WordPress plugin is vulnerable to Reflected Cross-Site Scripting due to a reflected $_SERVER["PHP_SELF"] value in the ~/includes/plugin_settings.php file which allows attackers to inject arbitrary web scripts, in versions up to and including 2.0.10.
AI Analysis
Technical Summary
CVE-2021-38341 is a Reflected Cross-Site Scripting (XSS) vulnerability identified in the WooCommerce Payment Gateway Per Category WordPress plugin, specifically affecting versions up to and including 2.0.10. The vulnerability arises from improper handling of the $_SERVER["PHP_SELF"] variable in the ~/includes/plugin_settings.php file. This variable reflects the current script's filename and path, and when not properly sanitized, it can be manipulated by attackers to inject arbitrary malicious JavaScript code. When a victim visits a crafted URL exploiting this vulnerability, the injected script executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or unauthorized actions performed on behalf of the user. The vulnerability is classified under CWE-79, which covers Cross-Site Scripting issues. The CVSS 3.1 base score is 6.1 (medium severity), with the vector indicating network attack vector (AV:N), low attack complexity (AC:L), no privileges required (PR:N), user interaction required (UI:R), scope changed (S:C), and low impact on confidentiality and integrity (C:L/I:L), with no impact on availability (A:N). No known exploits have been reported in the wild, and no official patches are linked in the provided data, suggesting that users must verify plugin updates or apply manual mitigations. The vulnerability affects the plugin's settings page, which is typically accessed by administrators or users with elevated privileges, but the reflected XSS can be triggered by any user visiting a crafted URL, making it a risk for site visitors and administrators alike.
Potential Impact
For European organizations using WooCommerce with the Payment Gateway Per Category plugin, this vulnerability poses a moderate risk. Exploitation could allow attackers to execute malicious scripts in the browsers of site administrators or customers, potentially leading to theft of authentication cookies, session tokens, or other sensitive information. This could result in unauthorized access to administrative functions or customer accounts, leading to data breaches or fraudulent transactions. Given WooCommerce's widespread use in European e-commerce, particularly among small and medium-sized enterprises, the vulnerability could undermine customer trust and lead to financial losses. The reflected nature of the XSS means attackers must entice victims to click on malicious links, which may limit large-scale automated exploitation but still poses targeted phishing risks. The scope change in the CVSS vector indicates that the vulnerability can affect resources beyond the vulnerable component, potentially impacting the entire website's security posture. While availability is not impacted, the integrity and confidentiality risks are significant enough to warrant attention, especially for organizations handling payment data subject to GDPR regulations, where data breaches can lead to substantial fines and reputational damage.
Mitigation Recommendations
1. Immediate upgrade: Organizations should verify if a newer version of the WooCommerce Payment Gateway Per Category plugin is available that addresses CVE-2021-38341 and apply the update promptly. 2. Input sanitization: If an update is not available, implement manual input validation and sanitization on the $_SERVER["PHP_SELF"] variable within the plugin's code to neutralize script injection vectors. 3. Web Application Firewall (WAF): Deploy or update WAF rules to detect and block malicious payloads targeting the vulnerable parameter, focusing on typical XSS attack patterns in URLs. 4. Content Security Policy (CSP): Implement a strict CSP header to restrict the execution of inline scripts and reduce the impact of any injected scripts. 5. User awareness: Educate administrators and users about the risks of clicking on suspicious links, especially those containing unusual URL parameters related to the plugin settings. 6. Access control: Limit access to the plugin settings page to trusted administrators only and monitor access logs for unusual activity. 7. Security monitoring: Enable logging and monitoring for anomalous HTTP requests that may indicate exploitation attempts. 8. Backup and recovery: Maintain regular backups of website data and configurations to enable quick restoration in case of compromise.
Affected Countries
Germany, United Kingdom, France, Netherlands, Italy, Spain, Poland, Sweden
CVE-2021-38341: CWE-79 Cross-site Scripting (XSS) in WooCommerce Payment Gateway Per Category WooCommerce Payment Gateway Per Category
Description
The WooCommerce Payment Gateway Per Category WordPress plugin is vulnerable to Reflected Cross-Site Scripting due to a reflected $_SERVER["PHP_SELF"] value in the ~/includes/plugin_settings.php file which allows attackers to inject arbitrary web scripts, in versions up to and including 2.0.10.
AI-Powered Analysis
Technical Analysis
CVE-2021-38341 is a Reflected Cross-Site Scripting (XSS) vulnerability identified in the WooCommerce Payment Gateway Per Category WordPress plugin, specifically affecting versions up to and including 2.0.10. The vulnerability arises from improper handling of the $_SERVER["PHP_SELF"] variable in the ~/includes/plugin_settings.php file. This variable reflects the current script's filename and path, and when not properly sanitized, it can be manipulated by attackers to inject arbitrary malicious JavaScript code. When a victim visits a crafted URL exploiting this vulnerability, the injected script executes in the context of the victim's browser, potentially leading to session hijacking, credential theft, or unauthorized actions performed on behalf of the user. The vulnerability is classified under CWE-79, which covers Cross-Site Scripting issues. The CVSS 3.1 base score is 6.1 (medium severity), with the vector indicating network attack vector (AV:N), low attack complexity (AC:L), no privileges required (PR:N), user interaction required (UI:R), scope changed (S:C), and low impact on confidentiality and integrity (C:L/I:L), with no impact on availability (A:N). No known exploits have been reported in the wild, and no official patches are linked in the provided data, suggesting that users must verify plugin updates or apply manual mitigations. The vulnerability affects the plugin's settings page, which is typically accessed by administrators or users with elevated privileges, but the reflected XSS can be triggered by any user visiting a crafted URL, making it a risk for site visitors and administrators alike.
Potential Impact
For European organizations using WooCommerce with the Payment Gateway Per Category plugin, this vulnerability poses a moderate risk. Exploitation could allow attackers to execute malicious scripts in the browsers of site administrators or customers, potentially leading to theft of authentication cookies, session tokens, or other sensitive information. This could result in unauthorized access to administrative functions or customer accounts, leading to data breaches or fraudulent transactions. Given WooCommerce's widespread use in European e-commerce, particularly among small and medium-sized enterprises, the vulnerability could undermine customer trust and lead to financial losses. The reflected nature of the XSS means attackers must entice victims to click on malicious links, which may limit large-scale automated exploitation but still poses targeted phishing risks. The scope change in the CVSS vector indicates that the vulnerability can affect resources beyond the vulnerable component, potentially impacting the entire website's security posture. While availability is not impacted, the integrity and confidentiality risks are significant enough to warrant attention, especially for organizations handling payment data subject to GDPR regulations, where data breaches can lead to substantial fines and reputational damage.
Mitigation Recommendations
1. Immediate upgrade: Organizations should verify if a newer version of the WooCommerce Payment Gateway Per Category plugin is available that addresses CVE-2021-38341 and apply the update promptly. 2. Input sanitization: If an update is not available, implement manual input validation and sanitization on the $_SERVER["PHP_SELF"] variable within the plugin's code to neutralize script injection vectors. 3. Web Application Firewall (WAF): Deploy or update WAF rules to detect and block malicious payloads targeting the vulnerable parameter, focusing on typical XSS attack patterns in URLs. 4. Content Security Policy (CSP): Implement a strict CSP header to restrict the execution of inline scripts and reduce the impact of any injected scripts. 5. User awareness: Educate administrators and users about the risks of clicking on suspicious links, especially those containing unusual URL parameters related to the plugin settings. 6. Access control: Limit access to the plugin settings page to trusted administrators only and monitor access logs for unusual activity. 7. Security monitoring: Enable logging and monitoring for anomalous HTTP requests that may indicate exploitation attempts. 8. Backup and recovery: Maintain regular backups of website data and configurations to enable quick restoration in case of compromise.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Wordfence
- Date Reserved
- 2021-08-09T00:00:00.000Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d9837c4522896dcbeb9f3
Added to database: 5/21/2025, 9:09:11 AM
Last enriched: 6/26/2025, 3:28:50 AM
Last updated: 7/31/2025, 10:13:17 PM
Views: 9
Related Threats
CVE-2025-9091: Hard-coded Credentials in Tenda AC20
LowCVE-2025-9090: Command Injection in Tenda AC20
MediumCVE-2025-9092: CWE-400 Uncontrolled Resource Consumption in Legion of the Bouncy Castle Inc. Bouncy Castle for Java - BC-FJA 2.1.0
LowCVE-2025-9089: Stack-based Buffer Overflow in Tenda AC20
HighCVE-2025-9088: Stack-based Buffer Overflow in Tenda AC20
HighActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.