CVE-2026-5711

Post Blocks & Tools <= 1.3.0 - Authenticated (Author+) Stored Cross-Site Scripting via 'sliderStyle' Block Attribute

mediumImproper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
6.4
CVSS Score
6.4
CVSS Score
medium
Severity
1.3.1
Patched in
1d
Time to patch

Description

The Post Blocks & Tools plugin for WordPress is vulnerable to Stored Cross-Site Scripting via the 'sliderStyle' block attribute in the Posts Slider block in all versions up to, and including, 1.3.0 due to insufficient input sanitization and output escaping on user supplied attributes. This makes it possible for authenticated attackers, with author-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.

CVSS Vector Breakdown

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Low
Confidentiality
Low
Integrity
None
Availability

Technical Details

Affected versions<=1.3.0
PublishedApril 8, 2026
Last updatedApril 8, 2026
Affected pluginbnm-blocks

What Changed in the Fix

Changes introduced in v1.3.1

Loading patch diff...

Source Code

WordPress.org SVN
Research Plan
Unverified

# Exploitation Research Plan: CVE-2026-5711 (Post Blocks & Tools <= 1.3.0) ## 1. Vulnerability Summary The **Post Blocks & Tools** plugin for WordPress is vulnerable to **Stored Cross-Site Scripting (XSS)** via the `sliderStyle` attribute of the **Posts Slider** block. In version 1.3.0 and below, t…

Show full research plan

Exploitation Research Plan: CVE-2026-5711 (Post Blocks & Tools <= 1.3.0)

1. Vulnerability Summary

The Post Blocks & Tools plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) via the sliderStyle attribute of the Posts Slider block. In version 1.3.0 and below, the plugin fails to sanitize this attribute before using it to construct a CSS class name, which is then rendered on the page. Since authors can create posts and define block attributes, an authenticated attacker with Author-level permissions can inject arbitrary JavaScript that executes in the context of any user viewing the affected post.

2. Attack Vector Analysis

  • Endpoint: WordPress REST API POST /wp-json/wp/v2/posts (or the Gutenberg editor).
  • Authentication: Author-level or higher (edit_posts capability).
  • Vulnerable Attribute: sliderStyle within the bnm-blocks/posts-slider block.
  • Payload Carry: The payload is embedded in the JSON-encoded block attributes within the post content.
  • Preconditions: The plugin bnm-blocks must be active, and an attacker must have credentials for an Author-level account.

3. Code Flow

  1. Entry Point: A user saves a post containing a bnm-blocks/posts-slider block. The block's attributes are stored as a JSON comment in `
Research Findings
Static analysis — not yet PoC-verified

Summary

The Post Blocks & Tools plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) via various block attributes such as 'sliderStyle', 'sectionHeaderStyle', and 'columns'. This occurs because version 1.3.0 and below fail to sanitize or escape these attributes before including them in HTML class names on the frontend, allowing authenticated authors to inject malicious JavaScript into posts.

Vulnerable Code

// src/blocks/posts/slider/view.php line 207
$slider_style_class = 'bnm-sw-' . $attributes['sliderStyle'];

$classes = array( 'wpbnmposw', 'bnmbcs', $slider_style_class );

// ...

if ( $attributes['sectionHeaderStyle'] ) {
    $classes[] = 'bnm-bhs-' . $attributes['sectionHeaderStyle'];
}

---

// src/blocks/posts/posts-ultra/view.php line 173
if ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) {
    $classes[] = 'columns-' . $attributes['columns'];
}

if ( $attributes['showFeaturedImage'] && isset( $attributes['imagePosition'] ) ) {
    $classes[] = 'image-align' . $attributes['imagePosition'];
}

if ( $attributes['textAlign'] ) {
    $classes[] = 'has-text-align' . $attributes['textAlign'];
}

// ...

if ( $attributes['sectionHeaderStyle'] ) {
    $classes[] = 'bnm-bhs-' . $attributes['sectionHeaderStyle'];
}

Security Fix

