CVE-2026-1540
Received Received - Intake
Remote Code Execution in Spam Protect for Contact Form 7 Plugin

Publication date: 2026-04-02

Last updated on: 2026-04-02

Assigner: WPScan

Description
The Spam Protect for Contact Form 7 WordPress plugin before 1.2.10 allows logging to a PHP file, which could allow an attacker with editor access to achieve Remote Code Execution by using a crafted header
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-02
Last Modified
2026-04-02
Generated
2026-05-06
AI Q&A
2026-04-02
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Currently, no data is known.
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

The vulnerability CVE-2026-1540 affects the WordPress plugin "Spam Protect for Contact Form 7" versions prior to 1.2.10. It is a Remote Code Execution (RCE) flaw that arises because the plugin allows logging data to a PHP file.

An attacker with editor-level access can exploit this by crafting a malicious HTTP header, specifically the "X-Forwarded-For" header, to inject PHP code into the log file.

The exploitation involves adding or editing a Contact Form 7 form, setting a log filename to a PHP file, and sending a specially crafted POST request to the WordPress REST API endpoint for the contact form with the malicious PHP code in the header. This allows the attacker to execute arbitrary PHP code on the server.


How can this vulnerability impact me? :

This vulnerability allows an attacker with editor privileges to execute arbitrary PHP code on the affected server.

Remote Code Execution can lead to full compromise of the website and server, including unauthorized access, data theft, defacement, or further attacks on the infrastructure.

Because the attacker needs editor access, the risk is elevated if such privileges are granted to untrusted users or if an attacker can escalate privileges to editor level.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by attempting to exploit the logging mechanism of the vulnerable plugin using a crafted HTTP header, specifically the "X-Forwarded-For" header, to inject PHP code into the log file.

A practical detection method involves sending a specially crafted POST request to the WordPress REST API endpoint for the Contact Form 7 plugin and then checking if the injected PHP code executes.

An example curl command to test for this vulnerability is:

  • curl -s -X POST "http://example.com/wp-json/contact-form-7/v1/contact-forms/[FORM_ID]/feedback" \
  • -H $'X-Forwarded-For: <?=phpinfo()?>' \
  • -F "your-name=test" \
  • -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"

After sending this request, visiting the URL where the PHP log file is stored (e.g., http://example.com/wp-content/shell.php) will confirm the vulnerability if the PHP code executes (e.g., displaying phpinfo output).


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to update the Spam Protect for Contact Form 7 WordPress plugin to version 1.2.10 or later, where this vulnerability has been fixed.

Additionally, review and restrict editor-level access to trusted users only, as exploitation requires editor privileges.

Avoid setting the log filename to a PHP file to prevent malicious code injection via logging.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The vulnerability allows an attacker with editor access to achieve Remote Code Execution on the affected WordPress site by injecting PHP code through a crafted header. This can lead to unauthorized access, data breaches, and potential manipulation or exposure of sensitive information.

Such unauthorized access and potential data compromise can negatively impact compliance with common standards and regulations like GDPR and HIPAA, which require protection of personal and sensitive data against unauthorized access and breaches.

Therefore, if exploited, this vulnerability could cause violations of these regulations due to failure to maintain adequate security controls and protect data confidentiality and integrity.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart