CVE-2023-6630
Executive Summary
CVE-2023-6630 is an Insecure Direct Object Reference (IDOR) vulnerability in the Contact Form 7 – Dynamic Text Extension plugin for WordPress, affecting all versions up to and including 4.1.0. This flaw allows authenticated attackers with Contributor-level access or higher to read arbitrary metadata from any post type on the target WordPress site. The vulnerability resides in the CF7_get_custom_field and CF7_get_current_user shortcodes, which fail to validate user-controlled keys. An attacker can exploit this by crafting a request that references a specific post ID and metadata key, bypassing intended access controls.
The vulnerability is classified as WordPress ecosystem issue, not related to Apache or Nginx. The CVSS score is 4.3 (Medium), with a low EPSS score of 0.0%, indicating low exploitation likelihood in the wild. However, the lack of a patch from the vendor (Aurise) makes this a persistent risk for sites using the plugin.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects a WordPress plugin distributed via the official WordPress plugin repository. No NPM, PyPI, Go, or Ruby packages are involved. The plugin is not maintained by the WordPress core team, and no official patch exists. Users should consider removing or replacing the plugin.
CVSS Breakdown & Threat Level
- CVSS Score: 4.3 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L) – requires Contributor-level access
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L) – metadata exposure
- Integrity Impact: None (I:N)
- Availability Impact: None (A:N)
Threat Level: Medium. While the impact is limited to reading metadata (e.g., custom fields, user data), the low complexity and lack of patch make it a viable target for low-sophistication attackers with valid credentials.
Deep Dive & Mechanics
The vulnerability is an Insecure Direct Object Reference (CWE-639) in the CF7_get_custom_field and CF7_get_current_user shortcodes. These shortcodes are intended to allow dynamic content insertion in Contact Form 7 forms, such as pulling user metadata or custom post fields. However, they accept user-supplied parameters for post_id and meta_key without proper authorization checks.
How it works:
- An authenticated user with Contributor role or higher can create or edit a Contact Form 7 form.
- The attacker inserts a shortcode like
[CF7_get_custom_field key='_wp_page_template' post_id='1']to read metadata from any post. - The plugin processes the shortcode and returns the metadata value without verifying if the attacker has permission to access that post or metadata key.
- This allows enumeration of sensitive metadata, such as
_edit_lock,_edit_last, or custom user fields.
Affected Components:
- Plugin: Contact Form 7 – Dynamic Text Extension
- Shortcodes:
CF7_get_custom_field,CF7_get_current_user - User Role: Contributor and above
Vulnerable vs. Patched Code
Vulnerable Code (version 4.1.0):
The plugin does not validate the post_id or meta_key parameters. Example snippet from the vulnerable shortcode handler:
function cf7_get_custom_field_shortcode($atts) {
$atts = shortcode_atts(array(
'key' => '',
'post_id' => get_the_ID()
), $atts);
$meta_value = get_post_meta($atts['post_id'], $atts['key'], true);
return $meta_value;
}
Patched Code (hypothetical): A fix would require checking if the current user has permission to read the specified post and metadata. Example:
function cf7_get_custom_field_shortcode($atts) {
$atts = shortcode_atts(array(
'key' => '',
'post_id' => get_the_ID()
), $atts);
if (!current_user_can('read_post', $atts['post_id'])) {
return '';
}
$meta_value = get_post_meta($atts['post_id'], $atts['key'], true);
return $meta_value;
}
No official patch exists from the vendor.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress site with Contact Form 7 – Dynamic Text Extension <= 4.1.0
- Valid user account with Contributor role or higher
- Ability to create or edit Contact Form 7 forms
Exploitation Steps:
- Log in as a Contributor user.
- Navigate to Contact > Add New or edit an existing form.
- Insert a shortcode to read arbitrary metadata, e.g.:
[CF7_get_custom_field key='_wp_page_template' post_id='1'] - Save the form and view it on the frontend. The metadata value will be displayed.
- To read user metadata, use:
[CF7_get_current_user key='user_email']
No public exploit code is available. The exploitation relies on the shortcode functionality.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual shortcode usage in Contact Form 7 forms, especially with non-standard
post_idvalues. - Look for Contributor users creating forms with
CF7_get_custom_fieldorCF7_get_current_usershortcodes that reference high-value post IDs (e.g., 1, 2, admin user IDs). - Check logs for
get_post_metacalls with unexpected parameters.
Hardening:
- Remove or disable the plugin if not essential.
- Restrict Contributor role capabilities using a plugin like User Role Editor.
- Implement a Web Application Firewall (WAF) rule to block shortcodes with suspicious
post_idvalues. - Apply the principle of least privilege to user roles.
Indicators of Compromise (IOCs)
- File:
/wp-content/plugins/cf7-dynamic-text-extension/cf7-dynamic-text-extension.php(vulnerable plugin) - Shortcode patterns:
[CF7_get_custom_field key='*' post_id='*']or[CF7_get_current_user key='*'] - Log entries: Unusual
get_post_metacalls withpost_idvalues not owned by the user - Network: HTTP requests to WordPress forms containing the vulnerable shortcodes
Detection Engineering
YARA Rule
rule CVE_2023_6630_WordPress_Plugin {
meta:
description = "Detects vulnerable Contact Form 7 Dynamic Text Extension plugin files"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2023-6630"
strings:
$shortcode1 = "CF7_get_custom_field" ascii wide nocase
$shortcode2 = "CF7_get_current_user" ascii wide nocase
$vuln_func = "get_post_meta" ascii wide nocase
condition:
all of them
}
Sigma Rule
title: CVE-2023-6630 WordPress Plugin IDOR Exploitation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects exploitation attempts of CVE-2023-6630 via shortcode usage
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains:
- 'CF7_get_custom_field'
- 'CF7_get_current_user'
condition: selection
falsepositives:
- Legitimate use of the plugin by authorized users
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2023-6630 WordPress Plugin IDOR Attempt"; flow:to_server,established; content:"CF7_get_custom_field"; http_client_body; nocase; content:"post_id"; http_client_body; nocase; classtype:attempted-recon; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the plugin – Deactivate and remove
Contact Form 7 – Dynamic Text Extensionfrom all WordPress installations. - Audit user roles – Review Contributor and higher roles for unnecessary permissions.
- Check for compromise – Scan for unauthorized form modifications or metadata access.
Long-term Mitigation:
- Replace the plugin with a maintained alternative that provides similar functionality with proper access controls.
- Implement a WordPress security plugin (e.g., Wordfence, Sucuri) to monitor for IDOR attempts.
- Apply virtual patching via WAF rules to block shortcodes with suspicious parameters.
- Regularly update all WordPress components and remove unused plugins.
No official patch is available. The vendor (Aurise) has not released a fix. Users must rely on the mitigations above.
Valters IT – DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.