PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
← All changes | widgets/RecentTopics.php +13 -0 3.1.13.1.6 View file →
@@ -123,8 +123,21 @@
123 123 if( is_array( $topic_args ) ) {
124 124 // Remove dangerous 'where' parameter
125 125 unset( $topic_args['where'] );
126 126
127 + // SECURITY: Strip parameters that bypass access controls
128 + // access_filter=false skips all permission checks (intended for admin backend only)
129 + // permgroup allows impersonating another usergroup's permissions
130 + // forumid (singular) bypasses access_filter() which only runs when forumid is null
131 + unset( $topic_args['access_filter'] );
132 + unset( $topic_args['permgroup'] );
133 + unset( $topic_args['forumid'] );
134 +
135 + // Cap row_count to prevent resource exhaustion
136 + if( isset( $topic_args['row_count'] ) ) {
137 + $topic_args['row_count'] = min( 50, max( 1, intval( $topic_args['row_count'] ) ) );
138 + }
139 +
127 140 // Validate 'orderby' parameter against whitelist
128 141 if( isset( $topic_args['orderby'] ) ) {
129 142 if( ! key_exists( $topic_args['orderby'], $this->orderby_fields ) ) {
130 143 $topic_args['orderby'] = $this->default_instance['orderby'];