Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/22/2026 10:09:30 PM (3 days ago)
Author:
johnjamesjacoby
Message:

Security: tighten forum actions and visibility.

Require moderation and topic-edit permission for topic merges, topic splits, and reply moves. Centralize their presentation checks while retaining independent authorization in each handler. Check content status and parent-topic visibility across public views and feeds. Prepare legacy database values and add regression coverage for the affected paths.

In trunk, for 2.7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/engagements.php

    r7529 r7617  
    894894                $option_key = $this->get_user_option_key( $meta_key, 0, true );
    895895                $bbp_db     = bbp_db();
    896                 $user_ids   = $bbp_db->get_col( "SELECT user_id FROM {$bbp_db->usermeta} WHERE meta_key = '{$option_key}'" );
     896                $user_ids   = $bbp_db->get_col( $bbp_db->prepare( "SELECT user_id FROM {$bbp_db->usermeta} WHERE meta_key = %s", $option_key ) );
    897897                $u_count    = count( $user_ids );
    898898
    … …  
    940940                        $option_key = $this->get_user_option_key( $meta_key, $object_id, true );
    941941                        $bbp_db     = bbp_db();
    942                         $user_ids   = $bbp_db->get_col( "SELECT user_id FROM {$bbp_db->usermeta} WHERE meta_key = '{$option_key}' and FIND_IN_SET('{$object_id}', meta_value) > 0" );
     942                        $user_ids   = $bbp_db->get_col( $bbp_db->prepare( "SELECT user_id FROM {$bbp_db->usermeta} WHERE meta_key = %s AND FIND_IN_SET( %d, meta_value ) > 0", $option_key, $object_id ) );
    943943
    944944                        // Always cache results (even if empty, to prevent multiple misses)
Note: See TracChangeset for help on using the changeset viewer.