Contact Form Entries Unauthenticated SQL Injection (CVE-2026-138545)
Contact Form Entries 1.5.7 and earlier lets an unauthenticated visitor inject SQL through the entries shortcode's orderby parameter; fixed in 1.5.8.
TL;DR
- Contact Form Entries through 1.5.7 writes an
orderbyrequest value into a SQL ORDER BY clause without escaping it. Patchstack rates CVE-2026-138545 CVSS v3.1 9.3 Critical. - A site is exposed when a published post or page renders the
[vx-entries]shortcode and its author has the entries capability. WordPress.org reports 60,000 active installs. - No public proof of concept or in-the-wild exploitation is reported. CISA's SSVC assessment records exploitation as none, and the CVE is not in CISA KEV as of 2026-12-05.
- Update to 1.5.8 or later. If you cannot update, remove the shortcode from public pages or deactivate the plugin; "How do I fix it?" gives the commands.
Am I affected?
You are affected if the installed plugin is 1.5.7 or earlier and a public page renders the [vx-entries] shortcode. All of these must hold:
- The installed Contact Form Entries version is 1.5.7 or earlier.
- A published post or page contains the
[vx-entries]shortcode, and the post author has thevxcf_form_read_entriescapability. - An unauthenticated visitor can open that page. The shortcode checks the author's capability, not the visitor's.
- The site's database user can read the tables the query names. The plugin uses the WordPress database connection, so this is the normal case.
A site that never renders the shortcode does not expose this path. The plugin's admin entries screen calls the same function, but that screen requires an authenticated user with the plugin capability. The version alone does not decide exposure.
| Branch | Affected versions | Fixed version |
|---|---|---|
| Contact Form Entries | 1.5.7 and earlier | 1.5.8 |
The CVE record marks every version through 1.5.7 as affected and 1.5.8 as the first unaffected release. The plugin's changelog for 1.5.8 says it fixed an SQL injection vulnerability. The CVE record rates the flaw CVSS v3.1 9.3 Critical, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L, CWE-89.
Check the installed version with the WordPress admin Plugins screen or with WP-CLI:
wp plugin get contact-form-entries --field=version
wp plugin list --name=contact-form-entries --fields=name,status,version
Find published posts and pages that render the shortcode:
wp db query "SELECT ID, post_title FROM $(wp db prefix)posts WHERE post_content LIKE '%[vx-entries%' AND post_status='publish';"
A result means the page is a candidate entry point. Confirm that the page is public and that its author has the entries capability before treating it as exposed. A shortcode inside a draft, a private page or a members-only area is not reachable by an unauthenticated visitor.
How do I fix it?
Update Contact Form Entries to 1.5.8 or later, released on 2026-12-01, and confirm the version on the Plugins screen or with WP-CLI.
- Back up the database and the site files.
- Update the plugin from the WordPress admin Plugins screen, or run
wp plugin update contact-form-entries. - Confirm that
wp plugin get contact-form-entries --field=versionprints 1.5.8 or later. - Re-run the shortcode search and review every public page that still renders
[vx-entries]. - If the site uses a custom deployment process, rebuild the image or artifact with the fixed plugin version and redeploy it. A running container does not change when the image tag is updated.
wp plugin update contact-form-entries
wp plugin get contact-form-entries --field=version
If you cannot update yet, remove the [vx-entries] shortcode from every public post and page, or deactivate the plugin until the update is applied. Removing the shortcode removes the unauthenticated entry point. Deactivating the plugin also removes the entries screen and the shortcode output.
The workaround has limits. The admin entries screen still calls the same query function, so an authenticated user with the plugin capability can still reach the vulnerable code. The workaround does not patch the function, and it does not protect a page that re-adds the shortcode. Treat it as temporary.
What is the root cause?
The entries query takes the orderby value from one request variable for its allowlist check and from a second request variable for the SQL clause. A request can therefore satisfy the check with one value and put a different value into the query.
The vulnerable function is get_entries() in includes/data.php at 1.5.7. It defines a five-name allowlist and then builds the ORDER BY clause:
// includes/data.php, 1.5.7, line 219
public function get_entries($form_id,$per_page=20,$req=''){
...
$main_fields=array('vxurl','vxscreen','vxbrowser','vxcreated','vxupdated');
...
// line 334
if(!empty($_GET['orderby'])){
$order_by='d.value';
if(in_array($_GET['orderby'],$main_fields) ){
$order_by='l.'.ltrim(vxcf_form::post('orderby'),'vx');
The check reads $_GET['orderby']. The value that reaches the query comes from vxcf_form::post('orderby'). That helper reads $_REQUEST when no array is passed:
// contact-form-entries.php, 1.5.7, line 2886
public static function post($key, $arr="") {
if($arr!=""){ return isset($arr[$key]) ? self::clean($arr[$key]) : ""; }
return isset($_REQUEST[$key]) ? self::clean($_REQUEST[$key]) : "";
}
public static function clean($var){
...
return sanitize_text_field(wp_unslash($var));
}
PHP builds $_REQUEST from the request variables in the order set by request_order. The common default is GP, which means GET first and POST second, so a POST value overrides a GET value with the same name. An attacker can send orderby=vxurl in the query string to pass the allowlist and a different orderby in the request body to supply the query value.
sanitize_text_field() removes tags and extra whitespace. It does not escape SQL metacharacters such as quotes, parentheses or commas. The value is then concatenated into the ORDER BY clause:
// includes/data.php, 1.5.7, line 346
$sql.=" order by $order_by $order ";
The same function also builds a list of form IDs without escaping each value:
// includes/data.php, 1.5.7, line 230
$form_id_q=' l.form_id in ("'.implode('","',$form_id).'")';
That branch is reached when the caller passes an array of form IDs. The 1.5.8 fix escapes both paths.
How is it exploited?
An unauthenticated visitor sends one request to a page that renders the shortcode and puts a SQL expression into the orderby value that reaches the query. The database then evaluates that expression as part of the ORDER BY clause.
- The attacker finds a public post or page that renders
[vx-entries]. - The attacker sends a request to that page with
orderby=vxurlin the query string and a craftedorderbyvalue in the request body. A cookie with the same name can serve the same purpose when the server includes cookies in$_REQUEST. - The shortcode calls
get_entries(), which reads$_GET['orderby']for the allowlist check. - The GET value
vxurlis in the allowlist, so the check passes. vxcf_form::post('orderby')reads$_REQUEST, where the POST value overrides the GET value.sanitize_text_field()leaves the SQL syntax in the POST value intact.ltrim()removes leadingvxcharacters, and the value is concatenated intoORDER BY l.<value>.- The database runs the injected expression. A blind technique, such as a boolean condition or a time delay, lets the attacker read data one bit at a time.
The advisory calls the flaw blind SQL injection and publishes no payload. This post describes the mechanism and does not include a working exploit.
How does the attack flow?
A value that passes the allowlist check is replaced by a second request value that reaches the SQL clause, so the database evaluates an attacker expression.
What can an attacker do?
An attacker can read data from the WordPress database with the privileges of the site's database user. That normally includes user password hashes, session tokens, API keys, form submissions and other plugin tables.
The CVSS vector rates confidentiality as High, integrity as None and availability as Low. The advisory describes blind SQL injection, which returns data through boolean or timing differences rather than through query output. It does not report a write primitive or a chain to remote code execution.
The impact needs all of these conditions:
- The site runs Contact Form Entries 1.5.7 or earlier.
- A public page renders
[vx-entries]and its author has the entries capability. - The attacker can reach that page without authentication.
- The database user can read the target tables. The plugin uses the WordPress database connection, so this is the normal case.
- The injected expression is valid for the database engine and the query context.
An attacker who can read the user tables can attempt to crack password hashes offline or reuse exposed API keys. That is a consequence of the read access, not a separate flaw in the plugin.
Why does the fix work?
The fix validates the orderby value with WordPress's sanitize_sql_orderby() and compares the validated value against the allowlist before it reaches the query. It also escapes each form ID in the array branch.
The 1.5.8 change in includes/data.php is:
- $form_id_q=' l.form_id in ("'.implode('","',$form_id).'")';
+ $form_id_q=' l.form_id in ("'.implode('","',array_map('esc_sql',$form_id)).'")';
...
- if(in_array($_GET['orderby'],$main_fields) ){
- $order_by='l.'.ltrim(vxcf_form::post('orderby'),'vx');
+ $orderby_q=vxcf_form::post('orderby');
+ $orderby_q=sanitize_sql_orderby($orderby_q);
+ if(in_array($orderby_q,$main_fields,true) ){
+ $orderby_q=array_search($orderby_q,$main_fields);
+ $order_by='l.'.ltrim($orderby_q,'vx');
sanitize_sql_orderby() accepts a column name, an optional ASC or DESC suffix, and a small set of SQL functions. A value that contains a quote, a parenthesis, a comma or another SQL metacharacter does not match and returns false. The strict in_array() comparison then sends that value to the branch that runs esc_sql(), which escapes it for the query.
The check and the value now come from the same variable. A request can no longer pass the allowlist with one value and put a different value into the ORDER BY clause. The array_map('esc_sql', $form_id) call closes the separate array path.
The fix is complete for the two query paths it changes. It does not remove the shortcode or change who can reach it. A site that does not need the entries table on a public page should still remove the shortcode to reduce its attack surface.
How do I check if I was compromised?
No indicators of compromise are published for CVE-2026-138545. The injection is blind, so a successful attempt can look like a normal page request in the access log.
Review the web server log for requests to pages that render [vx-entries] and carry an orderby parameter. Pay particular attention to POST requests where orderby appears in both the query string and the request body, or where a cookie named orderby is present.
grep -Ei 'orderby' /var/log/nginx/access.log /var/log/apache2/access.log 2>/dev/null | grep -Ei 'vx-entries|vxcf|contact-form'
Look for values that contain SQL syntax, such as quotes, parentheses, sleep, benchmark, case when, if( or a comment marker. A hit is a lead, not proof, because a legitimate sort value can contain some of the same characters.
Check the WordPress debug log and the database slow query log for errors or long-running queries from the web user:
grep -Ei 'wpdb|sql syntax|vxcf' wp-content/debug.log 2>/dev/null
A failed attempt may leave no trace. A successful blind injection may leave only the request itself and a timing difference. If the logs show a suspicious request, rotate the database credentials and any API keys stored in the WordPress options table, and review the user accounts for changes.
Timeline
- 2026-11-28: hrnb8332 reports the flaw through the Patchstack Bug Bounty Program.
- 2026-12-01: Contact Form Entries 1.5.8 ships with the SQL injection fix.
- 2026-12-03 12:33 UTC: Patchstack publishes the advisory.
- 2026-12-05 13:00 UTC: CVE-2026-138545 is published.
FAQ
Does this affect a site that does not use the shortcode?
No. The unauthenticated entry point is a public page that renders [vx-entries]. The admin entries screen calls the same function, but it requires an authenticated user with the plugin capability.
Is the attack unauthenticated?
Yes. A visitor who can open the page can send the request. No WordPress account is needed, and the shortcode's capability check applies to the post author, not to the visitor.
Is there a public proof of concept?
No. The Patchstack advisory and the CVE record describe blind SQL injection but publish no payload. This post does not add one.
Is CVE-2026-138545 in CISA KEV?
No. The CISA Known Exploited Vulnerabilities catalog was at version 2026.12.04 on 2026-12-05, and the CVE is not listed. CISA's SSVC assessment records exploitation as none and automatable as yes.
Which versions are fixed?
Contact Form Entries 1.5.8 and later. The 1.5.8 release shipped on 2026-12-01 and its changelog names the SQL injection fix.
Can an attacker modify data?
The CVSS vector rates integrity as None, and the advisory describes blind SQL injection. The demonstrated impact is read access. No write primitive or remote code execution is reported.
References
- Patchstack, "WordPress Contact Form Entries plugin <= 1.5.7 - SQL Injection vulnerability", published 2026-12-03 (checked December 5, 2026): https://patchstack.com/database/wordpress/plugin/contact-form-entries/vulnerability/wordpress-contact-form-entries-plugin-1-5-7-sql-injection-vulnerability
- CVE Program, "CVE-2026-138545" record, published 2026-12-05 (checked December 5, 2026): https://www.cve.org/CVERecord?id=CVE-2026-138545
- WordPress.org, "Database for Contact Form 7, WPforms, Elementor forms" plugin page with 60,000 active installations and 1,286,935 downloads (checked December 5, 2026): https://wordpress.org/plugins/contact-form-entries/
- WordPress.org, Contact Form Entries 1.5.7 download, the vulnerable source (checked December 5, 2026): https://downloads.wordpress.org/plugin/contact-form-entries.1.5.7.zip
- WordPress.org, Contact Form Entries 1.5.8 download, the fixed source (checked December 5, 2026): https://downloads.wordpress.org/plugin/contact-form-entries.1.5.8.zip
- CISA, Known Exploited Vulnerabilities catalog, version 2026.12.04 (checked December 5, 2026): https://www.cisa.gov/known-exploited-vulnerabilities-catalog
Keep reading
