CVE-2025-54708: XSS Vulnerability in WordPress B-Blocks Plugin

WordPress B Blocks Plugin Banner - CVE-2025-54708

Summary

I recently discovered an authenticated (Contributor+) stored Cross-Site Scripting (XSS) vulnerability in the WordPress B-Blocks plugin that has now been assigned CVE-2025-54708. This security flaw affected all versions up to and including 2.0.5 of the “B Blocks – The ultimate block collection” plugin.

I responsibly disclosed this vulnerability through the Patchstack bug bounty program. The plugin developers responded promptly and released a security patch.

About The “B Blocks” Plugin

B Blocks is a lightweight and flexible Gutenberg plugin that transforms the native block editor into a powerful page builder for WordPress. Designed with performance and usability in mind, B Blocks extends the capabilities of core blocks by adding 30+ custom elements, pre-built Gutenberg templates, and flexible layout options—all without the need for bulky third-party tools.

Plugin NameB Blocks – Essential Gutenberg Blocks & Patterns Collection
Plugin Slugb-blocks
WP.org Profilehttps://wordpress.org/plugins/b-blocks/
Active Installations800+
Vulnerable Version2.0.5 (Download Here)
Patched Version2.0.6 (Download Here)
CVSS & SeverityMedium (6.5)

Attack Scenario

Step 01:

As an administrator, install and activate the vulnerable plugin version 2.0.5.

Make sure that the Button block is enabled.

Step 02:

Now login as a contributor level user and create a new post in the Gutenberg editor. Then insert the Button block.

Step 03:

In the Button block settings, under URL input field, enter the following payload. Then click `Submit For Review`.

javascript:alert(1);

The source code of the Button block after entering the URL:

<!-- wp:b-blocks/button {"url":"javascript:alert(1);"} /-->

Step 04:

Login as an administrator and preview the post. The payload will execute when you click the button.

Vulnerable Code

The vulnerable code is the react minified front-end code in the file view.js
Path: wp-content/plugins/b-blocks/build/button/view.js
Repo: https://plugins.trac.wordpress.org/browser/b-blocks/tags/2.0.5/build/button/view.js

Patch

Link: https://plugins.trac.wordpress.org/changeset/3340064/b-blocks/tags/2.0.6/readme.txt?old=3338803&old_path=b-blocks%2Ftags%2F2.0.5%2Freadme.txt

Timeline

Report Submitted To Patchstack30 July, 2025
Vendor Contacted04 August, 2025
Patch Submitted06 August, 2025
Published14 August, 2025

Conclusion

When processing user input for URL fields, always be careful of XSS payloads like: javascript:alert(1);

PHP Layer Security (Backend): Use WordPress sanitization functions like esc_url_raw() for database storage and esc_url() for output.

Frontend JavaScript Security: Sanitize URLs before rendering using browser APIs like URL() constructor for validation, and implement client-side protocol filtering. Use textContent instead of innerHTML when possible, and if HTML insertion is necessary, employ DOM manipulation methods with proper escaping.

Support

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *