The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-50959

CVE-2022-50959: WordPress Contact Form Builder XSS Flaw

CVE-2022-50959 is a reflected cross-site scripting vulnerability in WordPress Contact Form Builder 1.6.1 that lets unauthenticated attackers inject malicious scripts via the form_id parameter. This article covers technical details, affected versions, impact, and mitigation.

Published: May 18, 2026

CVE-2022-50959 Overview

CVE-2022-50959 is a reflected cross-site scripting (XSS) vulnerability in the WordPress Contact Form Builder plugin version 1.6.1. The flaw exists in code_generator.php, which fails to sanitize the form_id parameter before reflecting it into the HTTP response. Unauthenticated attackers can craft malicious URLs containing JavaScript payloads in the form_id parameter. When a victim clicks the link, the injected script executes in the victim's browser session under the context of the WordPress site. The vulnerability is tracked under CWE-79 (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Attackers can steal session cookies, perform actions on behalf of authenticated users, or redirect victims to malicious sites by tricking them into visiting crafted URLs.

Affected Products

  • WordPress Contact Form Builder plugin version 1.6.1
  • code_generator.php endpoint within the plugin
  • WordPress sites with the vulnerable plugin installed and accessible

Discovery Timeline

  • 2026-05-10 - CVE-2022-50959 published to NVD
  • 2026-05-12 - Last updated in NVD database

Technical Details for CVE-2022-50959

Vulnerability Analysis

The vulnerability stems from missing output encoding on the form_id GET parameter processed by code_generator.php. The plugin echoes the parameter value directly into the HTML response without applying WordPress sanitization functions such as esc_html() or esc_attr(). This permits arbitrary HTML and JavaScript injection into the rendered page.

Because the attack requires user interaction, a victim must visit a URL crafted by the attacker. The injected JavaScript runs with the privileges of the visiting user and within the origin of the WordPress site. Session cookies, CSRF tokens, and DOM contents accessible to the page become reachable by the attacker payload.

Root Cause

The root cause is improper input neutralization in code_generator.php. User-controlled input from the form_id query string parameter reaches the response body without sanitization or contextual encoding. WordPress provides built-in escaping APIs, but the plugin author did not apply them at the output sink.

Attack Vector

The attack vector is network-based and requires user interaction. An attacker constructs a URL pointing to the vulnerable code_generator.php endpoint with a script payload in the form_id parameter. The attacker then distributes the URL through phishing email, social media, or a malicious site. When the victim loads the URL, the reflected payload executes in their browser. Refer to the VulnCheck Advisory on WordPress XSS and Exploit-DB #50734 for the public proof-of-concept details.

Detection Methods for CVE-2022-50959

Indicators of Compromise

  • HTTP GET requests to /wp-content/plugins/contact-forms-builder/code_generator.php containing form_id values with <script>, onerror=, javascript:, or URL-encoded angle brackets (%3C, %3E).
  • Web server access logs showing unusually long or URL-encoded form_id parameter values from external referrers.
  • Browser console errors or unexpected outbound requests originating from pages served by the vulnerable plugin.

Detection Strategies

  • Inspect web access logs for query strings targeting code_generator.php and flag entries where form_id contains HTML control characters.
  • Deploy a web application firewall (WAF) rule that blocks reflected XSS signatures on requests to plugin paths under /wp-content/plugins/contact-forms-builder/.
  • Run an authenticated vulnerability scan against the WordPress installation to identify plugin version 1.6.1.

Monitoring Recommendations

  • Forward Apache, Nginx, or load balancer logs to a centralized analytics platform and alert on XSS payload patterns targeting WordPress plugin endpoints.
  • Monitor for spikes in 200 OK responses to code_generator.php from anonymous sources, which can indicate exploitation attempts at scale.
  • Track outbound DNS or HTTP traffic from user workstations to attacker-controlled domains correlated with WordPress site visits.

How to Mitigate CVE-2022-50959

Immediate Actions Required

  • Identify all WordPress installations running the Contact Form Builder plugin version 1.6.1 and disable the plugin until a patched version is confirmed.
  • Remove or restrict access to code_generator.php via web server configuration if the plugin cannot be uninstalled immediately.
  • Audit recent web logs for exploitation attempts and rotate administrator session cookies if suspicious activity is found.

Patch Information

No vendor patch is referenced in the available CVE data. Administrators should consult the WordPress Plugin Information page for current plugin status and replace the plugin with a maintained contact form alternative if no fixed release is available.

Workarounds

  • Deploy a WAF rule to drop requests where the form_id parameter contains HTML tags, event handlers, or script keywords.
  • Restrict access to /wp-content/plugins/contact-forms-builder/code_generator.php to authenticated administrators using .htaccess or Nginx location rules.
  • Add a Content Security Policy (CSP) header that disallows inline scripts to limit the impact of reflected XSS payloads.
bash
# Nginx configuration example: block requests with script payloads in form_id
location ~* /wp-content/plugins/contact-forms-builder/code_generator\.php {
    if ($args ~* "form_id=.*(<|%3C|script|onerror|javascript:)") {
        return 403;
    }
}

# Recommended Content Security Policy header
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; object-src 'none'";

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechWordpress

  • SeverityMEDIUM

  • CVSS Score5.1

  • EPSS Probability0.09%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • WordPress Plugin Information

  • Exploit-DB #50734

  • VulnCheck Advisory on WordPress XSS
  • Related CVEs
  • CVE-2026-6504: Royal Elementor Addons XSS Vulnerability

  • CVE-2026-6174: CC Child Pages WordPress Plugin XSS Flaw

  • CVE-2026-6252: Meta Field Block WordPress Plugin XSS Flaw

  • CVE-2026-3694: Bold Page Builder WordPress XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English