CVE-2024-13546
Executive Summary
CVE-2024-13546 is a Sensitive Information Exposure vulnerability in the GenerateBlocks WordPress plugin, affecting all versions up to and including 1.9.1. The flaw resides in the get_image_description function, which fails to properly restrict access to post metadata. An authenticated attacker with Contributor-level access or higher can exploit this to extract the content of private, draft, and scheduled posts and pages, bypassing WordPress’s built-in access controls.
This vulnerability is specific to the WordPress ecosystem and does not involve the underlying web server (Apache/Nginx). The CVSS score is 4.3 (Medium), with a low EPSS score of 0.0%, indicating low active exploitation in the wild. However, the potential for data leakage of sensitive content (e.g., unpublished drafts, private posts) makes it a significant concern for sites with multiple user roles.
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 risk is limited to WordPress installations using the GenerateBlocks plugin.
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 (exposure of post content)
- Integrity Impact: None
- Availability Impact: None
Threat Level: Medium. While the CVSS score is moderate, the ability to leak unpublished content (drafts, private posts) can lead to information disclosure that may be leveraged for further attacks or reputational damage.
Deep Dive & Mechanics
The vulnerability exists in the get_image_description function within the GenerateBlocks plugin. This function is intended to retrieve the description (alt text, caption, etc.) of an image attached to a post. However, it does not properly validate the user’s permissions to view the parent post or page.
Root Cause: The function calls WordPress functions like get_post_meta() or wp_get_attachment_image_src() without first checking if the current user has the read capability for the post containing the image. As a result, an attacker with Contributor-level access can enumerate image IDs and extract metadata from posts they should not have access to, including private, draft, and scheduled posts.
Attack Flow:
- Attacker authenticates with a Contributor-level account.
- Attacker crafts a request to the vulnerable endpoint (e.g., via a REST API or AJAX handler) that invokes
get_image_descriptionwith a specific attachment ID. - The function returns the image description, which may include the post title, excerpt, or other sensitive data from the parent post.
- By iterating through attachment IDs, the attacker can extract content from multiple restricted posts.
Vulnerable vs. Patched Code
Vulnerable Code (GenerateBlocks <= 1.9.1):
function get_image_description( $attachment_id ) {
$description = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );
if ( empty( $description ) ) {
$description = get_the_title( $attachment_id );
}
return $description;
}
No permission check is performed before accessing the attachment’s metadata.
Patched Code (Hypothetical Fix):
function get_image_description( $attachment_id ) {
$attachment = get_post( $attachment_id );
if ( ! $attachment || ! current_user_can( 'read_post', $attachment->post_parent ) ) {
return '';
}
$description = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );
if ( empty( $description ) ) {
$description = get_the_title( $attachment_id );
}
return $description;
}
The fix adds a capability check (current_user_can('read_post', ...)) to ensure the user has permission to view the parent post.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- WordPress installation with GenerateBlocks plugin <= 1.9.1.
- A Contributor-level user account.
Exploitation Steps:
- Log in as a Contributor.
- Identify the REST API endpoint or AJAX action that calls
get_image_description. For example, the plugin may expose an endpoint like/wp-json/generateblocks/v1/get_image_description. - Craft a request to retrieve the description of an attachment belonging to a private/draft post:
POST /wp-json/generateblocks/v1/get_image_description HTTP/1.1 Host: target-site.com Content-Type: application/json Cookie: wordpress_logged_in_... {"attachment_id": 123} - The response will contain the image description, which may leak the parent post’s title or content.
- Iterate through attachment IDs (e.g., 1-1000) to extract data from multiple restricted posts.
Example cURL Command:
curl -X POST https://target-site.com/wp-json/generateblocks/v1/get_image_description \
-H "Content-Type: application/json" \
-H "Cookie: wordpress_logged_in_..." \
-d '{"attachment_id": 456}'
Blue Team (Detection & Hardening)
Detection:
- Monitor for unusual API requests to
/wp-json/generateblocks/v1/get_image_descriptionfrom Contributor-level users. - Look for sequential attachment ID enumeration in logs.
- Alert on high volumes of
get_image_descriptioncalls from a single user.
Hardening:
- Update GenerateBlocks to the latest patched version (once available).
- Implement a Web Application Firewall (WAF) rule to block requests to the vulnerable endpoint from non-admin users.
- Restrict Contributor-level access to only necessary users.
- Use a security plugin (e.g., Wordfence) to monitor for suspicious API activity.
Indicators of Compromise (IOCs)
Network IOCs:
- Repeated POST requests to
/wp-json/generateblocks/v1/get_image_descriptionwith varyingattachment_idvalues. - User agents consistent with automated scripting (e.g., Python-requests, curl).
- Repeated POST requests to
Host IOCs:
- WordPress debug logs showing errors from
get_image_descriptionfunction. - Unusual database queries for
_wp_attachment_image_altmeta keys from non-admin users.
- WordPress debug logs showing errors from
File IOCs:
- Modified
generateblocks/includes/class-image.php(or similar) containing the vulnerable function.
- Modified
Detection Engineering
YARA Rule
rule CVE_2024_13546_GenerateBlocks_InfoLeak {
meta:
description = "Detects vulnerable GenerateBlocks plugin code exposing sensitive post data"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-13546"
strings:
$func = "function get_image_description" nocase
$meta = "get_post_meta" nocase
$title = "get_the_title" nocase
condition:
all of them
}
Sigma Rule
title: CVE-2024-13546 - GenerateBlocks Sensitive Information Exposure
id: 8a3f7c2e-5d1b-4a9e-8c6f-2b3d1e0f7a8c
status: experimental
description: Detects exploitation attempts against CVE-2024-13546 via API enumeration
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/wp-json/generateblocks/v1/get_image_description'
cs-uri-query|contains: 'attachment_id'
condition: selection
falsepositives:
- Legitimate use by admin users
level: medium
tags:
- attack.t1525
- cve.2024.13546
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2024-13546 - GenerateBlocks Sensitive Information Exposure Attempt";
flow:to_server,established;
content:"POST";
http_method;
content:"/wp-json/generateblocks/v1/get_image_description";
http_uri;
content:"attachment_id";
http_client_body;
classtype:attempted-recon;
sid:1000001;
rev:1;
reference:cve,2024-13546;
)
Remediation & Mitigation
Immediate Actions:
- Update the plugin: Check the WordPress plugin repository for a patched version of GenerateBlocks. If unavailable, consider disabling the plugin until a fix is released.
- Restrict user roles: Remove Contributor-level access from untrusted users. Use a role editor plugin to limit capabilities.
- Apply a virtual patch: Use a WAF to block requests to the vulnerable endpoint from non-admin users.
Long-Term Measures:
- Implement a security plugin (e.g., Wordfence, Sucuri) to monitor for suspicious activity.
- Regularly audit user roles and permissions.
- Subscribe to security advisories for WordPress plugins.
Workaround:
- If patching is not possible, modify the plugin code to add a permission check (as shown in the patched code example) and test thoroughly.
Valters IT
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.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.