diff --git a/includes/admin/settings/class-settings-sanitize.php b/includes/admin/settings/class-settings-sanitize.php index 3985096..86dad7f 100644 --- a/includes/admin/settings/class-settings-sanitize.php +++ b/includes/admin/settings/class-settings-sanitize.php @@ -175,7 +175,8 @@ public function sanitize_postids_field( $value ) { $ids = array_filter( array_map( 'absint', explode( ',', sanitize_text_field( wp_unslash( $value ) ) ) ) ); foreach ( $ids as $key => $value ) { - if ( false === get_post_status( $value ) ) { + // Drop missing posts, and posts the saving user cannot read (CLI and cron have no user). + if ( false === get_post_status( $value ) || ( is_user_logged_in() && ! current_user_can( 'read_post', $value ) ) ) { unset( $ids[ $key ] ); } } diff --git a/includes/rest/class-rest-controller.php b/includes/rest/class-rest-controller.php index 31f5ba5..b5ba006 100644 --- a/includes/rest/class-rest-controller.php +++ b/includes/rest/class-rest-controller.php @@ -654,7 +654,9 @@ public function get_related_articles( WP_REST_Request $request ) { } $post = get_post( $post_id ); - if ( ! $post || 'wz_knowledgebase' !== $post->post_type ) { + + // Answer as if the article does not exist when the visitor cannot read it. + if ( ! $post || 'wz_knowledgebase' !== $post->post_type || ! ( is_post_publicly_viewable( $post ) || current_user_can( 'read_post', $post->ID ) ) ) { return new WP_Error( 'wzkb_rest_post_not_found', __( 'Knowledge Base post not found.', 'knowledgebase' ), diff --git a/knowledgebase.php b/knowledgebase.php index 63258b9..767ec23 100644 --- a/knowledgebase.php +++ b/knowledgebase.php @@ -13,7 +13,7 @@ * Plugin Name: WebberZone Knowledge Base * Plugin URI: https://webberzone.com/plugins/knowledgebase/ * Description: Create a multi-product knowledge base on your WordPress site. - * Version: 3.2.3 + * Version: 3.2.4 * Author: WebberZone * Author URI: https://webberzone.com * License: GPL-2.0+ @@ -38,7 +38,7 @@ * * @var string $wzkb_version Plugin version */ - define( 'WZKB_VERSION', '3.2.3' ); + define( 'WZKB_VERSION', '3.2.4' ); } if ( ! defined( 'WZKB_PLUGIN_DIR' ) ) { diff --git a/readme.txt b/readme.txt index af3b88c..3cb8bf0 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: knowledge base, documentation, FAQ, support, wiki Requires at least: 6.9 Tested up to: 7.1 Requires PHP: 7.4 -Stable tag: 3.2.3 +Stable tag: 3.2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -183,6 +183,14 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 3.2.4 = + +Release date: 2 November 2026 + +**Security** + +* Hardened the related articles REST endpoint. + = 3.2.3 = Release date: 1 November 2026 @@ -264,14 +272,5 @@ For the changelog of earlier versions, please refer to the [releases page on Git == Upgrade Notice == -= 3.2.3 = -Fixes wrong thumbnails on attachment pages and, in Pro, code blocks, lists and shared article products in GitHub imports and Markdown exports. - -= 3.2.2 = -Security release. Prevents private articles from appearing in Pro Help widget suggestions and hardens thumbnail URLs. Also fixes errors with malformed thumbnail dimensions. Update recommended. - -= 3.2.1 = -Security release. Stops password-protected and private articles leaking through the REST API, listings, tables of contents and thumbnails. Also brings faster Pro Ask the Docs answers with model choice, a fallback provider and better caching, and keeps captions in Pro GitHub imports. - -= 3.2.0 = -Requires WordPress 6.9. Adds Abilities API tools for article search, section discovery and Pro draft creation. Pro also gains Ask the Docs (beta), grounded answers and a Content gaps report; this feature requires WordPress 7.0. += 3.2.4 = +Security hardening release. Update recommended.