CVE-2024-3107
Executive Summary
CVE-2024-3107 is a Path Traversal vulnerability in the Spectra – WordPress Gutenberg Blocks plugin (versions up to and including 2.12.6). The flaw resides in the get_block_default_attributes function, allowing authenticated attackers with contributor-level permissions or higher to read arbitrary attributes.php files on the server. This can expose sensitive information such as database credentials, API keys, or configuration secrets.
The vulnerability is classified as a WordPress ecosystem issue, affecting the plugin's handling of file paths. No public proof-of-concept (PoC) or exploit code has been released, and the EPSS score is 0.0%, indicating low exploitation likelihood at this time. However, the lack of a patch from the vendor (Spectra) increases risk for unpatched installations.
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. Users should monitor for updates from the vendor and consider temporary mitigation measures if no patch is available.
CVSS Breakdown & Threat Level
- CVSS Score: 4.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: Low (contributor-level)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low (limited to reading
attributes.phpfiles) - Integrity Impact: None
- Availability Impact: None
The threat level is Medium due to the low complexity and network-based attack vector, but the impact is limited to reading specific files.
Deep Dive & Mechanics
The vulnerability exists in the get_block_default_attributes function within the Spectra plugin. This function is used to retrieve default attributes for Gutenberg blocks. The flaw occurs when the function constructs a file path using user-supplied input (e.g., block name) without proper sanitization. An attacker can inject path traversal sequences (e.g., ../) to navigate outside the intended directory and read attributes.php files from arbitrary locations.
Root Cause: The function likely concatenates a block name with a base path without validating or sanitizing the input, allowing directory traversal.
Attack Scenario:
- An authenticated user with contributor-level access sends a crafted request to the vulnerable endpoint.
- The request includes a block name parameter containing path traversal sequences (e.g.,
../../wp-config). - The plugin reads the file
attributes.phpfrom the traversed path, exposing sensitive data.
Vulnerable vs. Patched Code
Vulnerable Code (<= 2.12.6):
function get_block_default_attributes($block_name) {
$file_path = plugin_dir_path(__FILE__) . 'blocks/' . $block_name . '/attributes.php';
if (file_exists($file_path)) {
return include $file_path;
}
return array();
}
Patched Code (Hypothetical):
function get_block_default_attributes($block_name) {
// Sanitize block name to prevent path traversal
$block_name = basename($block_name);
$block_name = preg_replace('/[^a-zA-Z0-9_-]/', '', $block_name);
$file_path = plugin_dir_path(__FILE__) . 'blocks/' . $block_name . '/attributes.php';
if (file_exists($file_path)) {
return include $file_path;
}
return array();
}
The patched version uses basename() and regex filtering to strip path traversal characters and restrict the block name to safe characters.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress instance with Spectra plugin <= 2.12.6
- Authenticated user with contributor-level permissions
Exploitation Steps:
- Identify the vulnerable endpoint (e.g.,
/wp-admin/admin-ajax.phpwith actionspectra_get_block_default_attributes). - Craft a POST request with a malicious
block_nameparameter:POST /wp-admin/admin-ajax.php HTTP/1.1 Host: target.com Content-Type: application/x-www-form-urlencoded action=spectra_get_block_default_attributes&block_name=../../../../wp-config - The server will return the contents of
wp-config/attributes.php(if it exists) or an error.
Note: The file must be named attributes.php for the exploit to work.
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual
block_nameparameters containing../or..\\sequences. - Alert on requests to
admin-ajax.phpwith actionspectra_get_block_default_attributesfrom non-admin users.
Hardening:
- Disable the plugin if not essential.
- Implement a Web Application Firewall (WAF) rule to block path traversal patterns.
- Restrict file permissions on sensitive files (e.g.,
wp-config.php).
Indicators of Compromise (IOCs)
- File Paths:
/wp-content/plugins/spectra/blocks/(traversed) - Log Entries: Requests to
admin-ajax.phpwithaction=spectra_get_block_default_attributesandblock_namecontaining../ - Network Patterns: POST requests with suspicious
block_namevalues - File Access: Unauthorized reads of
attributes.phpfiles outside the plugin directory
Detection Engineering
YARA Rule
rule CVE_2024_3107_Path_Traversal {
meta:
description = "Detects path traversal attempts in Spectra plugin"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-3107"
strings:
$traversal = /block_name=.*\.\.\// nocase
$ajax_action = "spectra_get_block_default_attributes"
condition:
$ajax_action and $traversal
}
Sigma Rule
title: CVE-2024-3107 Spectra Plugin Path Traversal
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects path traversal attempts via block_name parameter
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: 'action=spectra_get_block_default_attributes'
cs-uri-query|contains: 'block_name='
cs-uri-query|re: 'block_name=.*\.\.\/'
condition: selection
falsepositives:
- Legitimate use of block names with dots (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-3107 Spectra Plugin Path Traversal"; flow:to_server,established; content:"POST"; http_method; content:"admin-ajax.php"; http_uri; content:"action=spectra_get_block_default_attributes"; http_client_body; pcre:"/block_name=[^&]*\.\.\//i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the Spectra plugin if not critical to operations.
- Apply a virtual patch using a WAF to block path traversal patterns.
- Restrict contributor-level permissions to trusted users only.
Long-term Fix:
- Update to a patched version once released by the vendor.
- Implement input validation and sanitization for all file path operations.
Workaround:
- Modify the plugin code to sanitize the
block_nameparameter (as shown in the patched code example).
Valters IT
Securing Digital Frontiers
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.