
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-1540 is a Remote Code Execution (RCE) vulnerability in the Spam Protect for Contact Form 7 WordPress plugin affecting all versions before 1.2.10. The flaw allows an attacker with WordPress editor-level access to write arbitrary PHP code to a log file by sending a crafted HTTP header, which can then be executed on the server. It was publicly disclosed on March 12, 2026, and assigned a CVE on April 2, 2026. The vulnerability carries a CVSS v3.1 base score of 7.2 (High) (WPScan, GitHub Advisory).
The root cause is classified as CWE-94 (Improper Control of Generation of Code / Code Injection). The plugin's spam-logging feature allows administrators or editors to configure a custom log filename, including one with a .php extension. When a contact form submission triggers spam detection, the plugin logs request details — including unsanitized HTTP headers such as X-Forwarded-For — directly into the configured PHP file. An attacker with editor access can set the log filename to shell.php, then submit a crafted form request with a PHP payload in the X-Forwarded-For header, causing the payload to be written into the PHP file. The resulting file is web-accessible and can be directly requested to execute arbitrary PHP code. A detailed proof-of-concept is publicly available (WPScan).
Successful exploitation grants an attacker arbitrary server-side code execution in the context of the web server process, resulting in full compromise of confidentiality, integrity, and availability of the affected WordPress installation and potentially the underlying server. An attacker could steal sensitive data (credentials, user PII, database contents), deface or modify website content, establish persistent backdoors, or pivot to other systems on the same network. The scope is limited to the affected server (unchanged scope), but the practical impact includes complete site takeover (WPScan, GitHub Advisory).
A detailed public proof-of-concept (PoC) is available via a GitHub Gist authored by the original researcher, Chiao-Lin Yu (Steven Meow), demonstrating the full exploit chain using a curl command (WPScan). Exploitation requires editor-level (or higher) WordPress credentials, which limits opportunistic mass exploitation but makes it a significant insider threat or post-compromise escalation vector. There is no evidence of active in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The EPSS score is approximately 0.027%–0.119%, indicating a low but non-negligible probability of exploitation in the near term (GitHub Advisory).
testspam) to the block list, and set the log filename to shell.php.X-Forwarded-For header:curl -s -X POST "http://example.com/wp-json/contact-form-7/v1/contact-forms/[FORM_ID]/feedback" \
-H $'X-Forwarded-For: <?php phpinfo(); ?>' \
-F "your-name=test" \
-F "your-email=test@test.com" \
-F "your-subject=test" \
-F "your-message=testspam" \
-F "_wpcf7=[FORM_ID]" \
-F "_wpcf7_version=6.1.4" \
-F "_wpcf7_locale=en_US" \
-F "_wpcf7_unit_tag=wpcf7-f[FORM_ID]-p1-o1" \
-F "_wpcf7_container_post=1"wp-content/shell.php.http://example.com/wp-content/shell.php to execute the injected PHP code on the server (WPScan)./wp-json/contact-form-7/v1/contact-forms/[ID]/feedback containing PHP code patterns (e.g., <?php) in the X-Forwarded-For header; subsequent GET requests to unexpected .php files in the wp-content/ directory..php files in the wp-content/ directory or plugin subdirectories (e.g., shell.php, cmd.php); recently modified or created PHP files in plugin log directories with PHP code content.wp-content/ returning HTTP 200 responses; POST requests to the CF7 feedback endpoint with anomalous header values containing PHP syntax.bash, sh, curl, wget, python) following requests to unexpected PHP files in the plugin directory.The primary remediation is to upgrade the Spam Protect for Contact Form 7 plugin to version 1.2.10 or later, which resolves the unsafe logging behavior (WPScan, GitHub Advisory). As interim mitigations: restrict editor-level WordPress access to only fully trusted users; audit the plugin's Antispam Settings to ensure no .php log filename is configured; scan the wp-content/ directory for unexpected PHP files and remove any found. Deploying a Web Application Firewall (WAF) rule to block PHP code patterns in HTTP headers can reduce exploitation risk until patching is complete.
The vulnerability was discovered and responsibly disclosed by researcher Chiao-Lin Yu (Steven Meow), who also published the proof-of-concept on GitHub Gist (WPScan). No significant broader media coverage or notable community debate has been observed beyond standard vulnerability database indexing across NVD, GitHub Advisory Database, and ENISA EUVD.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."