| @@ -186,8 +186,17 @@ | ||
| 186 | 186 | |
| 187 | 187 | // Force permission checks — prevents check_private=false injection |
| 188 | 188 | $post_args['check_private'] = true; |
| 189 | 189 | |
| 190 | + // SECURITY: Strip forumid (singular) to force use of forumids (array) | |
| 191 | + // forumid bypasses access_filter() which only runs when forumid is null | |
| 192 | + unset( $post_args['forumid'] ); | |
| 193 | + | |
| 194 | + // Cap row_count to prevent resource exhaustion | |
| 195 | + if( isset( $post_args['row_count'] ) ) { | |
| 196 | + $post_args['row_count'] = min( 50, max( 1, intval( $post_args['row_count'] ) ) ); | |
| 197 | + } | |
| 198 | + | |
| 190 | 199 | // Validate 'orderby' parameter against whitelist |
| 191 | 200 | if( isset( $post_args['orderby'] ) ) { |
| 192 | 201 | if( ! key_exists( $post_args['orderby'], $this->orderby_fields ) ) { |
| 193 | 202 | $post_args['orderby'] = $this->default_instance['orderby']; |