Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/wp-to-buffer/lib/shared/class-admin-ui.php
+++ b/wp-to-buffer/lib/shared/class-admin-ui.php
@@ -657,6 +657,11 @@
// Check nonce.
check_ajax_referer( 'wpzinc_admin_review_notice_dismiss_review', 'nonce' );
+ // Bail if the user cannot see the review notice.
+ if ( ! current_user_can( 'activate_plugins' ) ) {
+ wp_send_json_error();
+ }
+
// Mark review as dismissed.
update_option( $this->plugin->review_name . '-review-dismissed', 1 );
@@ -940,6 +945,11 @@
return;
}
+ // Bail if the user cannot access the Plugin's settings.
+ if ( ! current_user_can( apply_filters( str_replace( '-', '_', $this->plugin->name ) . '_admin_admin_menu_minimum_capability', 'manage_options' ) ) ) { // phpcs:ignore WordPress.NamingConventions.ValidHookName
+ return;
+ }
+
// Bail if no POST data.
if ( empty( $_POST ) ) {
return;
--- a/wp-to-buffer/lib/social/includes/class-admin.php
+++ b/wp-to-buffer/lib/social/includes/class-admin.php
@@ -611,14 +611,13 @@
}
/**
- * Add the Plugin to the WordPress Administration Menu
+ * Returns the minimum capability required to access the Plugin's settings.
*
- * @since 1.0.0
+ * @since 6.3.0
+ *
+ * @return string
*/
- public function admin_menu() {
-
- // Define the minimum capability required to access settings.
- $minimum_capability = 'manage_options';
+ public function get_minimum_capability() {
/**
* Defines the minimum capability required to access the Plugin's
@@ -629,7 +628,19 @@
* @param string $capability Minimum Required Capability.
* @return string Minimum Required Capability
*/
- $minimum_capability = apply_filters( $this->base->plugin->filter_name . '_admin_admin_menu_minimum_capability', $minimum_capability );
+ return apply_filters( $this->base->plugin->filter_name . '_admin_admin_menu_minimum_capability', 'manage_options' );
+
+ }
+
+ /**
+ * Add the Plugin to the WordPress Administration Menu
+ *
+ * @since 1.0.0
+ */
+ public function admin_menu() {
+
+ // Define the minimum capability required to access settings.
+ $minimum_capability = $this->get_minimum_capability();
/**
* Add settings menus and sub menus for the Plugin's settings.
--- a/wp-to-buffer/lib/social/includes/class-ajax.php
+++ b/wp-to-buffer/lib/social/includes/class-ajax.php
@@ -58,6 +58,11 @@
// Run a security check first.
check_ajax_referer( $this->base->plugin->name . '-username-save-twitter', 'nonce' );
+ // Bail if the user does not have permission.
+ if ( ! current_user_can( $this->base->get_class( 'admin' )->get_minimum_capability() ) ) {
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'wp-to-buffer' ) );
+ }
+
// Bail if no user ID or username was provided.
if ( ! isset( $_REQUEST['user_id'] ) ) {
wp_send_json_error( __( 'No user ID was provided.', 'wp-to-buffer' ) );
@@ -87,6 +92,11 @@
// Run a security check first.
check_ajax_referer( $this->base->plugin->name . '-save-statuses', 'nonce' );
+ // Bail if the user does not have permission.
+ if ( ! current_user_can( $this->base->get_class( 'admin' )->get_minimum_capability() ) ) {
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'wp-to-buffer' ) );
+ }
+
// Bail if no post type was provided.
if ( ! isset( $_REQUEST['post_type'] ) ) {
wp_send_json_error( __( 'No post type was provided.', 'wp-to-buffer' ) );
@@ -130,6 +140,11 @@
// Run a security check first.
check_ajax_referer( $this->base->plugin->name . '-get-status-row', 'nonce' );
+ // Bail if the user does not have permission.
+ if ( ! current_user_can( 'edit_posts' ) ) {
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'wp-to-buffer' ) );
+ }
+
// Bail if expect parameters were not was provided.
if ( ! isset( $_REQUEST['status'] ) ) {
wp_send_json_error( __( 'No status was provided.', 'wp-to-buffer' ) );
@@ -170,6 +185,11 @@
// Get Post ID.
$post_id = absint( $_REQUEST['post'] );
+ // Bail if the user does not have permission.
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'wp-to-buffer' ) );
+ }
+
// Return log table output.
wp_send_json_success( $this->base->get_class( 'log' )->build_log_table_output( $this->base->get_class( 'log' )->get( $post_id ) ) );
@@ -193,6 +213,11 @@
// Get Post ID.
$post_id = absint( $_REQUEST['post'] );
+ // Bail if the user does not have permission.
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ wp_send_json_error( __( 'You do not have permission to perform this action.', 'wp-to-buffer' ) );
+ }
+
// Clear log.
$this->base->get_class( 'log' )->delete_by_post_id( $post_id );
--- a/wp-to-buffer/lib/social/includes/class-log.php
+++ b/wp-to-buffer/lib/social/includes/class-log.php
@@ -1020,6 +1020,25 @@
}
/**
+ * Returns the HTML tags permitted in a log entry's result message.
+ *
+ * @since 6.3.0
+ *
+ * @return array
+ */
+ private function get_result_message_allowed_html() {
+
+ return array(
+ 'a' => array(
+ 'href' => array(),
+ 'target' => array(),
+ ),
+ 'br' => array(),
+ );
+
+ }
+
+ /**
* Takes a given array of log results, and builds HTML table row output
* that can be used by:
* - Posts > Log Meta Box
@@ -1087,25 +1106,25 @@
' . ( $is_wp_list_table ? $checkbox_id : '' ) . '
<td class="request_sent column-request_sent' . ( in_array( 'request_sent', $hidden, true ) ? ' hidden' : '' ) . '">' . get_date_from_gmt( $result['request_sent'], get_option( 'date_format' ) . ' H:i:s' ) . '</td>
<td class="action column-action' . ( in_array( 'action', $hidden, true ) ? ' hidden' : '' ) . '">' . ( isset( $post_actions[ $result['action'] ] ) ? $post_actions[ $result['action'] ] : ' ' ) . '</td>
- <td class="profile_name column-profile_name' . ( in_array( 'profile_name', $hidden, true ) ? ' hidden' : '' ) . '">' . ( empty( $result['profile_name'] ) ? __( 'N/A', 'wp-to-buffer' ) : $result['profile_name'] ) . '</td>
- <td class="status_text column-status_text' . ( in_array( 'status_text', $hidden, true ) ? ' hidden' : '' ) . '">' . ( empty( $result['status_text'] ) ? __( 'N/A', 'wp-to-buffer' ) : nl2br( $result['status_text'] ) ) . '</td>
+ <td class="profile_name column-profile_name' . ( in_array( 'profile_name', $hidden, true ) ? ' hidden' : '' ) . '">' . ( empty( $result['profile_name'] ) ? __( 'N/A', 'wp-to-buffer' ) : esc_html( $result['profile_name'] ) ) . '</td>
+ <td class="status_text column-status_text' . ( in_array( 'status_text', $hidden, true ) ? ' hidden' : '' ) . '">' . ( empty( $result['status_text'] ) ? __( 'N/A', 'wp-to-buffer' ) : nl2br( esc_html( $result['status_text'] ) ) ) . '</td>
<td class="result column-result' . ( in_array( 'result', $hidden, true ) ? ' hidden' : '' ) . '">' . ucfirst( $result['result'] ) . '</td>';
switch ( $result['result'] ) {
case 'success':
- $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . $result['result_message'] . '</td>
+ $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . wp_kses( $result['result_message'], $this->get_result_message_allowed_html() ) . '</td>
<td class="status_created_at column-status_created_at' . ( in_array( 'status_created_at', $hidden, true ) ? ' hidden' : '' ) . '">' . get_date_from_gmt( $result['status_created_at'], get_option( 'date_format' ) . ' H:i:s' ) . '</td>
<td class="status_due_at column-status_due_at' . ( in_array( 'status_due_at', $hidden, true ) ? ' hidden' : '' ) . '">' . ( ( $result['status_due_at'] !== '0000-00-00 00:00:00' ) ? get_date_from_gmt( $result['status_due_at'], get_option( 'date_format' ) . ' H:i:s' ) : '' ) . '</td>';
break;
case 'test':
- $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . $result['result_message'] . '</td>
+ $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . wp_kses( $result['result_message'], $this->get_result_message_allowed_html() ) . '</td>
<td class="status_created_at column-status_created_at' . ( in_array( 'status_created_at', $hidden, true ) ? ' hidden' : '' ) . '">' . get_date_from_gmt( $result['status_created_at'], get_option( 'date_format' ) . ' H:i:s' ) . '</td>
<td class="status_due_at column-status_due_at' . ( in_array( 'status_due_at', $hidden, true ) ? ' hidden' : '' ) . '">' . ( ( $result['status_due_at'] !== '0000-00-00 00:00:00' ) ? get_date_from_gmt( $result['status_due_at'], get_option( 'date_format' ) . ' H:i:s' ) : '' ) . '</td>';
break;
default:
- $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . nl2br( $result['result_message'] ) . '</td>
+ $html .= ' <td class="result_message column-result_message' . ( in_array( 'result_message', $hidden, true ) ? ' hidden' : '' ) . '">' . nl2br( wp_kses( $result['result_message'], $this->get_result_message_allowed_html() ) ) . '</td>
<td class="status_created_at column-status_created_at' . ( in_array( 'status_created_at', $hidden, true ) ? ' hidden' : '' ) . '"> </td>
<td class="status_due_at column-status_due_at' . ( in_array( 'status_due_at', $hidden, true ) ? ' hidden' : '' ) . '"> </td>';
break;
--- a/wp-to-buffer/wp-to-buffer.php
+++ b/wp-to-buffer/wp-to-buffer.php
@@ -8,7 +8,7 @@
* @wordpress-plugin
* Plugin Name: WP to Buffer
* Plugin URI: https://www.wpzinc.com/plugins/wordpress-to-buffer-pro
- * Version: 6.2.9
+ * Version: 6.3.0
* Author: WP Zinc
* Author URI: https://www.wpzinc.com
* Description: Send WordPress Pages, Posts or Custom Post Types to your Buffer (buffer.com) account for scheduled publishing to social networks.
@@ -27,8 +27,8 @@
}
// Define Plugin version and build date.
-define( 'WP_TO_BUFFER_PLUGIN_VERSION', '6.2.9' );
-define( 'WP_TO_BUFFER_PLUGIN_BUILD_DATE', '2026-10-24 10:00:00' );
+define( 'WP_TO_BUFFER_PLUGIN_VERSION', '6.3.0' );
+define( 'WP_TO_BUFFER_PLUGIN_BUILD_DATE', '2026-11-20 10:00:00' );
// Define Plugin paths.
define( 'WP_TO_BUFFER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );