Contact Form by Supsystic <= 1.7.36 Unauthenticated SSTI to RCE (CVE-2026-4257)
by shootcannon · 2026-07-05
- Severity
- Critical
- CVE
- CVE-2026-4257
- Category
- web
- Affected product
- Contact Form by Supsystic (WordPress plugin)
- Affected versions
- <= 1.7.36
- Disclosed
- 2026-07-05
- Patch status
- unpatched
References
Archive entry
intelseclab/poc-archiveMetadata
| Field | Value |
|---|---|
| Date Added | 2026-07-05 |
| Last Updated | 2026-06 |
| Author / Researcher | shootcannon |
| CVE / Advisory | CVE-2026-4257 |
| Category | web |
| Severity | Critical |
| CVSS Score | N/A |
| Status | PoC |
| Tags | wordpress, contact-form-by-supsystic, ssti, twig, rce, unauthenticated, prefill |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Contact Form by Supsystic (WordPress plugin) |
| Versions Affected | <= 1.7.36 |
| Language / Platform | PHP / WordPress plugin (Twig templating) |
| Authentication Required | No |
| Network Access Required | Yes (HTTP access to the page hosting the vulnerable contact form) |
Summary
CVE-2026-4257 is an unauthenticated Server-Side Template Injection (SSTI) vulnerability in the “Contact Form by Supsystic” WordPress plugin’s prefill functionality (cfsPreFill parameter). A form field value is rendered through the Twig template engine without sufficient sandboxing, allowing an attacker to inject Twig expressions. The included PoC first confirms SSTI with a simple arithmetic probe ({{7*7}}) and then escalates to full remote code execution by abusing Twig’s _self.env.registerUndefinedFilterCallback() / _self.env.getFilter() sandbox-escape gadget to invoke system() with an attacker-supplied command.
Vulnerability Details
Root Cause
The plugin’s contact form prefill feature takes a field name from the query string (e.g. first_name) and passes an attacker-controlled value for that field directly into a Twig template rendering context (cfsPreFill=1) without escaping or restricting template syntax, resulting in classic SSTI. Twig’s _self.env object exposes registerUndefinedFilterCallback(), which can be pointed at PHP’s system function, enabling arbitrary OS command execution when the “filter” is subsequently invoked via getFilter().
Attack Vector
- Identify a page hosting the vulnerable Supsystic contact form and a form field name (e.g.
first_name). - Send a GET request with
cfsPreFill=1and the target field set to{{7*7}}to confirm SSTI (response reflects49). - Send a second request where the target field holds the payload
{{_self.env.registerUndefinedFilterCallback(forms.params.fields.1.value)}}{{_self.env.getFilter(forms.params.fields.2.value)}}, withlast_name=systemandemail=<command>. This registerssystemas an “undefined filter” callback and then triggers it with the attacker’s command as the filter name/argument. - The command’s output is reflected back in the rendered field’s
valueattribute in the HTTP response.
Impact
Unauthenticated remote code execution as the web server / PHP-FPM user on any WordPress site running the vulnerable plugin version with the prefill feature reachable.
Environment / Lab Setup
Target: WordPress site with "Contact Form by Supsystic" <= 1.7.36 installed and a form with prefill enabled
Attacker: Python 3 with the `requests` library
Proof of Concept
PoC Script
See
cve-2026-4257.pyin this folder.
| |
The script first issues an SSTI confirmation request ({{7*7}} -> looks for 49 in the response), then sends the RCE payload with the -c command and parses the command output out of the reflected field value in the HTML response.
Detection & Indicators of Compromise
Signs of compromise:
- Access log entries containing Twig template syntax or
_self.envin query string parameters directed at contact-form pages - Unexpected child processes spawned by the PHP-FPM / Apache / nginx worker handling WordPress requests
- Unexplained files, webshells, or outbound connections originating from the WordPress host shortly after such requests
Remediation
| Action | Detail |
|---|---|
| Primary fix | Update “Contact Form by Supsystic” to the latest patched version (> 1.7.36) per the vendor advisory |
| Interim mitigation | Disable the prefill feature, restrict access to contact-form pages via WAF rules blocking Twig/SSTI-like payloads in query parameters, or temporarily disable the plugin |
References
Notes
Mirrored from https://github.com/shootcannon/CVE-2026-4257 on 2026-07-05.
| |