PluginProbe
Vigilant – 100% Free Security Suite: Firewall, 2FA, Login, Headers, Scanner… / 3.0.4
Vigilant – 100% Free Security Suite: Firewall, 2FA, Login, Headers, Scanner… v3.0.4
3.0.5 3.0.4 3.0.3 3.0.2 3.0.1 3.0.0 2.11.12 2.11.11 2.11.10 2.11.9 2.11.7 2.11.8 2.11.6 2.11.5 2.11.4 2.11.3 2.11.1 2.11.2 2.11.0 2.10.5 2.10.4 2.10.3 2.10.2 2.10.1 2.10.0 All 93 releases
← All changes | includes/class-rest-api-security.php +9 -13 2.11.7 → 3.0.4 View file →
@@ -167,9 +167,14 @@
167 167 if ( empty( $current_route ) ) {
168 168 return false;
169 169 }
170 170
171 - $allowed_public = $this->options['allowed_public_endpoints'] ?? array();
171 + // Vigilante_Settings::list_or_shipped(): an empty list of a setting with
172 + // no field on screen is a leftover, not a choice. See its docblock.
173 + $allowed_public = Vigilante_Settings::list_or_shipped(
174 + $this->options['allowed_public_endpoints'] ?? array(),
175 + array( 'rest_api_security', 'allowed_public_endpoints' )
176 + );
172 177
173 178 foreach ( $allowed_public as $endpoint ) {
174 179 if ( strpos( $current_route, $endpoint ) === 0 ) {
175 180 return true;
@@ -331,19 +336,8 @@
331 336 return $endpoints;
332 337 }
333 338
334 339 /**
335 - * Block author query parameter enumeration
336 - */
337 - public function block_author_enumeration() {
338 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended
339 - if ( ! is_admin() && isset( $_GET['author'] ) ) {
340 - wp_safe_redirect( home_url(), 301 );
341 - exit;
342 - }
343 - }
344 -
345 - /**
346 340 * Get REST API security status
347 341 *
348 342 * @return array
349 343 */
@@ -353,9 +347,11 @@
353 347 'mode' => $this->options['mode'] ?? 'selective',
354 348 'user_enum_blocked' => ! empty( $this->options['block_user_enumeration'] ),
355 349 'jsonp_disabled' => ! empty( $this->options['disable_jsonp'] ),
356 350 'protected_endpoints' => count( $this->options['protected_endpoints'] ?? array() ),
357 - 'allowed_endpoints' => count( $this->options['allowed_public_endpoints'] ?? array() ),
351 + // Counted from the same value the check uses, or the screen would
352 + // report zero while five endpoints are exempt.
353 + 'allowed_endpoints' => count( Vigilante_Settings::list_or_shipped( $this->options['allowed_public_endpoints'] ?? array(), array( 'rest_api_security', 'allowed_public_endpoints' ) ) ),
358 354 );
359 355 }
360 356
361 357 /**