diff -ru /home/deploy/wp-safety.org/data/plugin-versions/bnm-blocks/1.3.0/src/blocks/posts/slider/view.php /home/deploy/wp-safety.org/data/plugin-versions/bnm-blocks/1.3.1/src/blocks/posts/slider/view.php
--- /home/deploy/wp-safety.org/data/plugin-versions/bnm-blocks/1.3.0/src/blocks/posts/slider/view.php	2025-11-17 00:48:06.000000000 +0000
+++ /home/deploy/wp-safety.org/data/plugin-versions/bnm-blocks/1.3.1/src/blocks/posts/slider/view.php	2026-04-07 17:20:44.000000000 +0000
@@ -34,28 +34,30 @@
 	$article_query = new WP_Query( $post_query_args );
 
 	$slider_style = isset( $attributes['sliderStyle'] ) ? $attributes['sliderStyle'] : 'style-1';
-	$slides_per_view = isset( $attributes['slidesPerView'] ) ? $attributes['slidesPerView'] : 1;
-	$asepec_ratio = isset( $attributes['aspectRatio'] ) ? $attributes['aspectRatio'] : 0.5625;
-	$space_between_slides = isset( $attributes['spaceBetweenSlides'] ) ? $attributes['spaceBetweenSlides'] : 20;
-	$autoplay = isset( $attributes['autoplay'] ) ? $attributes['autoplay'] : false;
+	$slides_per_view = isset( $attributes['slidesPerView'] ) ? (int) $attributes['slidesPerView'] : 1;
+	$asepect_ratio = isset( $attributes['aspectRatio'] ) ? (float) $attributes['aspectRatio'] : 0.5625;
+	$space_between_slides = isset( $attributes['spaceBetweenSlides'] ) ? (int) $attributes['spaceBetweenSlides'] : 20;
+	$autoplay = isset( $attributes['autoplay'] ) ? (bool) $attributes['autoplay'] : false;
 	$delay    = isset( $attributes['delay'] ) ? absint( $attributes['delay'] ) : 5;
 	$featured_image_slug = ! empty( $attributes['featuredImageSizeSlug'] ) ? $attributes['featuredImageSizeSlug'] : '';
 	$slider_thumb_size = ! empty( $attributes['slideThumbSize'] ) ? $attributes['slideThumbSize'] : '';
 	$image_fit = ! empty( $attributes['imageFit'] ) ? $attributes['imageFit'] : 'cover';
-	$thumbSlidesPerView = isset( $attributes['thumbSlidesPerView'] ) ? $attributes['thumbSlidesPerView'] : 5;
-	$slide_image_class = "image-fit-{$image_fit}";
+	$thumbSlidesPerView = isset( $attributes['thumbSlidesPerView'] ) ? (int) $attributes['thumbSlidesPerView'] : 5;
+	$slide_image_class = sanitize_html_class( 'image-fit-'. $image_fit );
@@ -205,13 +207,13 @@
 	$slider_block = ob_get_clean();
 
 	// Slider style class name.
-	$slider_style_class = 'bnm-sw-' . $attributes['sliderStyle'];
+	$slider_style_class = sanitize_html_class( 'bnm-sw-' . $attributes['sliderStyle'] );
 
 	$classes = array( 'wpbnmposw', 'bnmbcs', $slider_style_class );
 
 	if ( $attributes['categoryBGColor'] || $attributes['categoryBGHoverColor'] || ! empty($attributes['categoryPadding']) ) {
 		$classes[] = 'bnm-box-cat';
 	}
 
 	if ( $attributes['sectionHeaderStyle'] ) {
-		$classes[] = 'bnm-bhs-' . $attributes['sectionHeaderStyle'];
+		$classes[] = sanitize_html_class( 'bnm-bhs-' . $attributes['sectionHeaderStyle'] );
 	}

Exploit Outline

The exploit requires an attacker with Author-level permissions. 1. Authenticate to the WordPress dashboard as an Author. 2. Create a new post or edit an existing one. 3. Insert a block belonging to the plugin, such as the 'Posts Slider' block (`bnm-blocks/posts-slider`). 4. Switch to the 'Code Editor' view in Gutenberg. 5. Locate the JSON comment for the block and inject an XSS payload into the 'sliderStyle' attribute (e.g., `"sliderStyle":"\"><script>alert(1)</script>"`). 6. Save and publish the post. 7. When any user views the post, the script will execute because the payload breaks out of the HTML class attribute and injects a script tag.

Check if your site is affected.

Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.