Plugin Directory

Changeset 3754541


Ignore:
Timestamp:
10/19/2026 10:48:39 AM (4 weeks ago)
Author:
avakodeforge
Message:

Release 1.6.4 (trunk + tag; see readme changelog)

Location:
guardforge
Files:
26 edited
1 copied

Legend:

Unmodified
Added
Removed
  • guardforge/tags/1.6.4/admin/partials/hardening-score.php

    r3731705 r3754541  
    257257            </p>
    258258
    259             <?php if ( GUARDFORGE_Options::get( 'disable_rest_api' ) ) : ?>
     259            <?php if ( GUARDFORGE_Options::get( 'rest_lockdown' ) ) : ?>
    260260                <div class="gf-notice gf-notice-warn">
    261261                    ⚠ <?php esc_html_e( 'Your REST API is restricted to signed-in callers. GuardForge keeps this one route reachable on its own, so the badge still answers — you do not need to widen the allowlist for it.', 'guardforge' ); ?>
  • guardforge/tags/1.6.4/admin/partials/settings.php

    r3752344 r3754541  
    474474                    <?php
    475475                    $guardforge_render_toggle( 'disable_xmlrpc',        __( 'Disable XML-RPC', 'guardforge' ),                  __( 'Blocks xmlrpc.php — a primary DDoS / brute-force vector.', 'guardforge' ) );
    476                     $guardforge_render_toggle( 'disable_rest_api',      __( 'Restrict REST API to logged-in users', 'guardforge' ), __( 'Anonymous REST access is limited to the namespaces in the allowlist below.', 'guardforge' ) );
     476                    $guardforge_render_toggle( 'disable_rest_api',      __( 'Keep user records out of the REST API', 'guardforge' ), __( 'Visitors and customers cannot list your users or read their records through the REST API, the usual way login names are collected. Checkout, forms and webhooks keep working.', 'guardforge' ) );
    477477                    $guardforge_render_toggle( 'disable_rest_comments', __( 'Forbid comments via REST', 'guardforge' ),         __( 'Blocks POST /wp/v2/comments.', 'guardforge' ) );
     478                    $guardforge_render_toggle( 'rest_lockdown',         __( 'Close the whole REST API to visitors who are not signed in', 'guardforge' ), __( 'Only the namespaces in the REST API allowlist stay open to them. Anything that talks to your site through the REST API without signing in stops working unless its namespace is on that list.', 'guardforge' ), 'opt' );
     479                    $guardforge_rest_casualties = GUARDFORGE_Hardening::lockdown_casualties( GUARDFORGE_Hardening::parse_lines( (string) $opts['rest_allowlist'] ) );
     480                    ?>
     481                    <div class="gf-notice gf-notice-warn">
     482                        ⚠ <?php
     483                        if ( ! empty( $opts['rest_lockdown'] ) ) {
     484                            esc_html_e( 'The REST API is closed to visitors who are not signed in.', 'guardforge' );
     485                        } else {
     486                            esc_html_e( 'Before you close the whole REST API: it breaks the WooCommerce block cart and checkout, contact forms, webhooks other services send to your site, and embeds of your posts on other sites, unless their namespaces are in the allowlist.', 'guardforge' );
     487                        }
     488                        ?>
     489                        <?php if ( $guardforge_rest_casualties ) : ?>
     490                            <br /><?php
     491                            if ( ! empty( $opts['rest_lockdown'] ) ) {
     492                                esc_html_e( 'Not working for them on this site right now:', 'guardforge' );
     493                            } else {
     494                                esc_html_e( 'On this site, these would stop working for visitors:', 'guardforge' );
     495                            }
     496                            ?>
     497                            <ul style="margin:4px 0 0 18px;list-style:disc">
     498                                <?php foreach ( $guardforge_rest_casualties as $guardforge_rest_casualty ) : ?>
     499                                    <li><?php echo esc_html( $guardforge_rest_casualty['label'] ); ?> — <?php
     500                                        echo wp_kses(
     501                                            sprintf(
     502                                                /* translators: %s: a REST namespace such as wc/store */
     503                                                esc_html__( 'add %s to the allowlist to keep it', 'guardforge' ),
     504                                                '<code>' . esc_html( $guardforge_rest_casualty['namespace'] ) . '</code>'
     505                                            ),
     506                                            [ 'code' => [] ]
     507                                        );
     508                                    ?></li>
     509                                <?php endforeach; ?>
     510                            </ul>
     511                        <?php endif; ?>
     512                    </div>
     513                    <?php
    478514                    $guardforge_render_toggle( 'disable_embed',         __( 'Disable oEmbed discovery', 'guardforge' ),         __( 'Removes /oembed information leaks.', 'guardforge' ), 'opt' );
    479515                    $guardforge_render_toggle( 'disable_pingback',      __( 'Disable self-pingbacks', 'guardforge' ),           __( 'Blocks pingbacks pointing at your own URLs.', 'guardforge' ), 'opt' );
    … …  
    490526                    $guardforge_render_toggle( 'disable_user_enumeration', __( 'Block user enumeration', 'guardforge' ),       __( 'Redirects ?author=N and hides anonymous /wp/v2/users.', 'guardforge' ) );
    491527                    $guardforge_render_toggle( 'security_headers',         __( 'Send security HTTP headers', 'guardforge' ),   __( 'Referrer-Policy, X-Content-Type-Options, X-Frame-Options, Permissions-Policy.', 'guardforge' ) );
    492                     $guardforge_render_toggle( 'login_captcha_math',       __( 'Math captcha on login', 'guardforge' ),        __( 'Adds an a + b = ? challenge to the login form.', 'guardforge' ), 'opt' );
     528                    $guardforge_render_toggle( 'login_captcha_math',       __( 'Math captcha on login', 'guardforge' ),        __( 'Adds an a + b = ? challenge to the WordPress login page. Sign-in forms of shops and membership plugins are not affected, so customers can still log in.', 'guardforge' ), 'opt' );
    493529                    ?>
    494530                </div>
    … …  
    701737                        <label><?php esc_html_e( 'REST API allowlist', 'guardforge' ); ?></label>
    702738                        <textarea name="rest_allowlist" rows="3"><?php echo esc_textarea( $opts['rest_allowlist'] ); ?></textarea>
    703                         <div class="gf-field-desc"><?php esc_html_e( 'One namespace prefix per line. Routes whose namespace starts with one of these remain accessible to anonymous callers (oembed, formforge submissions, etc.).', 'guardforge' ); ?></div>
     739                        <div class="gf-field-desc"><?php esc_html_e( 'Used only when the whole REST API is closed to visitors. One route per line; it stays open together with everything under it. The defaults keep embeds, WooCommerce checkout and the public endpoints of Avakode plugins working.', 'guardforge' ); ?></div>
    704740                    </div>
    705741                    <div class="gf-field" style="grid-column:1/-1">
  • guardforge/tags/1.6.4/admin/partials/unblock.php

    r3731705 r3754541  
    1010
    1111if ( isset( $_POST['guardforge_unblock_ip'] ) && check_admin_referer( 'guardforge_unblock_ip' ) ) {
    12     $guardforge_ip = sanitize_text_field( wp_unslash( $_POST['guardforge_unblock_ip'] ) );
    13     delete_transient( GUARDFORGE_Bruteforce::attempts_key( $guardforge_ip ) );
    14     /* translators: %s is the IP address that was unblocked. */
    15     echo '<div class="gf-notice gf-notice-ok">✓ ' . sprintf( esc_html__( 'IP %s unblocked.', 'guardforge' ), '<code>' . esc_html( $guardforge_ip ) . '</code>' ) . '</div>';
     12    $guardforge_ip   = sanitize_text_field( wp_unslash( $_POST['guardforge_unblock_ip'] ) );
     13    // An address typed in the box, or the lockout key from the list below.
     14    $guardforge_lift = GUARDFORGE_Bruteforce::instance()->unblock( $guardforge_ip );
     15    if ( $guardforge_lift === 'ip' ) {
     16        /* translators: %s is the IP address that was unblocked. */
     17        echo '<div class="gf-notice gf-notice-ok">✓ ' . sprintf( esc_html__( 'IP %s unblocked.', 'guardforge' ), '<code>' . esc_html( $guardforge_ip ) . '</code>' ) . '</div>';
     18    } elseif ( $guardforge_lift === 'key' ) {
     19        echo '<div class="gf-notice gf-notice-ok">✓ ' . esc_html__( 'Lockout lifted.', 'guardforge' ) . '</div>';
     20    } else {
     21        echo '<div class="gf-notice gf-notice-warn">' . esc_html__( 'That is not an IP address, so nothing was unblocked.', 'guardforge' ) . '</div>';
     22    }
    1623}
    1724
  • guardforge/tags/1.6.4/guardforge.php

    r3752344 r3754541  
    44 * Plugin URI: https://guardforge.app
    55 * Description: Hardening, brute-force protection, two-factor authentication, file-integrity monitoring, audit log and Content-Security-Policy for WordPress. The Pro add-on adds a WAF, malware scanner, CVE feed, Geo-IP and alerts.
    6  * Version: 1.6.3
     6 * Version: 1.6.4
    77 * Author: Avakode
    88 * Author URI: https://avakode.com
    … …  
    1717}
    1818
    19 define( 'GUARDFORGE_VERSION',    '1.6.3' );
    20 define( 'GUARDFORGE_DB_VERSION', '1.6.0' ); // First screen: the switch-on dates (guardforge_*_enabled_since) are stamped once on upgrade.
     19define( 'GUARDFORGE_VERSION',    '1.6.4' );
     20define( 'GUARDFORGE_DB_VERSION', '1.6.4' ); // 1.6.4: REST settings migrated (narrow protection + opt-in lockdown). 1.6.0: switch-on dates stamped once.
    2121define( 'GUARDFORGE_DIR',        plugin_dir_path( __FILE__ ) );
    2222define( 'GUARDFORGE_URL',        plugin_dir_url( __FILE__ ) );
    … …  
    287287            require_once $guardforge_feedback_file;
    288288        }
    289         // The connection of a site to an Avakode account's credits (the AJAX handlers and the return
    290         // from avakode.com). It belongs to the AI client: the wp.org package has neither, so it has
    291         // no connection either.
    292         if ( class_exists( 'GUARDFORGE_Forge_API' ) ) {
    293             $guardforge_credits = GUARDFORGE_Forge_API::credits_connect();
    294             if ( $guardforge_credits ) {
    295                 $guardforge_credits->register();
    296             }
    297         }
     289        // The connection of a site to an Avakode account's credits is built on init, not here: building
     290        // it translates its sentences, and asking for the 'guardforge' text domain before init makes
     291        // WordPress 6.7+ log "_load_textdomain_just_in_time was called incorrectly" on every admin
     292        // request. Priority 1 is still ahead of admin-ajax.php and of the return from avakode.com.
     293        add_action( 'init', 'guardforge_register_credits_connect', 1 );
    298294    }
    299295}
    300296add_action( 'plugins_loaded', 'guardforge_init', 5 );
     297
     298/**
     299 * Registers the connection of a site to an Avakode account's credits (the AJAX handlers and the
     300 * return from avakode.com). It belongs to the AI client: the wp.org package has neither, so it has
     301 * no connection either.
     302 *
     303 * @return void
     304 */
     305function guardforge_register_credits_connect() {
     306    if ( ! class_exists( 'GUARDFORGE_Forge_API' ) ) {
     307        return;
     308    }
     309    $guardforge_credits = GUARDFORGE_Forge_API::credits_connect();
     310    if ( $guardforge_credits ) {
     311        $guardforge_credits->register();
     312    }
     313}
    301314
    302315register_activation_hook( __FILE__, function () {
  • guardforge/tags/1.6.4/includes/class-bruteforce.php

    r3736618 r3754541  
    2424    }
    2525
     26    /** Whether this request's wrong application password has been counted (see on_app_password_failed). */
     27    private $app_password_failure_counted = false;
     28
    2629    private function __construct() {
    2730        add_action( 'login_init',       [ $this, 'maybe_block_login' ], 1 );
    28         add_action( 'wp_login_failed',  [ $this, 'on_login_failed' ] );
     31        // login_init is fired by wp-login.php only. A login made anywhere else
     32        // (the shop's My Account form, a membership form, xmlrpc) goes through
     33        // authenticate, so the lockout is asked there too — last, after every
     34        // other handler: core's username/password handler (priority 20) finds
     35        // the user and checks the password itself and ignores the WP_Error it
     36        // is handed, so a refusal placed ahead of it never held against the
     37        // correct password.
     38        add_filter( 'authenticate',     [ $this, 'refuse_locked_login' ], PHP_INT_MAX, 3 );
     39        // The failure hook passes the error so a refusal is not counted again.
     40        add_action( 'wp_login_failed',  [ $this, 'on_login_failed' ], 10, 2 );
     41        // Application passwords (REST Basic auth) fail through their own hook.
     42        add_action( 'application_password_failed_authentication', [ $this, 'on_app_password_failed' ] );
     43        add_filter( 'rest_authentication_errors', [ $this, 'refuse_locked_basic_auth' ], 5 );
    2944        add_action( 'wp_login',         [ $this, 'on_login_success' ], 10, 2 );
    3045        add_action( 'guardforge_log_gc_cron', [ $this, 'gc_old_logs' ] );
    … …  
    6479    }
    6580
    66     public function on_login_failed( $username ) {
     81    /**
     82 * Whether the caller's address is out of tries right now, by the same
     83 * rules maybe_block_login applies: protection on, address not listed,
     84 * threshold reached, and the site not a staging copy.
     85 */
     86    private function is_locked_out() {
     87        if ( ! GUARDFORGE_Options::get( 'brute_force_protection' ) ) {
     88            return false;
     89        }
     90        $ip = GUARDFORGE_Ip::client_ip();
     91        if ( $this->is_whitelisted( $ip ) ) {
     92            return false;
     93        }
     94        if ( $this->get_attempts( $ip ) < (int) GUARDFORGE_Options::get( 'bf_max_attempts' ) ) {
     95            return false;
     96        }
     97        return ! GUARDFORGE_Staging::is_active();
     98    }
     99
     100    private function locked_error() {
     101        $minutes = (int) GUARDFORGE_Options::get( 'bf_lockout_minutes' );
     102        return new WP_Error(
     103            'guardforge_locked',
     104            sprintf(
     105                /* translators: %d is the lockout window in minutes. */
     106                esc_html__( 'Too many failed attempts. Try again in %d minutes.', 'guardforge' ),
     107                $minutes
     108            ),
     109            [ 'status' => 429 ]
     110        );
     111    }
     112
     113    /**
     114 * authenticate, last in line: refuse a login from an address that is out
     115 * of tries, whatever the handlers before it decided — a WP_User from the
     116 * right password included. A call with no credentials (a logout, a cookie
     117 * check) is not a login and is left alone.
     118 */
     119    public function refuse_locked_login( $user, $username = '', $password = '' ) {
     120        if ( (string) $username === '' && (string) $password === '' ) {
     121            return $user;
     122        }
     123        return $this->is_locked_out() ? $this->locked_error() : $user;
     124    }
     125
     126    /**
     127 * rest_authentication_errors, early: a request that really tries to log in
     128 * with Basic credentials (an application password) from a locked address
     129 * gets the refusal even if the password was right, so guessing yields
     130 * nothing. A request without them is a visitor reading the public API, and
     131 * keeps reading it.
     132 *
     133 * "Really tries" is decided the way core decides it: both halves of the
     134 * header must have come (PHP_AUTH_USER and PHP_AUTH_PW), and a user found
     135 * by the login cookie comes first, because core tries the application
     136 * password only when no cookie user was found. A web server that protects
     137 * the admin with htpasswd leaves the same two variables behind on every
     138 * request, and an administrator behind it with a valid cookie is not
     139 * guessing anything: refusing that request would take the block editor's
     140 * REST calls away from an editor on a locked address.
     141 */
     142    public function refuse_locked_basic_auth( $result ) {
     143        if ( ! empty( $result ) ) {
     144            return $result;
     145        }
     146        if ( empty( $_SERVER['PHP_AUTH_USER'] ) || ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
     147            return $result;
     148        }
     149        if ( $this->cookie_user_id() > 0 ) {
     150            return $result;
     151        }
     152        return $this->is_locked_out() ? $this->locked_error() : $result;
     153    }
     154
     155    /**
     156 * The user the login cookie names, 0 when there is none: the answer core's
     157 * determine_current_user gives at priority 10 and 20 before it looks at an
     158 * application password (the auth cookie, then the logged-in cookie that
     159 * front-end and REST requests carry). It reads the cookies only and sets
     160 * no current user, so it cannot start the application-password check
     161 * itself.
     162 */
     163    private function cookie_user_id() {
     164        if ( function_exists( 'wp_validate_auth_cookie' ) ) {
     165            $id = wp_validate_auth_cookie( '' );
     166            if ( $id ) {
     167                return (int) $id;
     168            }
     169            if ( function_exists( 'wp_validate_logged_in_cookie' ) ) {
     170                return (int) wp_validate_logged_in_cookie( false );
     171            }
     172        }
     173        return 0;
     174    }
     175
     176    /**
     177 * A wrong application password over REST: a failed login like any other.
     178 * XML-RPC is left to wp_login_failed, which the same attempt also fires.
     179 *
     180 * One request carries one Basic header, so it is one guess however often
     181 * core works the current user out again (a plugin that resets it makes
     182 * core check the same password a second time and fire this again).
     183 */
     184    public function on_app_password_failed( $error = null ) {
     185        if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
     186            return;
     187        }
     188        if ( $this->app_password_failure_counted ) {
     189            return;
     190        }
     191        $this->app_password_failure_counted = true;
     192        $username = isset( $_SERVER['PHP_AUTH_USER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) ) : '';
     193        $this->on_login_failed( $username );
     194    }
     195
     196    public function on_login_failed( $username, $error = null ) {
     197        // Our own refusal is not a new guess; counting it would push the end of
     198        // the lockout out on every retry.
     199        if ( $error instanceof WP_Error && $error->get_error_code() === 'guardforge_locked' ) {
     200            return;
     201        }
    67202        if ( ! GUARDFORGE_Options::get( 'brute_force_protection' ) ) {
    68203            return;
    … …  
    148283    }
    149284
     285    /**
     286 * Lift a lockout, by address or by the key the "Active lockouts" list
     287 * shows. That list cannot show the address — it is hashed into the key —
     288 * so its Unblock button posts the key, and treating that as an address
     289 * hashed it a second time and cleared a counter that was never there.
     290 *
     291 * A key is accepted only in the exact shape this class writes
     292 * (prefix + md5), so a posted value can never name another transient.
     293 *
     294 * @return string 'key', 'ip', or '' when the value is neither (nothing is deleted).
     295 */
     296    public function unblock( $subject ) {
     297        $subject = trim( (string) $subject );
     298        if ( preg_match( '/^' . preg_quote( self::ATTEMPTS_TRANSIENT_PREFIX, '/' ) . '[0-9a-f]{32}$/', $subject ) ) {
     299            delete_transient( $subject );
     300            return 'key';
     301        }
     302        if ( filter_var( $subject, FILTER_VALIDATE_IP ) ) {
     303            $this->clear_attempts( $subject );
     304            return 'ip';
     305        }
     306        return '';
     307    }
     308
    150309    public static function attempts_key( $ip ) {
    151310        return self::ATTEMPTS_TRANSIENT_PREFIX . md5( (string) $ip );
  • guardforge/tags/1.6.4/includes/class-core.php

    r3735184 r3754541  
    2424        add_filter( 'admin_body_class', [ $this, 'add_body_class' ] );
    2525        add_action( 'admin_notices', [ $this, 'pro_addon_outdated_notice' ] );
     26        add_action( 'admin_notices', [ $this, 'rest_migration_notice' ] );
     27        add_action( 'admin_post_guardforge_rest_notice_dismiss', [ $this, 'handle_rest_notice_dismiss' ] );
    2628        add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
    2729    }
    … …  
    7476        echo ' <a href="https://avakode.com/dashboard/downloads/" target="_blank" rel="noopener">' . esc_html( __( 'Open Downloads', 'guardforge' ) ) . '</a>';
    7577        echo '</p></div>';
     78    }
     79
     80    /**
     81 * Once, after the 1.6.4 update: what happened to the REST API protection.
     82 *
     83 * The update split "Restrict REST API" in two (see
     84 * GUARDFORGE_Options::migrate_rest_settings) and picked one for the
     85 * site, so the site owner is told which and where to change it. The
     86 * sentences carry no placeholders: the machine translator drops them.
     87 */
     88    public function rest_migration_notice() {
     89        if ( ! self::notice_screen_allows() ) {
     90            return;
     91        }
     92        $mode = GUARDFORGE_Options::rest_migration_notice();
     93        if ( $mode === null ) {
     94            return;
     95        }
     96        $settings = admin_url( 'admin.php?page=guardforge#gf-card-api' );
     97        $dismiss  = wp_nonce_url( admin_url( 'admin-post.php?action=guardforge_rest_notice_dismiss' ), 'guardforge_rest_notice_dismiss' );
     98
     99        echo '<div class="notice notice-warning"><p><strong>';
     100        if ( $mode === 'lockdown' ) {
     101            echo esc_html__( 'GuardForge still closes the REST API to visitors who are not signed in, as you had set it.', 'guardforge' );
     102            echo '</strong></p><p>';
     103            echo esc_html__( 'Version 1.6.4 split the REST API protection in two. Because you had written your own list of exceptions, the switch that closes the whole REST API is now on, with your list. To keep only user records private instead, turn that switch off in Settings, under API & Protocols.', 'guardforge' );
     104        } else {
     105            echo esc_html__( 'GuardForge now keeps only user records private in the REST API.', 'guardforge' );
     106            echo '</strong></p><p>';
     107            echo esc_html__( 'Version 1.6.4 split the REST API protection in two. The protection you had used the default list, which also shut out the WooCommerce cart and checkout, contact forms and webhooks, so it now closes user records to visitors and nothing else. To close the whole REST API to visitors who are not signed in, turn that switch on in Settings, under API & Protocols.', 'guardforge' );
     108        }
     109        echo '</p><p><a class="button button-primary" href="' . esc_url( $settings ) . '">' . esc_html__( 'Open Settings', 'guardforge' ) . '</a> ';
     110        echo '<a class="button" href="' . esc_url( $dismiss ) . '">' . esc_html__( 'Dismiss', 'guardforge' ) . '</a></p></div>';
     111    }
     112
     113    public function handle_rest_notice_dismiss() {
     114        if ( ! current_user_can( 'manage_options' ) ) {
     115            wp_die( esc_html__( 'Access denied.', 'guardforge' ) );
     116        }
     117        check_admin_referer( 'guardforge_rest_notice_dismiss' );
     118        GUARDFORGE_Options::dismiss_rest_migration_notice();
     119        $back = wp_get_referer();
     120        wp_safe_redirect( $back ? $back : admin_url() );
     121        exit;
    76122    }
    77123
  • guardforge/tags/1.6.4/includes/class-hardening-score.php

    r3735184 r3754541  
    6666        'notify_on_lockout',
    6767        'protect_sensitive_files',
    68         'rest_allowlist',
    6968        'security_headers',
    7069        'staging_force_production',
    … …  
    182181            'user_enumeration_blocked'   => false,
    183182            'rest_restricted'            => false,
    184             'rest_allowlist'             => [],
    185183            'security_headers'           => false,
    186184            'csp_enabled'                => false,
    … …  
    290288        $facts['user_enumeration_blocked'] = ! empty( $opts['disable_user_enumeration'] );
    291289        $facts['rest_restricted']          = ! empty( $opts['disable_rest_api'] );
    292         $facts['rest_allowlist']           = GUARDFORGE_Hardening::parse_lines( (string) ( $opts['rest_allowlist'] ?? '' ) );
    293290        $facts['security_headers']         = ! empty( $opts['security_headers'] );
    294291        $facts['csp_enabled']              = ! empty( $opts['csp_enabled'] );
    … …  
    718715
    719716        /*
    720  * The allowlist is matched by GUARDFORGE_Hardening as
    721  * strpos( $route, $needle ) === 0 — a prefix of the requested route.
    722  * So core comes back in two ways, and both have to count: an entry
    723  * short enough to be a prefix of "wp/v2" ("wp", or the whole thing),
    724  * and an entry that starts with "wp/v2" and re-admits one branch of
    725  * it ("wp/v2/users" is narrower and is still the login names).
    726  */
    727         $readmits_core = false;
    728         foreach ( (array) $f['rest_allowlist'] as $needle ) {
    729             $needle = trim( (string) $needle );
    730             if ( $needle === '' ) {
    731                 continue;
    732             }
    733             if ( strpos( 'wp/v2', $needle ) === 0 || strpos( $needle, 'wp/v2' ) === 0 ) {
    734                 $readmits_core = true;
    735                 break;
    736             }
    737         }
    738         if ( ! $f['rest_restricted'] ) {
    739             $rest_earned  = 0;
    740             $rest_message = __( 'The REST API answers anonymous callers on every namespace.', 'guardforge' );
    741         } elseif ( $readmits_core ) {
    742             $rest_earned  = 0;
    743             $rest_message = __( 'Restricted, but the allowlist lets wp/v2 back in — which is the part that was being restricted.', 'guardforge' );
    744         } else {
    745             $rest_earned  = 1;
    746             $rest_message = __( 'Anonymous REST access is limited to the allowlisted namespaces.', 'guardforge' );
    747         }
     717 * The REST protection that ships on (GUARD-REST-01, 1.6.4): user
     718 * records closed to anyone who is not staff. The full lockdown is not
     719 * scored — it breaks checkout, forms and webhooks, and a score that
     720 * asked for it would push owners into breaking their own site. The
     721 * allowlist belongs to the lockdown and cannot re-open user records,
     722 * so it no longer bears on this row.
     723 */
    748724        $items[] = self::item(
    749725            'rest_restricted',
    750726            self::WEIGHT_MEDIUM,
    751             __( 'The REST API is restricted to signed-in callers', 'guardforge' ),
    752             $rest_earned,
    753             $rest_message,
    754             __( 'An open REST API publishes users, posts, media and some settings to anonymous callers, and an allowlist entry that re-admits wp/v2 undoes the whole restriction while the checkbox still reads as on.', 'guardforge' ),
     727            __( 'The REST API keeps user records private', 'guardforge' ),
     728            $f['rest_restricted'] ? 1 : 0,
     729            $f['rest_restricted']
     730                ? __( 'Visitors and customers cannot list your users or read their records through the REST API.', 'guardforge' )
     731                : __( 'Anyone can list your users through the REST API.', 'guardforge' ),
     732            __( 'The REST users route hands out every author\'s login slug to anyone who asks, which turns password guessing from two unknowns into one.', 'guardforge' ),
    755733            true,
    756734            self::settings_anchor( 'api' ),
    757             __( 'Turn on the REST restriction and remove any allowlist line that matches wp/v2.', 'guardforge' )
     735            __( 'Turn on "Keep user records out of the REST API" under API & Protocols.', 'guardforge' )
    758736        );
    759737
  • guardforge/tags/1.6.4/includes/class-hardening.php

    r3712655 r3754541  
    3535        add_action( 'init', [ $this, 'block_xmlrpc_php' ], 1 );
    3636
    37         // REST API gating
     37        // REST API. The narrow protection (on by default) judges the request
     38        // WordPress is about to answer, whatever address reached it — served,
     39        // embedded (_embed) or internal. The full lockdown (opt-in) judges
     40        // only requests served over HTTP, so a page that renders REST data on
     41        // the server for a visitor keeps rendering.
     42        add_filter( 'rest_request_before_callbacks', [ $this, 'guard_user_records' ], 10, 3 );
    3843        add_filter( 'rest_authentication_errors', [ $this, 'filter_rest_authentication' ], 99 );
    3944
    … …  
    5661        add_filter( 'rest_endpoints',  [ $this, 'maybe_remove_users_endpoint' ] );
    5762        add_filter( 'rest_user_query', [ $this, 'filter_rest_user_query' ] );
     63        // The other two places core publishes login slugs: the author link in
     64        // an oEmbed answer and the users sitemap (Wordfence closes the same).
     65        add_filter( 'oembed_response_data',    [ $this, 'filter_oembed_author' ], 99 );
     66        add_filter( 'wp_sitemaps_add_provider', [ $this, 'filter_sitemap_provider' ], 99, 2 );
    5867
    5968        // oEmbed
    … …  
    93102
    94103    /**
    95  * Return WP_Error to block REST unless either:
    96  * - the user is logged in, or
    97  * - the requested route matches an allowlisted namespace.
    98  *
    99  * The allowlist prevents the original Lyuhon behaviour from breaking
    100  * block-editor previews, oEmbed, FormForge submissions, etc.
     104 * Narrow protection ('disable_rest_api', on by default): user records.
     105 *
     106 * The REST users route is how login names are harvested — the list, its
     107 * search, and a record by ID all carry the slug, which is usually the
     108 * login. Anyone who cannot write posts is refused it: visitors, and also
     109 * subscribers and customers, because on a store anyone can register and
     110 * "signed in" is no barrier. Staff keep it (the block editor lists
     111 * authors over REST), as does everyone for their own record and for
     112 * users/me, which core already limits to the caller.
     113 *
     114 * Hooked on rest_request_before_callbacks, so the decision is made on the
     115 * handler WordPress picked — not on the address the caller typed. That
     116 * covers /wp-json/, ?rest_route=, any spelling core's case-insensitive
     117 * matching accepts, and the internal request behind _embed=author.
     118 *
     119 * Nothing else is closed by default: the Store API, form submissions,
     120 * webhooks and published content are public by design.
     121 *
     122 * @param mixed $response Null, or an earlier refusal.
     123 * @param array $handler The matched handler.
     124 * @param WP_REST_Request $request
     125 * @return mixed
     126 */
     127    public function guard_user_records( $response, $handler, $request ) {
     128        if ( ! GUARDFORGE_Options::get( 'disable_rest_api' ) ) {
     129            return $response;
     130        }
     131        if ( $response instanceof WP_Error ) {
     132            return $response;
     133        }
     134        if ( ! is_object( $request ) || ! method_exists( $request, 'get_route' ) ) {
     135            return $response;
     136        }
     137        $kind = self::user_record_read( $handler, $request );
     138        if ( $kind === '' ) {
     139            return $response;
     140        }
     141        if ( current_user_can( 'edit_posts' ) ) {
     142            return $response;
     143        }
     144        if ( $kind === 'item' ) {
     145            $own = (int) get_current_user_id();
     146            $id  = (int) $request->get_param( 'id' );
     147            if ( $id === 0 && preg_match( '#/users/+(\d+)/*$#i', (string) $request->get_route(), $m ) ) {
     148                $id = (int) $m[1];
     149            }
     150            if ( $own > 0 && $id === $own ) {
     151                return $response;
     152            }
     153            // Core's own answer for an ID that is not there, so the refusal
     154            // says nothing about whether the account exists.
     155            return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.', 'guardforge' ), [ 'status' => 404 ] );
     156        }
     157        return new WP_Error(
     158            'rest_user_cannot_view',
     159            __( 'Sorry, you are not allowed to list users.', 'guardforge' ),
     160            [ 'status' => rest_authorization_required_code() ]
     161        );
     162    }
     163
     164    /**
     165 * 'list', 'item' or '' — whether this request reads user records.
     166 */
     167    private static function user_record_read( $handler, $request ) {
     168        $method = method_exists( $request, 'get_method' ) ? strtoupper( (string) $request->get_method() ) : 'GET';
     169        if ( $method !== 'GET' && $method !== 'HEAD' ) {
     170            return '';
     171        }
     172        $callback = is_array( $handler ) && isset( $handler['callback'] ) ? $handler['callback'] : null;
     173        if ( is_array( $callback ) && isset( $callback[0], $callback[1] ) && is_object( $callback[0] )
     174            && class_exists( 'WP_REST_Users_Controller' ) && $callback[0] instanceof WP_REST_Users_Controller ) {
     175            $name = strtolower( (string) $callback[1] );
     176            if ( $name === 'get_items' ) {
     177                return 'list';
     178            }
     179            return $name === 'get_item' ? 'item' : '';
     180        }
     181        $route = (string) $request->get_route();
     182        if ( preg_match( '#^/*wp/+v2/+users/*$#i', $route ) ) {
     183            return 'list';
     184        }
     185        if ( preg_match( '#^/*wp/+v2/+users/+\d+/*$#i', $route ) ) {
     186            return 'item';
     187        }
     188        return '';
     189    }
     190
     191    /**
     192 * Full lockdown ('rest_lockdown', off by default): every anonymous REST
     193 * call is refused unless its route is on the allowlist.
     194 *
     195 * The owner switches this on knowing it breaks whatever talks to the site
     196 * without signing in; the settings screen lists what that is on this site
     197 * (lockdown_casualties). The route judged is the one WordPress is
     198 * serving — its parsed rest_route query var, which /wp-json/<route> and
     199 * ?rest_route=<route> both fill — so plain permalinks behave exactly like
     200 * pretty ones.
    101201 */
    102202    public function filter_rest_authentication( $result ) {
    103         if ( ! GUARDFORGE_Options::get( 'disable_rest_api' ) ) {
     203        if ( ! GUARDFORGE_Options::get( 'rest_lockdown' ) ) {
    104204            return $result;
    105205        }
    … …  
    118218
    119219    private function current_rest_route_is_allowlisted() {
    120         $route = '';
    121         if ( function_exists( 'rest_get_url_prefix' ) ) {
    122             $prefix = rest_get_url_prefix();
    123             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only searched for the REST prefix and compared with the allowlist, never stored or printed; sanitising would change the route being judged.
    124             $path   = wp_unslash( $_SERVER['REQUEST_URI'] ?? '' );
    125             $needle = '/' . trim( $prefix, '/' ) . '/';
    126             $pos    = strpos( $path, $needle );
    127             if ( $pos !== false ) {
    128                 $route = ltrim( substr( $path, $pos + strlen( $needle ) ), '/' );
    129                 $qpos  = strpos( $route, '?' );
    130                 if ( $qpos !== false ) {
    131                     $route = substr( $route, 0, $qpos );
    132                 }
    133             }
    134         }
     220        $route = self::current_rest_route();
    135221        if ( $route === '' ) {
    136222            return false;
    … …  
    146232        $allowlist = apply_filters( 'guardforge/rest_allowlist', $allowlist, $route );
    147233
    148         foreach ( $allowlist as $needle ) {
    149             if ( $needle === '' ) {
     234        return self::route_is_allowlisted( $route, (array) $allowlist );
     235    }
     236
     237    /**
     238 * The REST route of the current request, normalised (see normalise_route).
     239 */
     240    private static function current_rest_route() {
     241        global $wp;
     242        if ( isset( $wp ) && is_object( $wp ) && isset( $wp->query_vars['rest_route'] ) && is_string( $wp->query_vars['rest_route'] ) ) {
     243            return self::normalise_route( $wp->query_vars['rest_route'] );
     244        }
     245        // Before WordPress has parsed the request: read it the way
     246        // WP::parse_request will — the query var first, then the path.
     247        // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- an anonymous REST request names its route here; it is only compared with the allowlist, never stored or printed.
     248        if ( isset( $_GET['rest_route'] ) && is_string( $_GET['rest_route'] ) ) {
     249            // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- same read-only comparison.
     250            return self::normalise_route( wp_unslash( $_GET['rest_route'] ) );
     251        }
     252        if ( ! function_exists( 'rest_get_url_prefix' ) ) {
     253            return '';
     254        }
     255        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only searched for the REST prefix and compared with the allowlist, never stored or printed; sanitising would change the route being judged.
     256        $path = (string) wp_unslash( $_SERVER['REQUEST_URI'] ?? '' );
     257        $qpos = strpos( $path, '?' );
     258        if ( $qpos !== false ) {
     259            $path = substr( $path, 0, $qpos );
     260        }
     261        $needle = '/' . trim( rest_get_url_prefix(), '/' ) . '/';
     262        $pos    = strpos( $path, $needle );
     263        if ( $pos === false ) {
     264            return '';
     265        }
     266        return self::normalise_route( substr( $path, $pos + strlen( $needle ) ) );
     267    }
     268
     269    /**
     270 * Lower case, single slashes, no slash at either end: "wc/store/v1/cart".
     271 * Core matches routes case-insensitively, so the allowlist does too.
     272 */
     273    public static function normalise_route( $route ) {
     274        $route = strtolower( (string) $route );
     275        $route = (string) preg_replace( '#/+#', '/', $route );
     276        return trim( $route, '/' );
     277    }
     278
     279    /**
     280 * Whether a route falls under one of the allowlist lines. A line covers
     281 * the route it names and everything below it, on whole segments:
     282 * "formforge/v1" covers "formforge/v1/forms/3/submit" but not
     283 * "formforge/v10", and "flowforge/v1/webhook" does not open the canvas.
     284 *
     285 * @param string $route
     286 * @param string $allowlist
     287 */
     288    public static function route_is_allowlisted( $route, array $allowlist ) {
     289        $route = self::normalise_route( $route );
     290        if ( $route === '' ) {
     291            return false;
     292        }
     293        foreach ( $allowlist as $line ) {
     294            $line = self::normalise_route( $line );
     295            if ( $line === '' ) {
    150296                continue;
    151297            }
    152             if ( strpos( $route, $needle ) === 0 ) {
     298            if ( $route === $line || strpos( $route, $line . '/' ) === 0 ) {
    153299                return true;
    154300            }
     301        }
     302        return false;
     303    }
     304
     305    /**
     306 * What the full lockdown stops for visitors on this site: the public
     307 * REST endpoints of active plugins (and core's oEmbed) that the given
     308 * allowlist does not cover. For the settings screen.
     309 *
     310 * @param string $allowlist
     311 * @param callable|null $is_active fn( string $slug ): bool — for tests.
     312 * @return array<int,array{label:string,namespace:string}>
     313 */
     314    public static function lockdown_casualties( array $allowlist, $is_active = null ) {
     315        if ( ! is_callable( $is_active ) ) {
     316            $is_active = [ __CLASS__, 'plugin_is_active' ];
     317        }
     318        $known = [
     319            [ 'slug' => 'core-oembed',    'namespace' => 'oembed/1.0',                       'label' => __( 'Embeds of your posts on other sites', 'guardforge' ) ],
     320            [ 'slug' => 'woocommerce',    'namespace' => 'wc/store',                         'label' => __( 'WooCommerce block cart and checkout (guest orders)', 'guardforge' ) ],
     321            [ 'slug' => 'contact-form-7', 'namespace' => 'contact-form-7/v1',                'label' => __( 'Contact Form 7 form submissions', 'guardforge' ) ],
     322            [ 'slug' => 'jetpack',        'namespace' => 'jetpack/v4',                       'label' => __( 'Jetpack connection to WordPress.com', 'guardforge' ) ],
     323            [ 'slug' => 'formforge',      'namespace' => 'formforge/v1',                     'label' => __( 'Form Forge form submissions', 'guardforge' ) ],
     324            [ 'slug' => 'flowforge',      'namespace' => 'flowforge/v1/webhook',             'label' => __( 'Cascade Forge webhooks from other services', 'guardforge' ) ],
     325            [ 'slug' => 'inclusiveforge', 'namespace' => 'inclusiveforge/v1/scan-completed', 'label' => __( 'Inclusive Forge scan results', 'guardforge' ) ],
     326        ];
     327        $out = [];
     328        foreach ( $known as $row ) {
     329            if ( $row['slug'] !== 'core-oembed' && ! call_user_func( $is_active, $row['slug'] ) ) {
     330                continue;
     331            }
     332            if ( self::route_is_allowlisted( $row['namespace'], $allowlist ) ) {
     333                continue;
     334            }
     335            $out[] = [ 'label' => $row['label'], 'namespace' => $row['namespace'] ];
     336        }
     337        return $out;
     338    }
     339
     340    /**
     341 * Whether a plugin with a public REST endpoint is running, by the class
     342 * or constant it defines once loaded.
     343 */
     344    public static function plugin_is_active( $slug ) {
     345        switch ( $slug ) {
     346            case 'woocommerce':
     347                return class_exists( 'WooCommerce' );
     348            case 'contact-form-7':
     349                return defined( 'WPCF7_VERSION' );
     350            case 'jetpack':
     351                return defined( 'JETPACK__VERSION' );
     352            case 'formforge':
     353                return defined( 'FORMFORGE_VERSION' );
     354            case 'flowforge':
     355                return defined( 'FLOWFORGE_VERSION' );
     356            case 'inclusiveforge':
     357                return defined( 'INCLUSIVEFORGE_VERSION' );
    155358        }
    156359        return false;
    … …  
    221424        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    222425        return $endpoints;
     426    }
     427
     428    /**
     429 * An oEmbed answer names the author and links their archive, whose slug
     430 * is usually the login.
     431 */
     432    public function filter_oembed_author( $data ) {
     433        if ( ! GUARDFORGE_Options::get( 'disable_user_enumeration' ) || ! is_array( $data ) ) {
     434            return $data;
     435        }
     436        unset( $data['author_name'], $data['author_url'] );
     437        return $data;
     438    }
     439
     440    /**
     441 * The users sitemap (wp-sitemap-users-1.xml) is a list of every author
     442 * archive — every author's slug in one file.
     443 */
     444    public function filter_sitemap_provider( $provider, $name ) {
     445        if ( $name === 'users' && GUARDFORGE_Options::get( 'disable_user_enumeration' ) ) {
     446            return false;
     447        }
     448        return $provider;
    223449    }
    224450
    … …  
    307533            return $user;
    308534        }
     535        // The field is drawn on the login_form action, which only wp-login.php
     536        // fires, so that is where it is checked — plus any form that posted the
     537        // field back because it drew it too. Every other sign-in (the shop's
     538        // My Account form, a membership plugin's form, an application password
     539        // over REST, wp_signon called by another plugin) never showed the
     540        // field and used to fail every time.
     541        // phpcs:ignore WordPress.Security.NonceVerification.Missing -- only asks whether the field was posted; nothing is read or stored.
     542        $field_posted = isset( $_POST['guardforge_captcha_key'] ) || isset( $_POST['guardforge_captcha_answer'] );
     543        if ( ! did_action( 'login_init' ) && ! $field_posted ) {
     544            return $user;
     545        }
    309546        // wp-login.php posts no nonce, and cannot: this runs before anyone is
    310547        // logged in. The key names a ten-minute transient the same form
  • guardforge/tags/1.6.4/includes/class-options.php

    r3735184 r3754541  
    1919
    2020    /**
     21 * The allowlist every site got before 1.6.4. A stored copy of exactly
     22 * this is a default nobody chose, so the upgrade replaces it with the
     23 * current one (migrate_rest_settings); an edited list is left alone.
     24 */
     25    /** The one-time record of what the 1.6.4 REST migration chose (see migrate_rest_settings). */
     26    const REST_MIGRATION_OPTION = 'guardforge_rest_migration';
     27
     28    const LEGACY_REST_ALLOWLIST = "oembed/1.0\nformforge/v1\nguardforge/v1";
     29
     30    /**
    2131 * Schema. Each entry: ['type' => bool|int|string|email|textarea|csv, 'default' => mixed].
    2232 * Used by `set` to sanitise, and by tests to enumerate.
    … …  
    2636            // API & Protocols
    2737            'disable_xmlrpc'             => [ 'type' => 'bool',     'default' => 1 ],
     38            // Until 1.6.4 'disable_rest_api' refused every anonymous REST call
     39            // outside the allowlist, on by default — and took the WooCommerce
     40            // Store API (block cart and checkout), contact forms and inbound
     41            // webhooks with it. The key keeps its name and its stored "on"; it
     42            // now means the narrow protection (user records closed to anyone
     43            // who is not staff, see GUARDFORGE_Hardening::guard_user_records).
     44            // Closing the whole REST API to visitors is 'rest_lockdown', off
     45            // until the owner asks for it, and only that switch reads the
     46            // allowlist. The allowlist's default carries the public endpoints
     47            // of our own plugins and the Store API: they hold nothing private,
     48            // and closing them only breaks the site.
    2849            'disable_rest_api'           => [ 'type' => 'bool',     'default' => 1 ],
    29             'rest_allowlist'             => [ 'type' => 'textarea', 'default' => "oembed/1.0\nformforge/v1\nguardforge/v1" ],
     50            'rest_lockdown'              => [ 'type' => 'bool',     'default' => 0 ],
     51            'rest_allowlist'             => [ 'type' => 'textarea', 'default' => "oembed/1.0\nguardforge/v1\nformforge/v1\nflowforge/v1/webhook\ninclusiveforge/v1/scan-completed\nwc/store" ],
    3052            'disable_rest_comments'      => [ 'type' => 'bool',     'default' => 1 ],
    3153            'disable_embed'              => [ 'type' => 'bool',     'default' => 0 ],
    … …  
    301323            // from here read as "every secondary screen was switched off".
    302324            'main'     => [
    303                 'disable_xmlrpc', 'disable_rest_api', 'rest_allowlist', 'disable_rest_comments',
     325                'disable_xmlrpc', 'disable_rest_api', 'rest_lockdown', 'rest_allowlist', 'disable_rest_comments',
    304326                'disable_embed', 'disable_pingback', 'hide_wp_version', 'disable_file_edit',
    305327                'disable_user_enumeration', 'security_headers', 'login_captcha_math',
    … …  
    362384
    363385    /**
     386 * 1.6.4 (GUARD-REST-01): the REST settings after the split into the
     387 * narrow protection and the opt-in lockdown.
     388 *
     389 * Before 1.6.4 "disable_rest_api" closed the whole REST API to visitors
     390 * outside an allowlist. It now means the narrow protection, and the old
     391 * behaviour is 'rest_lockdown', off by default. What an update does with a
     392 * site that had it on depends on what the owner did with the list:
     393 *
     394 * - the list is still the old default: nobody chose the full closure, it
     395 * was the default, and it took the cart, forms and webhooks down. The
     396 * site gets the narrow protection and the new default list;
     397 * - the list is the owner's own: they wrote exceptions to a full closure
     398 * and meant it. 'rest_lockdown' is switched on with their list, so the
     399 * update does not loosen a site silently.
     400 *
     401 * A site that had the restriction off changes nothing. In both cases of a
     402 * site that had it on, one notice (GUARDFORGE_Core::rest_migration_notice)
     403 * says what was chosen and where to change it.
     404 *
     405 * The decision is taken once: the first run records it in
     406 * REST_MIGRATION_OPTION, and every later run (the next database version)
     407 * stops there, so an owner who turned the lockdown off, or saved a list of
     408 * their own on the narrow protection, is never moved again. A fresh install
     409 * ($upgrading false) has nothing to move and nothing to say.
     410 *
     411 * @param bool $upgrading False for a site with no recorded database version.
     412 */
     413    public static function migrate_rest_settings( $upgrading = true ) {
     414        if ( false !== get_option( self::REST_MIGRATION_OPTION, false ) ) {
     415            return;
     416        }
     417        $mode = 'none';
     418        if ( $upgrading ) {
     419            $stored = get_option( self::OPTION_KEY, [] );
     420            if ( ! is_array( $stored ) ) {
     421                $stored = [];
     422            }
     423            // Never saved means the defaults of 1.6.3: the restriction on, the old list.
     424            $was_on = ! array_key_exists( 'disable_rest_api', $stored ) || ! empty( $stored['disable_rest_api'] );
     425            $list   = isset( $stored['rest_allowlist'] ) && is_string( $stored['rest_allowlist'] ) ? $stored['rest_allowlist'] : self::LEGACY_REST_ALLOWLIST;
     426            $legacy = GUARDFORGE_Hardening::parse_lines( $list ) === GUARDFORGE_Hardening::parse_lines( self::LEGACY_REST_ALLOWLIST );
     427            if ( $legacy ) {
     428                if ( isset( $stored['rest_allowlist'] ) ) {
     429                    $stored['rest_allowlist'] = self::defaults()['rest_allowlist'];
     430                    update_option( self::OPTION_KEY, $stored );
     431                }
     432                $mode = $was_on ? 'narrow' : 'none';
     433            } elseif ( $was_on ) {
     434                $stored['rest_lockdown'] = 1;
     435                update_option( self::OPTION_KEY, $stored );
     436                $mode = 'lockdown';
     437            }
     438        }
     439        update_option( self::REST_MIGRATION_OPTION, [ 'mode' => $mode, 'notice' => $mode === 'none' ? 0 : 1 ], false );
     440    }
     441
     442    /**
     443 * What the REST migration chose, for the notice: 'lockdown' or 'narrow'
     444 * while it is open for somebody who can change the settings, null
     445 * otherwise (nothing changed, dismissed, or not that person's to read).
     446 *
     447 * @return string|null
     448 */
     449    public static function rest_migration_notice() {
     450        $state = get_option( self::REST_MIGRATION_OPTION, false );
     451        if ( ! is_array( $state ) || empty( $state['notice'] ) || empty( $state['mode'] ) ) {
     452            return null;
     453        }
     454        if ( ! in_array( $state['mode'], [ 'lockdown', 'narrow' ], true ) || ! current_user_can( 'manage_options' ) ) {
     455            return null;
     456        }
     457        return $state['mode'];
     458    }
     459
     460    /** Close the notice for good; the decision itself stays recorded. */
     461    public static function dismiss_rest_migration_notice() {
     462        $state = get_option( self::REST_MIGRATION_OPTION, false );
     463        if ( ! is_array( $state ) ) {
     464            return;
     465        }
     466        $state['notice'] = 0;
     467        update_option( self::REST_MIGRATION_OPTION, $state, false );
     468    }
     469
     470    /**
    364471 * Reset to defaults — used by uninstall.php and tests.
    365472 */
  • guardforge/tags/1.6.4/includes/class-schema-manager.php

    r3731705 r3754541  
    2222        self::run_dbdelta();
    2323        self::stamp_enabled_since();
     24        // 1.6.4: the REST restriction split into a narrow default and an
     25        // opt-in lockdown; see the method for what it writes and what not.
     26        // No recorded version is a new install: nothing to move.
     27        GUARDFORGE_Options::migrate_rest_settings( $current !== '' );
    2428        update_option( self::VERSION_OPTION, GUARDFORGE_DB_VERSION, false );
    2529    }
  • guardforge/tags/1.6.4/includes/class-two-factor.php

    r3712655 r3754541  
    272272    }
    273273
     274    /**
     275 * The code page. The redirects live here; what is decided lives in
     276 * judge_challenge, which a test can call without the request ending.
     277 */
    274278    public function handle_verify_challenge() {
    275279        // The pending token stands in for a nonce here, and is the stronger of
    … …  
    280284        // phpcs:ignore WordPress.Security.NonceVerification.Missing -- see above.
    281285        $code  = isset( $_POST['guardforge_2fa_code'] ) ? sanitize_text_field( wp_unslash( $_POST['guardforge_2fa_code'] ) ) : '';
    282         $pending = $token !== '' ? self::read_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token ) : false;
    283         if ( ! is_array( $pending ) ) {
     286
     287        $verdict = $this->judge_challenge( $token, $code );
     288        if ( $verdict['status'] === 'expired' ) {
    284289            wp_safe_redirect( wp_login_url() );
    285290            exit;
    286291        }
    287         if ( ! $this->verify_code( (int) $pending['user_id'], $code ) ) {
     292        if ( $verdict['status'] === 'wrong' ) {
    288293            $url = add_query_arg( [
    289294                'action'   => 'validate_2fa',
    … …  
    294299            exit;
    295300        }
     301        $pending = $verdict['pending'];
    296302        self::forget_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token );
    297303        wp_set_auth_cookie( (int) $pending['user_id'], ! empty( $pending['remember'] ) );
    298304        wp_safe_redirect( admin_url() );
    299305        exit;
     306    }
     307
     308    /**
     309 * Judge one try at the code page: 'expired' (no such pending login),
     310 * 'wrong' or 'ok'.
     311 *
     312 * This page posts to admin-post.php, not wp-login.php, so neither of the
     313 * two things that stop a password guesser ever saw it: core's failure hook
     314 * (fired only when wp-login authenticates) and the lockout check on
     315 * login_init. Someone holding a stolen password could therefore try
     316 * six-digit codes for as long as the token lived. So the lockout is asked
     317 * first, before the code is even looked at, and a wrong code is reported
     318 * through the same failure hook a wrong password is — one counter, one
     319 * threshold, one log, one alert.
     320 *
     321 * @return array{status:string,pending:?array}
     322 */
     323    public function judge_challenge( $token, $code ) {
     324        $pending = $token !== '' ? self::read_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token ) : false;
     325        if ( ! is_array( $pending ) ) {
     326            return [ 'status' => 'expired', 'pending' => null ];
     327        }
     328        if ( class_exists( 'GUARDFORGE_Bruteforce' ) ) {
     329            // Ends the request with the lockout page when this address is out of tries.
     330            GUARDFORGE_Bruteforce::instance()->maybe_block_login();
     331        }
     332        if ( $this->verify_code( (int) $pending['user_id'], $code ) ) {
     333            return [ 'status' => 'ok', 'pending' => $pending ];
     334        }
     335        $account = get_userdata( (int) $pending['user_id'] );
     336        /** This action is documented in wp-includes/pluggable.php */
     337        do_action(
     338            'wp_login_failed', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core's own action, fired so every failed-login listener counts a wrong code.
     339            $account && isset( $account->user_login ) ? (string) $account->user_login : '',
     340            new WP_Error( 'gf_2fa_wrong', __( '<strong>Error:</strong> two-factor code is invalid.', 'guardforge' ) )
     341        );
     342        return [ 'status' => 'wrong', 'pending' => $pending ];
    300343    }
    301344
  • guardforge/tags/1.6.4/languages/guardforge.pot

    r3752344 r3754541  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Guard Forge – Security, Login Protection, 2FA & Audit Log 1.6.2\n"
     5"Project-Id-Version: Guard Forge – Security, Login Protection, 2FA & Audit Log 1.6.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/guardforge\n"
    7 "POT-Creation-Date: 2026-10-16T09:54:01+00:00\n"
     7"POT-Creation-Date: 2026-10-19T10:40:39+00:00\n"
    88"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    99"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    7070#: includes/class-audit-log.php:198
    7171#: includes/class-case-actions.php:346
     72#: includes/class-core.php:115
    7273#: includes/class-guard-report-export.php:109
    7374#: includes/class-hardening-score-badge.php:457
    74 #: includes/class-hardening-score.php:1533
     75#: includes/class-hardening-score.php:1511
    7576#: includes/class-integrity.php:818
    76 #: includes/class-two-factor.php:306
    77 #: includes/class-two-factor.php:324
     77#: includes/class-two-factor.php:349
     78#: includes/class-two-factor.php:367
    7879msgid "Access denied."
    7980msgstr ""
    … …  
    9091
    9192#: admin/partials/audit-log.php:53
    92 #: includes/class-core.php:138
     93#: includes/class-core.php:184
    9394msgid "Audit log"
    9495msgstr ""
    … …  
    186187
    187188#: admin/partials/audit-log.php:161
    188 #: admin/partials/unblock.php:89
     189#: admin/partials/unblock.php:96
    189190msgid "IP"
    190191msgstr ""
    … …  
    298299#: admin/partials/cases.php:76
    299300#: admin/partials/cases.php:220
    300 #: includes/class-core.php:137
     301#: includes/class-core.php:183
    301302msgid "Cases"
    302303msgstr ""
    … …  
    764765
    765766#: admin/partials/hardening-score.php:50
    766 #: includes/class-core.php:128
     767#: includes/class-core.php:174
    767768msgid "Hardening score"
    768769msgstr ""
    … …  
    937938
    938939#: admin/partials/integrity.php:59
    939 #: includes/class-core.php:131
     940#: includes/class-core.php:177
    940941msgid "File integrity"
    941942msgstr ""
    … …  
    12621263
    12631264#: admin/partials/login-log.php:60
    1264 #: includes/class-core.php:139
     1265#: includes/class-core.php:185
    12651266msgid "Login log"
    12661267msgstr ""
    … …  
    13081309#: admin/partials/scanner.php:15
    13091310#: admin/partials/scanner.php:35
    1310 #: includes/class-core.php:130
     1311#: includes/class-core.php:176
    13111312msgid "Malware scanner"
    13121313msgstr ""
    … …  
    14131414
    14141415#: admin/partials/settings.php:46
    1415 #: includes/class-core.php:127
     1416#: includes/class-core.php:173
    14161417msgid "Settings"
    14171418msgstr ""
    … …  
    15011502
    15021503#: admin/partials/settings.php:190
    1503 #: includes/class-core.php:132
     1504#: includes/class-core.php:178
    15041505msgid "Cloudflare"
    15051506msgstr ""
    … …  
    16011602
    16021603#: admin/partials/settings.php:476
    1603 msgid "Restrict REST API to logged-in users"
     1604msgid "Keep user records out of the REST API"
    16041605msgstr ""
    16051606
    16061607#: admin/partials/settings.php:476
    1607 msgid "Anonymous REST access is limited to the namespaces in the allowlist below."
     1608msgid "Visitors and customers cannot list your users or read their records through the REST API, the usual way login names are collected. Checkout, forms and webhooks keep working."
    16081609msgstr ""
    16091610
    … …  
    16171618
    16181619#: admin/partials/settings.php:478
     1620msgid "Close the whole REST API to visitors who are not signed in"
     1621msgstr ""
     1622
     1623#: admin/partials/settings.php:478
     1624msgid "Only the namespaces in the REST API allowlist stay open to them. Anything that talks to your site through the REST API without signing in stops working unless its namespace is on that list."
     1625msgstr ""
     1626
     1627#: admin/partials/settings.php:484
     1628msgid "The REST API is closed to visitors who are not signed in."
     1629msgstr ""
     1630
     1631#: admin/partials/settings.php:486
     1632msgid "Before you close the whole REST API: it breaks the WooCommerce block cart and checkout, contact forms, webhooks other services send to your site, and embeds of your posts on other sites, unless their namespaces are in the allowlist."
     1633msgstr ""
     1634
     1635#: admin/partials/settings.php:492
     1636msgid "Not working for them on this site right now:"
     1637msgstr ""
     1638
     1639#: admin/partials/settings.php:494
     1640msgid "On this site, these would stop working for visitors:"
     1641msgstr ""
     1642
     1643#. translators: %s: a REST namespace such as wc/store
     1644#: admin/partials/settings.php:503
     1645#, php-format
     1646msgid "add %s to the allowlist to keep it"
     1647msgstr ""
     1648
     1649#: admin/partials/settings.php:514
    16191650msgid "Disable oEmbed discovery"
    16201651msgstr ""
    16211652
    1622 #: admin/partials/settings.php:478
     1653#: admin/partials/settings.php:514
    16231654msgid "Removes /oembed information leaks."
    16241655msgstr ""
    16251656
    1626 #: admin/partials/settings.php:479
     1657#: admin/partials/settings.php:515
    16271658msgid "Disable self-pingbacks"
    16281659msgstr ""
    16291660
    1630 #: admin/partials/settings.php:479
     1661#: admin/partials/settings.php:515
    16311662msgid "Blocks pingbacks pointing at your own URLs."
    16321663msgstr ""
    16331664
    1634 #: admin/partials/settings.php:485
     1665#: admin/partials/settings.php:521
    16351666msgid "Hardening"
    16361667msgstr ""
    16371668
    1638 #: admin/partials/settings.php:488
     1669#: admin/partials/settings.php:524
    16391670msgid "Hide WordPress version"
    16401671msgstr ""
    16411672
    1642 #: admin/partials/settings.php:488
     1673#: admin/partials/settings.php:524
    16431674msgid "Removes the generator meta and ver=… query strings."
    16441675msgstr ""
    16451676
    1646 #: admin/partials/settings.php:489
     1677#: admin/partials/settings.php:525
    16471678msgid "Disable theme/plugin file editor"
    16481679msgstr ""
    16491680
    1650 #: admin/partials/settings.php:489
     1681#: admin/partials/settings.php:525
    16511682msgid "Defines DISALLOW_FILE_EDIT so PHP can't be edited from the admin."
    16521683msgstr ""
    16531684
    1654 #: admin/partials/settings.php:490
     1685#: admin/partials/settings.php:526
    16551686msgid "Block user enumeration"
    16561687msgstr ""
    16571688
    1658 #: admin/partials/settings.php:490
     1689#: admin/partials/settings.php:526
    16591690msgid "Redirects ?author=N and hides anonymous /wp/v2/users."
    16601691msgstr ""
    16611692
    1662 #: admin/partials/settings.php:491
     1693#: admin/partials/settings.php:527
    16631694msgid "Send security HTTP headers"
    16641695msgstr ""
    16651696
    1666 #: admin/partials/settings.php:491
     1697#: admin/partials/settings.php:527
    16671698msgid "Referrer-Policy, X-Content-Type-Options, X-Frame-Options, Permissions-Policy."
    16681699msgstr ""
    16691700
    1670 #: admin/partials/settings.php:492
     1701#: admin/partials/settings.php:528
    16711702msgid "Math captcha on login"
    16721703msgstr ""
    16731704
    1674 #: admin/partials/settings.php:492
    1675 msgid "Adds an a + b = ? challenge to the login form."
    1676 msgstr ""
    1677 
    1678 #: admin/partials/settings.php:498
     1705#: admin/partials/settings.php:528
     1706msgid "Adds an a + b = ? challenge to the WordPress login page. Sign-in forms of shops and membership plugins are not affected, so customers can still log in."
     1707msgstr ""
     1708
     1709#: admin/partials/settings.php:534
    16791710msgid "Files & Directories"
    16801711msgstr ""
    16811712
    1682 #: admin/partials/settings.php:501
     1713#: admin/partials/settings.php:537
    16831714msgid "Protect sensitive files"
    16841715msgstr ""
    16851716
    1686 #: admin/partials/settings.php:501
     1717#: admin/partials/settings.php:537
    16871718msgid "Denies direct access to wp-config.php, .htaccess, readme.html, license.txt via .htaccess."
    16881719msgstr ""
    16891720
    1690 #: admin/partials/settings.php:502
     1721#: admin/partials/settings.php:538
    16911722msgid "Disable directory listing"
    16921723msgstr ""
    16931724
    1694 #: admin/partials/settings.php:502
     1725#: admin/partials/settings.php:538
    16951726msgid "Options -Indexes — folders no longer show their contents."
    16961727msgstr ""
    16971728
    1698 #: admin/partials/settings.php:508
     1729#: admin/partials/settings.php:544
    16991730msgid "Spam & Bots"
    17001731msgstr ""
    17011732
    1702 #: admin/partials/settings.php:511
     1733#: admin/partials/settings.php:547
    17031734msgid "Comment-form honeypot"
    17041735msgstr ""
    17051736
    1706 #: admin/partials/settings.php:511
     1737#: admin/partials/settings.php:547
    17071738msgid "Adds a hidden field bots tend to fill — humans don't."
    17081739msgstr ""
    17091740
    1710 #: admin/partials/settings.php:512
     1741#: admin/partials/settings.php:548
    17111742msgid "Block malicious bot User-Agents"
    17121743msgstr ""
    17131744
    1714 #: admin/partials/settings.php:512
     1745#: admin/partials/settings.php:548
    17151746msgid "Blocks sqlmap, nikto, masscan, wpscan, nessus and similar scanners."
    17161747msgstr ""
    17171748
    1718 #: admin/partials/settings.php:518
     1749#: admin/partials/settings.php:554
    17191750msgid "Staging / development mode"
    17201751msgstr ""
    17211752
    1722 #: admin/partials/settings.php:533
     1753#: admin/partials/settings.php:569
    17231754msgid "Right now: staging mode is ON."
    17241755msgstr ""
    17251756
    1726 #: admin/partials/settings.php:534
     1757#: admin/partials/settings.php:570
    17271758msgid "Right now: staging mode is off and every protection is enforced."
    17281759msgstr ""
    17291760
    1730 #: admin/partials/settings.php:538
     1761#: admin/partials/settings.php:574
    17311762msgid "The address matched against your list:"
    17321763msgstr ""
    17331764
    1734 #: admin/partials/settings.php:544
     1765#: admin/partials/settings.php:580
    17351766msgid "Staging host names"
    17361767msgstr ""
    17371768
    1738 #: admin/partials/settings.php:546
     1769#: admin/partials/settings.php:582
    17391770msgid "One host name per line, matched against the address this site is actually served on. A leading dot matches every subdomain of that name but never the name itself, so \".example.com\" covers dev.example.com and leaves example.com alone. Nothing else is a pattern. Because the match is against the live address, copying this database onto your production site stops it matching the moment the domain changes."
    17401771msgstr ""
    17411772
    1742 #: admin/partials/settings.php:551
     1773#: admin/partials/settings.php:587
    17431774msgid "Always treat this site as production"
    17441775msgstr ""
    17451776
    1746 #: admin/partials/settings.php:552
     1777#: admin/partials/settings.php:588
    17471778msgid "Overrules everything above and every signal below it. Use this when a real site is being mistaken for a copy — it can only ever make GuardForge more protective, never less, which is why it is safe to keep in the database."
    17481779msgstr ""
    17491780
    1750 #: admin/partials/settings.php:557
     1781#: admin/partials/settings.php:593
    17511782msgid "While staging mode is on, GuardForge holds back:"
    17521783msgstr ""
    17531784
    1754 #: admin/partials/settings.php:559
     1785#: admin/partials/settings.php:595
    17551786msgid "Brute-force lockouts — attempts are still counted and written to the login log as \"soft_locked\", but nobody is shut out."
    17561787msgstr ""
    17571788
    1758 #: admin/partials/settings.php:560
     1789#: admin/partials/settings.php:596
    17591790msgid "Every notification e-mail: lockouts, new administrators and file-integrity changes."
    17601791msgstr ""
    17611792
    1762 #: admin/partials/settings.php:569
     1793#: admin/partials/settings.php:605
    17631794msgid "Telegram, Slack and webhook alerts."
    17641795msgstr ""
    17651796
    1766 #: admin/partials/settings.php:572
     1797#: admin/partials/settings.php:608
    17671798msgid "Cloudflare firewall rules — a copy shares the live zone and token, so a block pushed from here would land in front of your real site."
    17681799msgstr ""
    17691800
    1770 #: admin/partials/settings.php:575
     1801#: admin/partials/settings.php:611
    17711802msgid "Auto-lockdown — a spike in lockouts or a malware finding on a copy does not shut the site down."
    17721803msgstr ""
    17731804
    1774 #: admin/partials/settings.php:578
     1805#: admin/partials/settings.php:614
    17751806msgid "AI threat analysis, so a forgotten copy cannot spend your credits."
    17761807msgstr ""
    17771808
    1778 #: admin/partials/settings.php:581
     1809#: admin/partials/settings.php:617
    17791810msgid "To switch staging mode on by hand, add define( 'GUARDFORGE_STAGING_MODE', true ); to wp-config.php. Setting it to false pins the site to production. It lives in wp-config.php rather than in a setting on purpose: a database copied from staging onto your live site must never be able to carry the switch that turns your security off."
    17801811msgstr ""
    17811812
    1782 #: admin/partials/settings.php:587
     1813#: admin/partials/settings.php:623
    17831814msgid "Brute-force protection"
    17841815msgstr ""
    17851816
    1786 #: admin/partials/settings.php:590
     1817#: admin/partials/settings.php:626
    17871818msgid "Enable brute-force protection"
    17881819msgstr ""
    17891820
    1790 #: admin/partials/settings.php:590
     1821#: admin/partials/settings.php:626
    17911822msgid "Locks IPs that exceed the failed-attempt threshold."
    17921823msgstr ""
    17931824
    1794 #: admin/partials/settings.php:591
     1825#: admin/partials/settings.php:627
    17951826msgid "Record login attempts"
    17961827msgstr ""
    17971828
    1798 #: admin/partials/settings.php:591
     1829#: admin/partials/settings.php:627
    17991830msgid "Stores every login attempt in the database."
    18001831msgstr ""
    18011832
    1802 #: admin/partials/settings.php:592
     1833#: admin/partials/settings.php:628
    18031834msgid "Email on lockout"
    18041835msgstr ""
    18051836
    1806 #: admin/partials/settings.php:592
     1837#: admin/partials/settings.php:628
    18071838msgid "Send an email whenever an IP is locked out."
    18081839msgstr ""
    18091840
    1810 #: admin/partials/settings.php:598
     1841#: admin/partials/settings.php:634
    18111842msgid "Integrity monitoring"
    18121843msgstr ""
    18131844
    1814 #: admin/partials/settings.php:603
     1845#: admin/partials/settings.php:639
    18151846msgid "Monitor core file integrity"
    18161847msgstr ""
    18171848
    1818 #: admin/partials/settings.php:606
     1849#: admin/partials/settings.php:642
    18191850msgid "Off by default. When on, this site asks api.wordpress.org once a day for the official checksums of your WordPress version and compares wp-admin and wp-includes against them. The request carries the version and the locale, nothing about your site. \"Run scan now\" on the File integrity screen runs one scan without putting anything on a schedule."
    18201851msgstr ""
    18211852
    1822 #: admin/partials/settings.php:608
     1853#: admin/partials/settings.php:644
    18231854msgid "Email on integrity changes"
    18241855msgstr ""
    18251856
    1826 #: admin/partials/settings.php:608
     1857#: admin/partials/settings.php:644
    18271858msgid "Alerts you when modified or removed files are detected."
    18281859msgstr ""
    18291860
    1830 #: admin/partials/settings.php:609
     1861#: admin/partials/settings.php:645
    18311862msgid "Also monitor plugins & themes"
    18321863msgstr ""
    18331864
    1834 #: admin/partials/settings.php:609
     1865#: admin/partials/settings.php:645
    18351866msgid "Extends the scan to wp-content/plugins and wp-content/themes."
    18361867msgstr ""
    18371868
    1838 #: admin/partials/settings.php:613
     1869#: admin/partials/settings.php:649
    18391870msgid "Last scan:"
    18401871msgstr ""
    18411872
    1842 #: admin/partials/settings.php:638
     1873#: admin/partials/settings.php:674
    18431874msgid "Action audit"
    18441875msgstr ""
    18451876
    1846 #: admin/partials/settings.php:641
     1877#: admin/partials/settings.php:677
    18471878msgid "Log admin actions"
    18481879msgstr ""
    18491880
    1850 #: admin/partials/settings.php:641
     1881#: admin/partials/settings.php:677
    18511882msgid "Records plugin/theme/post/option/user/role changes."
    18521883msgstr ""
    18531884
    1854 #: admin/partials/settings.php:642
     1885#: admin/partials/settings.php:678
    18551886msgid "Email on new administrator"
    18561887msgstr ""
    18571888
    1858 #: admin/partials/settings.php:642
     1889#: admin/partials/settings.php:678
    18591890msgid "Sends an alert whenever a user is promoted to administrator."
    18601891msgstr ""
    18611892
    1862 #: admin/partials/settings.php:648
     1893#: admin/partials/settings.php:684
    18631894msgid "Content Security Policy"
    18641895msgstr ""
    18651896
    1866 #: admin/partials/settings.php:651
     1897#: admin/partials/settings.php:687
    18671898msgid "Send Content-Security-Policy header"
    18681899msgstr ""
    18691900
    1870 #: admin/partials/settings.php:651
     1901#: admin/partials/settings.php:687
    18711902msgid "Controls where scripts and styles may load from. Excellent XSS hardening when tuned."
    18721903msgstr ""
    18731904
    1874 #: admin/partials/settings.php:652
     1905#: admin/partials/settings.php:688
    18751906msgid "Send as report-only (recommended first)"
    18761907msgstr ""
    18771908
    1878 #: admin/partials/settings.php:652
     1909#: admin/partials/settings.php:688
    18791910msgid "Reports violations without blocking — flip off once your policy is tuned."
    18801911msgstr ""
    18811912
    1882 #: admin/partials/settings.php:655
     1913#: admin/partials/settings.php:691
    18831914msgid "CSP policy"
    18841915msgstr ""
    18851916
    1886 #: admin/partials/settings.php:657
     1917#: admin/partials/settings.php:693
    18871918msgid "Value of the Content-Security-Policy header. Test thoroughly — aggressive policies can break plugins."
    18881919msgstr ""
    18891920
    1890 #: admin/partials/settings.php:663
     1921#: admin/partials/settings.php:699
    18911922msgid "Brute-force & notification parameters"
    18921923msgstr ""
    18931924
    1894 #: admin/partials/settings.php:666
     1925#: admin/partials/settings.php:702
    18951926msgid "Max attempts"
    18961927msgstr ""
    18971928
    1898 #: admin/partials/settings.php:668
     1929#: admin/partials/settings.php:704
    18991930msgid "Failed attempts before the IP is locked."
    19001931msgstr ""
    19011932
    1902 #: admin/partials/settings.php:671
     1933#: admin/partials/settings.php:707
    19031934msgid "Lockout duration (minutes)"
    19041935msgstr ""
    19051936
    1906 #: admin/partials/settings.php:673
     1937#: admin/partials/settings.php:709
    19071938msgid "How long an IP stays locked."
    19081939msgstr ""
    19091940
    1910 #: admin/partials/settings.php:676
     1941#: admin/partials/settings.php:712
    19111942msgid "Login log retention (days)"
    19121943msgstr ""
    19131944
    1914 #: admin/partials/settings.php:678
     1945#: admin/partials/settings.php:714
    19151946msgid "Older login-log rows are pruned."
    19161947msgstr ""
    19171948
    1918 #: admin/partials/settings.php:681
     1949#: admin/partials/settings.php:717
    19191950msgid "Audit log retention (days)"
    19201951msgstr ""
    19211952
    1922 #: admin/partials/settings.php:683
     1953#: admin/partials/settings.php:719
    19231954msgid "Older audit rows are pruned."
    19241955msgstr ""
    19251956
    1926 #: admin/partials/settings.php:686
     1957#: admin/partials/settings.php:722
    19271958msgid "Notification email"
    19281959msgstr ""
    19291960
    1930 #: admin/partials/settings.php:688
     1961#: admin/partials/settings.php:724
    19311962msgid "Falls back to the site administrator email."
    19321963msgstr ""
    19331964
    1934 #: admin/partials/settings.php:691
     1965#: admin/partials/settings.php:727
    19351966msgid "IP whitelist"
    19361967msgstr ""
    19371968
    1938 #: admin/partials/settings.php:693
     1969#: admin/partials/settings.php:729
    19391970msgid "One IP or CIDR per line — never blocked."
    19401971msgstr ""
    19411972
    1942 #: admin/partials/settings.php:696
     1973#: admin/partials/settings.php:732
    19431974msgid "Trusted proxy CIDRs"
    19441975msgstr ""
    19451976
    1946 #: admin/partials/settings.php:698
     1977#: admin/partials/settings.php:734
    19471978msgid "Forwarded-IP headers are only trusted when REMOTE_ADDR matches one of these ranges. Leave empty if you do not run behind a proxy."
    19481979msgstr ""
    19491980
    1950 #: admin/partials/settings.php:701
     1981#: admin/partials/settings.php:737
    19511982msgid "REST API allowlist"
    19521983msgstr ""
    19531984
    1954 #: admin/partials/settings.php:703
    1955 msgid "One namespace prefix per line. Routes whose namespace starts with one of these remain accessible to anonymous callers (oembed, formforge submissions, etc.)."
    1956 msgstr ""
    1957 
    1958 #: admin/partials/settings.php:706
     1985#: admin/partials/settings.php:739
     1986msgid "Used only when the whole REST API is closed to visitors. One route per line; it stays open together with everything under it. The defaults keep embeds, WooCommerce checkout and the public endpoints of Avakode plugins working."
     1987msgstr ""
     1988
     1989#: admin/partials/settings.php:742
    19591990msgid "Extra User-Agent blocklist"
    19601991msgstr ""
    19611992
    1962 #: admin/partials/settings.php:708
     1993#: admin/partials/settings.php:744
    19631994msgid "One substring per line. Case-insensitive contains match."
    19641995msgstr ""
    19651996
    1966 #: admin/partials/settings.php:714
     1997#: admin/partials/settings.php:750
    19671998msgid "When GuardForge is deleted"
    19681999msgstr ""
    19692000
    1970 #: admin/partials/settings.php:718
     2001#: admin/partials/settings.php:754
    19712002msgid "Delete GuardForge data on uninstall"
    19722003msgstr ""
    19732004
    1974 #: admin/partials/settings.php:719
     2005#: admin/partials/settings.php:755
    19752006msgid "Off by default: deleting the plugin leaves your login log, integrity snapshots and audit trail in place, so an accidental removal does not take your history with it. Two-factor enrolments are the exception and are always removed — they are shared secrets, and a database that outlives the plugin should not keep them."
    19762007msgstr ""
    19772008
    1978 #: admin/partials/settings.php:728
     2009#: admin/partials/settings.php:764
    19792010msgid "Save settings"
    19802011msgstr ""
    … …  
    20792110
    20802111#. translators: %s is the IP address that was unblocked.
    2081 #: admin/partials/unblock.php:15
     2112#: admin/partials/unblock.php:17
    20822113#, php-format
    20832114msgid "IP %s unblocked."
    20842115msgstr ""
    20852116
    2086 #: admin/partials/unblock.php:41
    2087 #: includes/class-core.php:140
     2117#: admin/partials/unblock.php:19
     2118msgid "Lockout lifted."
     2119msgstr ""
     2120
     2121#: admin/partials/unblock.php:21
     2122msgid "That is not an IP address, so nothing was unblocked."
     2123msgstr ""
     2124
     2125#: admin/partials/unblock.php:48
     2126#: includes/class-core.php:186
    20882127msgid "Unblock IP"
    20892128msgstr ""
    20902129
    2091 #: admin/partials/unblock.php:41
     2130#: admin/partials/unblock.php:48
    20922131msgid "Lift brute-force lockouts"
    20932132msgstr ""
    20942133
    2095 #: admin/partials/unblock.php:44
     2134#: admin/partials/unblock.php:51
    20962135msgid "Manual unblock"
    20972136msgstr ""
    20982137
    2099 #: admin/partials/unblock.php:48
     2138#: admin/partials/unblock.php:55
    21002139msgid "Enter IP address"
    21012140msgstr ""
    21022141
    2103 #: admin/partials/unblock.php:49
    2104 #: admin/partials/unblock.php:75
    2105 #: admin/partials/unblock.php:100
    2106 #: includes/class-core.php:187
     2142#: admin/partials/unblock.php:56
     2143#: admin/partials/unblock.php:82
     2144#: admin/partials/unblock.php:107
     2145#: includes/class-core.php:233
    21072146msgid "Unblock"
    21082147msgstr ""
    21092148
    21102149#. translators: %d is the number of active IP lockouts.
    2111 #: admin/partials/unblock.php:57
     2150#: admin/partials/unblock.php:64
    21122151#, php-format
    21132152msgid "Active lockouts (%d)"
    21142153msgstr ""
    21152154
    2116 #: admin/partials/unblock.php:60
     2155#: admin/partials/unblock.php:67
    21172156msgid "No active lockouts."
    21182157msgstr ""
    21192158
    2120 #: admin/partials/unblock.php:63
     2159#: admin/partials/unblock.php:70
    21212160msgid "Transient key"
    21222161msgstr ""
    21232162
    2124 #: admin/partials/unblock.php:63
     2163#: admin/partials/unblock.php:70
    21252164msgid "Attempts"
    21262165msgstr ""
    21272166
    2128 #: admin/partials/unblock.php:63
    2129 #: admin/partials/unblock.php:89
     2167#: admin/partials/unblock.php:70
     2168#: admin/partials/unblock.php:96
    21302169msgid "Action"
    21312170msgstr ""
    21322171
    2133 #: admin/partials/unblock.php:87
     2172#: admin/partials/unblock.php:94
    21342173msgid "IPs from lockout log"
    21352174msgstr ""
    21362175
    2137 #: admin/partials/unblock.php:89
     2176#: admin/partials/unblock.php:96
    21382177msgid "Times locked"
    21392178msgstr ""
    21402179
    2141 #: admin/partials/unblock.php:89
     2180#: admin/partials/unblock.php:96
    21422181msgid "Last time"
    21432182msgstr ""
    … …  
    21582197
    21592198#: admin/partials/vuln-db.php:105
    2160 #: includes/class-core.php:129
     2199#: includes/class-core.php:175
    21612200msgid "Vulnerabilities"
    21622201msgstr ""
    … …  
    22172256
    22182257#: admin/partials/vuln-db.php:167
     2258#: includes/class-core.php:109
    22192259msgid "Open Settings"
    22202260msgstr ""
    … …  
    23012341
    23022342#. translators: %d is the lockout window in minutes.
    2303 #: includes/class-bruteforce.php:57
     2343#: includes/class-bruteforce.php:72
     2344#: includes/class-bruteforce.php:106
    23042345#, php-format
    23052346msgid "Too many failed attempts. Try again in %d minutes."
    23062347msgstr ""
    23072348
    2308 #: includes/class-bruteforce.php:60
     2349#: includes/class-bruteforce.php:75
    23092350msgid "Access temporarily blocked"
    23102351msgstr ""
    23112352
    2312 #: includes/class-bruteforce.php:250
     2353#: includes/class-bruteforce.php:409
    23132354msgid "GuardForge — IP locked out"
    23142355msgstr ""
    23152356
    23162357#. translators: 1: IP, 2: username, 3: timestamp.
    2317 #: includes/class-bruteforce.php:254
     2358#: includes/class-bruteforce.php:413
    23182359#, php-format
    23192360msgid ""
    … …  
    23422383
    23432384#. translators: 1: installed Pro version, 2: required Pro version
    2344 #: includes/class-core.php:65
     2385#: includes/class-core.php:67
    23452386#, php-format
    23462387msgid "GuardForge Pro %1$s is too old for this version of GuardForge, so it is switched off rather than left running. Install GuardForge Pro %2$s or newer."
    23472388msgstr ""
    23482389
    2349 #: includes/class-core.php:71
     2390#: includes/class-core.php:73
    23502391msgid "Until then alerts to Telegram, Slack or a webhook, the Cloudflare firewall push, automatic lockdown, patch by update, the WAF, malware scanning, AI threat analysis, required 2FA and audit export are unavailable. Your logs, baselines and settings are kept."
    23512392msgstr ""
    23522393
    2353 #: includes/class-core.php:73
     2394#: includes/class-core.php:75
    23542395msgid "If Dashboard → Updates lists no update for it, download the add-on from your Avakode dashboard and upload it over this copy in Plugins → Add New Plugin → Upload Plugin."
    23552396msgstr ""
    23562397
    2357 #: includes/class-core.php:74
     2398#: includes/class-core.php:76
    23582399msgid "Open Downloads"
    23592400msgstr ""
    23602401
    2361 #: includes/class-core.php:102
     2402#: includes/class-core.php:101
     2403msgid "GuardForge still closes the REST API to visitors who are not signed in, as you had set it."
     2404msgstr ""
     2405
    23622406#: includes/class-core.php:103
     2407msgid "Version 1.6.4 split the REST API protection in two. Because you had written your own list of exceptions, the switch that closes the whole REST API is now on, with your list. To keep only user records private instead, turn that switch off in Settings, under API & Protocols."
     2408msgstr ""
     2409
     2410#: includes/class-core.php:105
     2411msgid "GuardForge now keeps only user records private in the REST API."
     2412msgstr ""
     2413
     2414#: includes/class-core.php:107
     2415msgid "Version 1.6.4 split the REST API protection in two. The protection you had used the default list, which also shut out the WooCommerce cart and checkout, contact forms and webhooks, so it now closes user records to visitors and nothing else. To close the whole REST API to visitors who are not signed in, turn that switch on in Settings, under API & Protocols."
     2416msgstr ""
     2417
     2418#: includes/class-core.php:110
     2419msgid "Dismiss"
     2420msgstr ""
     2421
     2422#: includes/class-core.php:148
     2423#: includes/class-core.php:149
    23632424msgid "GuardForge"
    23642425msgstr ""
    23652426
    2366 #: includes/class-core.php:141
     2427#: includes/class-core.php:187
    23672428msgid "Lockdown"
    23682429msgstr ""
    23692430
    2370 #: includes/class-core.php:142
     2431#: includes/class-core.php:188
    23712432msgid "Geo-IP"
    23722433msgstr ""
    23732434
    2374 #: includes/class-core.php:143
     2435#: includes/class-core.php:189
    23752436msgid "2FA"
    23762437msgstr ""
    23772438
    2378 #: includes/class-core.php:185
     2439#: includes/class-core.php:231
    23792440msgid "Clear the log? This cannot be undone."
    23802441msgstr ""
    23812442
    2382 #: includes/class-core.php:186
     2443#: includes/class-core.php:232
    23832444msgid "Scanning…"
    23842445msgstr ""
    … …  
    25722633msgstr ""
    25732634
     2635#: includes/class-hardening-score.php:493
     2636msgid "The site is served over HTTPS"
     2637msgstr ""
     2638
     2639#: includes/class-hardening-score.php:495
     2640msgid "Yes."
     2641msgstr ""
     2642
     2643#: includes/class-hardening-score.php:495
     2644msgid "No — this site answers on plain HTTP."
     2645msgstr ""
     2646
    25742647#: includes/class-hardening-score.php:496
    2575 msgid "The site is served over HTTPS"
    2576 msgstr ""
    2577 
    2578 #: includes/class-hardening-score.php:498
    2579 msgid "Yes."
    2580 msgstr ""
    2581 
    2582 #: includes/class-hardening-score.php:498
    2583 msgid "No — this site answers on plain HTTP."
     2648msgid "Without TLS every password and every session cookie crosses the network readable, so anyone on the same path can take the session and replay it."
    25842649msgstr ""
    25852650
    25862651#: includes/class-hardening-score.php:499
    2587 msgid "Without TLS every password and every session cookie crosses the network readable, so anyone on the same path can take the session and replay it."
    2588 msgstr ""
    2589 
    2590 #: includes/class-hardening-score.php:502
    25912652msgid "Install a certificate with your host, then set the WordPress and site addresses to https."
    25922653msgstr ""
    25932654
    2594 #: includes/class-hardening-score.php:510
     2655#: includes/class-hardening-score.php:507
    25952656msgid "Administrators using two-factor authentication"
    25962657msgstr ""
    25972658
    25982659#. translators: %1$d is the number of enrolled administrators, %2$d the total.
    2599 #: includes/class-hardening-score.php:515
     2660#: includes/class-hardening-score.php:512
    26002661#, php-format
    26012662msgid "%1$d of %2$d administrators are enrolled."
    26022663msgstr ""
    26032664
    2604 #: includes/class-hardening-score.php:519
     2665#: includes/class-hardening-score.php:516
    26052666msgid "This site has no administrator accounts."
    26062667msgstr ""
    26072668
     2669#: includes/class-hardening-score.php:517
     2670msgid "A reused or phished administrator password is the shortest route to running code on the server; a second factor is what makes the password on its own worthless."
     2671msgstr ""
     2672
    26082673#: includes/class-hardening-score.php:520
    2609 msgid "A reused or phished administrator password is the shortest route to running code on the server; a second factor is what makes the password on its own worthless."
    2610 msgstr ""
    2611 
    2612 #: includes/class-hardening-score.php:523
    26132674msgid "Enrol on the 2FA screen, and ask every other administrator to do the same."
    26142675msgstr ""
    26152676
     2677#: includes/class-hardening-score.php:528
     2678msgid "WordPress has not checked for updates yet on this install."
     2679msgstr ""
     2680
    26162681#: includes/class-hardening-score.php:531
    2617 msgid "WordPress has not checked for updates yet on this install."
    2618 msgstr ""
    2619 
    2620 #: includes/class-hardening-score.php:534
    26212682msgid "WordPress core is behind."
    26222683msgstr ""
    26232684
    26242685#. translators: %d is the number of plugins and themes with an update waiting.
    2625 #: includes/class-hardening-score.php:539
     2686#: includes/class-hardening-score.php:536
    26262687#, php-format
    26272688msgid "Core is current; %d plugin or theme updates are waiting."
    26282689msgstr ""
    26292690
    2630 #: includes/class-hardening-score.php:544
     2691#: includes/class-hardening-score.php:541
    26312692msgid "Nothing is waiting to be updated."
    26322693msgstr ""
    26332694
     2695#: includes/class-hardening-score.php:546
     2696msgid "Core, plugins and themes are up to date"
     2697msgstr ""
     2698
    26342699#: includes/class-hardening-score.php:549
    2635 msgid "Core, plugins and themes are up to date"
     2700msgid "Almost every mass compromise of a WordPress site starts with a version whose vulnerability was published, and patched, weeks earlier."
    26362701msgstr ""
    26372702
    26382703#: includes/class-hardening-score.php:552
    2639 msgid "Almost every mass compromise of a WordPress site starts with a version whose vulnerability was published, and patched, weeks earlier."
    2640 msgstr ""
    2641 
    2642 #: includes/class-hardening-score.php:555
    26432704msgid "Apply the waiting updates, then turn on automatic updates for anything you do not review by hand."
    26442705msgstr ""
    26452706
     2707#: includes/class-hardening-score.php:560
     2708msgid "PHP errors are not printed to visitors"
     2709msgstr ""
     2710
    26462711#: includes/class-hardening-score.php:563
    2647 msgid "PHP errors are not printed to visitors"
    2648 msgstr ""
    2649 
    2650 #: includes/class-hardening-score.php:566
    26512712msgid "WP_DEBUG and WP_DEBUG_DISPLAY are both on."
    26522713msgstr ""
    26532714
    2654 #: includes/class-hardening-score.php:567
     2715#: includes/class-hardening-score.php:564
    26552716msgid "Errors are not displayed."
    26562717msgstr ""
    26572718
    2658 #: includes/class-hardening-score.php:568
     2719#: includes/class-hardening-score.php:565
    26592720msgid "A displayed PHP error prints absolute paths, database names and fragments of your queries into the page for whoever triggered it."
    26602721msgstr ""
    26612722
    2662 #: includes/class-hardening-score.php:573
     2723#: includes/class-hardening-score.php:570
    26632724msgid "Edit wp-config.php: set WP_DEBUG to false, or leave WP_DEBUG on and set WP_DEBUG_DISPLAY to false with WP_DEBUG_LOG on. No admin screen can change this."
    26642725msgstr ""
    26652726
     2727#: includes/class-hardening-score.php:576
     2728msgid "XML-RPC is switched off"
     2729msgstr ""
     2730
     2731#: includes/class-hardening-score.php:578
     2732#: includes/class-hardening-score.php:647
     2733#: includes/class-hardening-score.php:837
     2734#: includes/class-hardening-score.php:851
     2735msgid "Off."
     2736msgstr ""
     2737
     2738#: includes/class-hardening-score.php:578
     2739msgid "On — xmlrpc.php answers anonymous callers."
     2740msgstr ""
     2741
    26662742#: includes/class-hardening-score.php:579
    2667 msgid "XML-RPC is switched off"
    2668 msgstr ""
    2669 
    2670 #: includes/class-hardening-score.php:581
    2671 #: includes/class-hardening-score.php:650
    2672 #: includes/class-hardening-score.php:859
    2673 #: includes/class-hardening-score.php:873
    2674 msgid "Off."
    2675 msgstr ""
    2676 
    2677 #: includes/class-hardening-score.php:581
    2678 msgid "On — xmlrpc.php answers anonymous callers."
     2743msgid "One xmlrpc.php request can try hundreds of passwords through system.multicall, and the same endpoint answers pingback.ping for reflection attacks against other people."
    26792744msgstr ""
    26802745
    26812746#: includes/class-hardening-score.php:582
    2682 msgid "One xmlrpc.php request can try hundreds of passwords through system.multicall, and the same endpoint answers pingback.ping for reflection attacks against other people."
    2683 msgstr ""
    2684 
    2685 #: includes/class-hardening-score.php:585
    26862747msgid "Turn on \"Disable XML-RPC\" under API & Protocols. Only turn it back on if you still publish from a desktop or mobile client that needs it."
    26872748msgstr ""
    26882749
    2689 #: includes/class-hardening-score.php:591
     2750#: includes/class-hardening-score.php:588
    26902751msgid "Off — failed logins are never counted."
    26912752msgstr ""
    26922753
    26932754#. translators: %d is the configured number of failed attempts before lockout.
    2694 #: includes/class-hardening-score.php:596
     2755#: includes/class-hardening-score.php:593
    26952756#, php-format
    26962757msgid "On, locking out after %d failed attempts."
    … …  
    26982759
    26992760#. translators: %d is the configured number of failed attempts before lockout.
    2700 #: includes/class-hardening-score.php:603
     2761#: includes/class-hardening-score.php:600
    27012762#, php-format
    27022763msgid "On, but %d attempts is a generous budget for a guessing script."
    … …  
    27042765
    27052766#. translators: %d is the configured number of failed attempts before lockout.
    2706 #: includes/class-hardening-score.php:610
     2767#: includes/class-hardening-score.php:607
    27072768#, php-format
    27082769msgid "On, but a threshold of %d will never trip in practice."
    27092770msgstr ""
    27102771
     2772#: includes/class-hardening-score.php:614
     2773msgid "Brute-force protection locks out guessers"
     2774msgstr ""
     2775
    27112776#: includes/class-hardening-score.php:617
    2712 msgid "Brute-force protection locks out guessers"
     2777msgid "Password spraying only stops when the attempts stop. A threshold set so high that it never trips is a log, not a defence."
    27132778msgstr ""
    27142779
    27152780#: includes/class-hardening-score.php:620
    2716 msgid "Password spraying only stops when the attempts stop. A threshold set so high that it never trips is a log, not a defence."
    2717 msgstr ""
    2718 
    2719 #: includes/class-hardening-score.php:623
    27202781msgid "Turn on brute-force protection and set the maximum attempts to ten or fewer."
    27212782msgstr ""
    27222783
    2723 #: includes/class-hardening-score.php:627
     2784#: includes/class-hardening-score.php:624
    27242785msgid "Staging mode is on, so this copy writes the lockout down and lets the request through. The setting is right; nothing is being blocked here."
    27252786msgstr ""
    27262787
     2788#: includes/class-hardening-score.php:631
     2789msgid "The built-in theme and plugin editor is off"
     2790msgstr ""
     2791
    27272792#: includes/class-hardening-score.php:634
    2728 msgid "The built-in theme and plugin editor is off"
    2729 msgstr ""
    2730 
    2731 #: includes/class-hardening-score.php:637
    27322793msgid "DISALLOW_FILE_EDIT is in force."
    27332794msgstr ""
    27342795
    2735 #: includes/class-hardening-score.php:638
     2796#: includes/class-hardening-score.php:635
    27362797msgid "The editor is reachable — DISALLOW_FILE_EDIT is not in force on this request."
    27372798msgstr ""
    27382799
     2800#: includes/class-hardening-score.php:636
     2801msgid "The theme editor turns one hijacked administrator session into arbitrary PHP on your server, with no upload and no file access needed."
     2802msgstr ""
     2803
    27392804#: includes/class-hardening-score.php:639
    2740 msgid "The theme editor turns one hijacked administrator session into arbitrary PHP on your server, with no upload and no file access needed."
    2741 msgstr ""
    2742 
    2743 #: includes/class-hardening-score.php:642
    27442805msgid "Turn on \"Disable theme/plugin file editor\". If it is already on, something in wp-config.php defines DISALLOW_FILE_EDIT as false and wins — fix it there."
    27452806msgstr ""
    27462807
    2747 #: includes/class-hardening-score.php:652
     2808#: includes/class-hardening-score.php:649
    27482809msgid "On, but no baseline has ever been taken — there is nothing to compare against."
    27492810msgstr ""
    27502811
    27512812#. translators: %d is the number of files found that wordpress.org does not list.
    2752 #: includes/class-hardening-score.php:656
     2813#: includes/class-hardening-score.php:653
    27532814#, php-format
    27542815msgid "The last scan found %d file that is not in the official build."
    … …  
    27572818msgstr[1] ""
    27582819
    2759 #: includes/class-hardening-score.php:665
     2820#: includes/class-hardening-score.php:662
    27602821msgid "A baseline exists, but the last scan is more than a week old."
    27612822msgstr ""
    27622823
    2763 #: includes/class-hardening-score.php:667
     2824#: includes/class-hardening-score.php:664
    27642825msgid "A baseline exists and the last scan is recent."
    27652826msgstr ""
    27662827
    2767 #: includes/class-hardening-score.php:672
     2828#: includes/class-hardening-score.php:669
    27682829msgid "File integrity has a fresh baseline"
    27692830msgstr ""
    27702831
    2771 #: includes/class-hardening-score.php:679
     2832#: includes/class-hardening-score.php:676
    27722833msgid "A backdoor written into a core or plugin file looks like nothing at all from the dashboard; only a hash taken before it arrived can tell you it is there."
    27732834msgstr ""
    27742835
    2775 #: includes/class-hardening-score.php:683
     2836#: includes/class-hardening-score.php:680
    27762837msgid "Open the File integrity screen and look at what was found. A PHP file wordpress.org does not list, sitting in wp-admin or wp-includes, is not something a WordPress update leaves behind."
    27772838msgstr ""
    27782839
    2779 #: includes/class-hardening-score.php:684
     2840#: includes/class-hardening-score.php:681
    27802841msgid "Run a scan on the File integrity screen to create the baseline, and check that the daily cron is firing."
    27812842msgstr ""
    27822843
     2844#: includes/class-hardening-score.php:693
     2845msgid "No account is called \"admin\""
     2846msgstr ""
     2847
    27832848#: includes/class-hardening-score.php:696
    2784 msgid "No account is called \"admin\""
    2785 msgstr ""
    2786 
    2787 #: includes/class-hardening-score.php:699
    27882849msgid "An account with the login \"admin\" exists."
    27892850msgstr ""
    27902851
    2791 #: includes/class-hardening-score.php:700
     2852#: includes/class-hardening-score.php:697
    27922853msgid "No account uses that login."
    27932854msgstr ""
    27942855
     2856#: includes/class-hardening-score.php:698
     2857msgid "An account literally named admin hands over half of every credential pair before the guessing starts."
     2858msgstr ""
     2859
    27952860#: includes/class-hardening-score.php:701
    2796 msgid "An account literally named admin hands over half of every credential pair before the guessing starts."
    2797 msgstr ""
    2798 
    2799 #: includes/class-hardening-score.php:704
    28002861msgid "Create a new administrator with a different login, move the content to it, and delete the old one."
    28012862msgstr ""
    28022863
     2864#: includes/class-hardening-score.php:707
     2865msgid "Login names are not published"
     2866msgstr ""
     2867
     2868#: includes/class-hardening-score.php:709
     2869#: includes/class-hardening-score.php:863
     2870msgid "Blocked."
     2871msgstr ""
     2872
     2873#: includes/class-hardening-score.php:709
     2874msgid "Anyone can list your login names."
     2875msgstr ""
     2876
    28032877#: includes/class-hardening-score.php:710
    2804 msgid "Login names are not published"
    2805 msgstr ""
    2806 
    2807 #: includes/class-hardening-score.php:712
    2808 #: includes/class-hardening-score.php:885
    2809 msgid "Blocked."
    2810 msgstr ""
    2811 
    2812 #: includes/class-hardening-score.php:712
    2813 msgid "Anyone can list your login names."
     2878msgid "The ?author=1 redirect and the REST users route hand out real login names, which turns password guessing from two unknowns into one."
    28142879msgstr ""
    28152880
    28162881#: includes/class-hardening-score.php:713
    2817 msgid "The ?author=1 redirect and the REST users route hand out real login names, which turns password guessing from two unknowns into one."
    2818 msgstr ""
    2819 
    2820 #: includes/class-hardening-score.php:716
    28212882msgid "Turn on \"Block user enumeration\" under Hardening."
    28222883msgstr ""
    28232884
    2824 #: includes/class-hardening-score.php:740
    2825 msgid "The REST API answers anonymous callers on every namespace."
     2885#: includes/class-hardening-score.php:727
     2886msgid "The REST API keeps user records private"
     2887msgstr ""
     2888
     2889#: includes/class-hardening-score.php:730
     2890msgid "Visitors and customers cannot list your users or read their records through the REST API."
     2891msgstr ""
     2892
     2893#: includes/class-hardening-score.php:731
     2894msgid "Anyone can list your users through the REST API."
     2895msgstr ""
     2896
     2897#: includes/class-hardening-score.php:732
     2898msgid "The REST users route hands out every author's login slug to anyone who asks, which turns password guessing from two unknowns into one."
     2899msgstr ""
     2900
     2901#: includes/class-hardening-score.php:735
     2902msgid "Turn on \"Keep user records out of the REST API\" under API & Protocols."
     2903msgstr ""
     2904
     2905#: includes/class-hardening-score.php:741
     2906msgid "Security response headers are sent"
    28262907msgstr ""
    28272908
    28282909#: includes/class-hardening-score.php:743
    2829 msgid "Restricted, but the allowlist lets wp/v2 back in — which is the part that was being restricted."
    2830 msgstr ""
    2831 
    2832 #: includes/class-hardening-score.php:746
    2833 msgid "Anonymous REST access is limited to the allowlisted namespaces."
    2834 msgstr ""
    2835 
    2836 #: includes/class-hardening-score.php:751
    2837 msgid "The REST API is restricted to signed-in callers"
    2838 msgstr ""
    2839 
    2840 #: includes/class-hardening-score.php:754
    2841 msgid "An open REST API publishes users, posts, media and some settings to anonymous callers, and an allowlist entry that re-admits wp/v2 undoes the whole restriction while the checkbox still reads as on."
    2842 msgstr ""
    2843 
    2844 #: includes/class-hardening-score.php:757
    2845 msgid "Turn on the REST restriction and remove any allowlist line that matches wp/v2."
     2910msgid "Sent."
     2911msgstr ""
     2912
     2913#: includes/class-hardening-score.php:743
     2914msgid "Not sent."
     2915msgstr ""
     2916
     2917#: includes/class-hardening-score.php:744
     2918msgid "Without them the browser will sniff content types, render your pages inside somebody else's frame, and leak the full URL of every page as a referrer."
     2919msgstr ""
     2920
     2921#: includes/class-hardening-score.php:747
     2922msgid "Turn on \"Send security HTTP headers\" under Hardening."
     2923msgstr ""
     2924
     2925#: includes/class-hardening-score.php:752
     2926msgid "No Content-Security-Policy header is sent."
     2927msgstr ""
     2928
     2929#: includes/class-hardening-score.php:755
     2930msgid "Sent in report-only mode, which records violations and blocks nothing."
     2931msgstr ""
     2932
     2933#: includes/class-hardening-score.php:758
     2934msgid "Sent and enforcing."
    28462935msgstr ""
    28472936
    28482937#: includes/class-hardening-score.php:763
    2849 msgid "Security response headers are sent"
    2850 msgstr ""
    2851 
    2852 #: includes/class-hardening-score.php:765
    2853 msgid "Sent."
    2854 msgstr ""
    2855 
    2856 #: includes/class-hardening-score.php:765
    2857 msgid "Not sent."
     2938msgid "A Content-Security-Policy is enforced"
    28582939msgstr ""
    28592940
    28602941#: includes/class-hardening-score.php:766
    2861 msgid "Without them the browser will sniff content types, render your pages inside somebody else's frame, and leak the full URL of every page as a referrer."
     2942msgid "A policy is the last line that stops an injected script from running at all. Report-only is the correct place to start and it is worth half — it watches, and it blocks nothing."
    28622943msgstr ""
    28632944
    28642945#: includes/class-hardening-score.php:769
    2865 msgid "Turn on \"Send security HTTP headers\" under Hardening."
    2866 msgstr ""
    2867 
    2868 #: includes/class-hardening-score.php:774
    2869 msgid "No Content-Security-Policy header is sent."
     2946msgid "Run report-only until the reports are quiet, then turn report-only off so the policy actually blocks."
    28702947msgstr ""
    28712948
    28722949#: includes/class-hardening-score.php:777
    2873 msgid "Sent in report-only mode, which records violations and blocks nothing."
     2950msgid "Sensitive files are not directly readable"
    28742951msgstr ""
    28752952
    28762953#: includes/class-hardening-score.php:780
    2877 msgid "Sent and enforcing."
    2878 msgstr ""
    2879 
    2880 #: includes/class-hardening-score.php:785
    2881 msgid "A Content-Security-Policy is enforced"
    2882 msgstr ""
    2883 
    2884 #: includes/class-hardening-score.php:788
    2885 msgid "A policy is the last line that stops an injected script from running at all. Report-only is the correct place to start and it is worth half — it watches, and it blocks nothing."
    2886 msgstr ""
    2887 
    2888 #: includes/class-hardening-score.php:791
    2889 msgid "Run report-only until the reports are quiet, then turn report-only off so the policy actually blocks."
     2954#: includes/class-hardening-score.php:822
     2955msgid "This server does not read .htaccess, so GuardForge cannot answer for it here."
     2956msgstr ""
     2957
     2958#: includes/class-hardening-score.php:782
     2959msgid "The deny rules are present in .htaccess."
     2960msgstr ""
     2961
     2962#: includes/class-hardening-score.php:783
     2963msgid "The deny rules are not in .htaccess."
     2964msgstr ""
     2965
     2966#: includes/class-hardening-score.php:784
     2967msgid "A readable wp-config.php or a forgotten debug.log hands over database credentials, salts and query fragments without needing a single exploit."
     2968msgstr ""
     2969
     2970#: includes/class-hardening-score.php:787
     2971msgid "Turn on \"Protect sensitive files\" and make sure .htaccess is writable so the rules can be written."
     2972msgstr ""
     2973
     2974#: includes/class-hardening-score.php:793
     2975msgid "Administrator actions are recorded"
     2976msgstr ""
     2977
     2978#: includes/class-hardening-score.php:795
     2979msgid "Recorded."
     2980msgstr ""
     2981
     2982#: includes/class-hardening-score.php:795
     2983msgid "Not recorded."
     2984msgstr ""
     2985
     2986#: includes/class-hardening-score.php:796
     2987msgid "Without a trail you cannot say which account changed what or when, so an incident ends in guesswork instead of a timeline."
    28902988msgstr ""
    28912989
    28922990#: includes/class-hardening-score.php:799
    2893 msgid "Sensitive files are not directly readable"
    2894 msgstr ""
    2895 
    2896 #: includes/class-hardening-score.php:802
    2897 #: includes/class-hardening-score.php:844
    2898 msgid "This server does not read .htaccess, so GuardForge cannot answer for it here."
    2899 msgstr ""
    2900 
    2901 #: includes/class-hardening-score.php:804
    2902 msgid "The deny rules are present in .htaccess."
    2903 msgstr ""
    2904 
    2905 #: includes/class-hardening-score.php:805
    2906 msgid "The deny rules are not in .htaccess."
    2907 msgstr ""
    2908 
    2909 #: includes/class-hardening-score.php:806
    2910 msgid "A readable wp-config.php or a forgotten debug.log hands over database credentials, salts and query fragments without needing a single exploit."
     2991msgid "Turn on \"Log admin actions\" under Action audit."
     2992msgstr ""
     2993
     2994#: includes/class-hardening-score.php:807
     2995msgid "The WordPress version is not advertised"
    29112996msgstr ""
    29122997
    29132998#: includes/class-hardening-score.php:809
    2914 msgid "Turn on \"Protect sensitive files\" and make sure .htaccess is writable so the rules can be written."
    2915 msgstr ""
    2916 
    2917 #: includes/class-hardening-score.php:815
    2918 msgid "Administrator actions are recorded"
    2919 msgstr ""
    2920 
    2921 #: includes/class-hardening-score.php:817
    2922 msgid "Recorded."
    2923 msgstr ""
    2924 
    2925 #: includes/class-hardening-score.php:817
    2926 msgid "Not recorded."
    2927 msgstr ""
    2928 
    2929 #: includes/class-hardening-score.php:818
    2930 msgid "Without a trail you cannot say which account changed what or when, so an incident ends in guesswork instead of a timeline."
    2931 msgstr ""
    2932 
    2933 #: includes/class-hardening-score.php:821
    2934 msgid "Turn on \"Log admin actions\" under Action audit."
     2999msgid "Hidden."
     3000msgstr ""
     3001
     3002#: includes/class-hardening-score.php:809
     3003msgid "Published in the generator tag and asset URLs."
     3004msgstr ""
     3005
     3006#: includes/class-hardening-score.php:810
     3007msgid "A version in the generator tag turns a scan into a lookup: read it once, and you know which exploits are worth trying."
     3008msgstr ""
     3009
     3010#: includes/class-hardening-score.php:813
     3011msgid "Turn on \"Hide WordPress version\" under Hardening."
     3012msgstr ""
     3013
     3014#: includes/class-hardening-score.php:819
     3015msgid "Directories do not list their contents"
     3016msgstr ""
     3017
     3018#: includes/class-hardening-score.php:824
     3019msgid "Options -Indexes is in place."
     3020msgstr ""
     3021
     3022#: includes/class-hardening-score.php:825
     3023msgid "Options -Indexes is not in place."
     3024msgstr ""
     3025
     3026#: includes/class-hardening-score.php:826
     3027msgid "An open directory index lists the backups, exports and stray archives that nobody ever linked to and everybody forgets about."
    29353028msgstr ""
    29363029
    29373030#: includes/class-hardening-score.php:829
    2938 msgid "The WordPress version is not advertised"
    2939 msgstr ""
    2940 
    2941 #: includes/class-hardening-score.php:831
    2942 msgid "Hidden."
    2943 msgstr ""
    2944 
    2945 #: includes/class-hardening-score.php:831
    2946 msgid "Published in the generator tag and asset URLs."
    2947 msgstr ""
    2948 
    2949 #: includes/class-hardening-score.php:832
    2950 msgid "A version in the generator tag turns a scan into a lookup: read it once, and you know which exploits are worth trying."
     3031msgid "Turn on \"Disable directory listing\" under Files & Directories."
    29513032msgstr ""
    29523033
    29533034#: includes/class-hardening-score.php:835
    2954 msgid "Turn on \"Hide WordPress version\" under Hardening."
     3035msgid "The login form asks a question a script cannot answer"
     3036msgstr ""
     3037
     3038#: includes/class-hardening-score.php:837
     3039#: includes/class-hardening-score.php:851
     3040msgid "On."
     3041msgstr ""
     3042
     3043#: includes/class-hardening-score.php:838
     3044msgid "A trivial arithmetic challenge costs a person two seconds and stops the cheapest credential-stuffing bots outright."
    29553045msgstr ""
    29563046
    29573047#: includes/class-hardening-score.php:841
    2958 msgid "Directories do not list their contents"
    2959 msgstr ""
    2960 
    2961 #: includes/class-hardening-score.php:846
    2962 msgid "Options -Indexes is in place."
    2963 msgstr ""
    2964 
    2965 #: includes/class-hardening-score.php:847
    2966 msgid "Options -Indexes is not in place."
    2967 msgstr ""
    2968 
    2969 #: includes/class-hardening-score.php:848
    2970 msgid "An open directory index lists the backups, exports and stray archives that nobody ever linked to and everybody forgets about."
    2971 msgstr ""
    2972 
    2973 #: includes/class-hardening-score.php:851
    2974 msgid "Turn on \"Disable directory listing\" under Files & Directories."
    2975 msgstr ""
    2976 
    2977 #: includes/class-hardening-score.php:857
    2978 msgid "The login form asks a question a script cannot answer"
    2979 msgstr ""
    2980 
    2981 #: includes/class-hardening-score.php:859
     3048msgid "Turn on \"Math captcha on login\" under Hardening."
     3049msgstr ""
     3050
     3051#: includes/class-hardening-score.php:849
     3052msgid "Pingbacks are switched off"
     3053msgstr ""
     3054
     3055#: includes/class-hardening-score.php:852
     3056msgid "Pingbacks let your site be pointed at somebody else's as a reflector in a denial-of-service, and they advertise that with an X-Pingback header."
     3057msgstr ""
     3058
     3059#: includes/class-hardening-score.php:855
     3060msgid "Turn on \"Disable self-pingbacks\" under API & Protocols."
     3061msgstr ""
     3062
     3063#: includes/class-hardening-score.php:861
     3064msgid "Known scanner User-Agents are blocked"
     3065msgstr ""
     3066
     3067#: includes/class-hardening-score.php:863
     3068msgid "Not blocked."
     3069msgstr ""
     3070
     3071#: includes/class-hardening-score.php:864
     3072msgid "Blocking the default signatures of sqlmap, nikto and wpscan removes the noisy, automated half of hostile traffic before it reaches PHP at all."
     3073msgstr ""
     3074
     3075#: includes/class-hardening-score.php:867
     3076msgid "Turn on \"Block malicious bot User-Agents\" under Spam & Bots."
     3077msgstr ""
     3078
     3079#: includes/class-hardening-score.php:871
     3080msgid "Nothing is set to send an alert, so nothing will be sent."
     3081msgstr ""
     3082
    29823083#: includes/class-hardening-score.php:873
    2983 msgid "On."
    2984 msgstr ""
    2985 
    2986 #: includes/class-hardening-score.php:860
    2987 msgid "A trivial arithmetic challenge costs a person two seconds and stops the cheapest credential-stuffing bots outright."
    2988 msgstr ""
    2989 
    2990 #: includes/class-hardening-score.php:863
    2991 msgid "Turn on \"Math captcha on login\" under Hardening."
    2992 msgstr ""
    2993 
    2994 #: includes/class-hardening-score.php:871
    2995 msgid "Pingbacks are switched off"
    2996 msgstr ""
    2997 
    2998 #: includes/class-hardening-score.php:874
    2999 msgid "Pingbacks let your site be pointed at somebody else's as a reflector in a denial-of-service, and they advertise that with an X-Pingback header."
    3000 msgstr ""
    3001 
    3002 #: includes/class-hardening-score.php:877
    3003 msgid "Turn on \"Disable self-pingbacks\" under API & Protocols."
     3084msgid "Alerts are switched on, but there is no address for them to reach."
     3085msgstr ""
     3086
     3087#: includes/class-hardening-score.php:875
     3088msgid "Alerts are switched on and an address resolves."
     3089msgstr ""
     3090
     3091#: includes/class-hardening-score.php:880
     3092msgid "Someone is told when something happens"
    30043093msgstr ""
    30053094
    30063095#: includes/class-hardening-score.php:883
    3007 msgid "Known scanner User-Agents are blocked"
    3008 msgstr ""
    3009 
    3010 #: includes/class-hardening-score.php:885
    3011 msgid "Not blocked."
     3096msgid "A lockout or an integrity change that nobody is told about is a detection that arrives whenever somebody next happens to open the dashboard."
    30123097msgstr ""
    30133098
    30143099#: includes/class-hardening-score.php:886
    3015 msgid "Blocking the default signatures of sqlmap, nikto and wpscan removes the noisy, automated half of hostile traffic before it reaches PHP at all."
    3016 msgstr ""
    3017 
    3018 #: includes/class-hardening-score.php:889
    3019 msgid "Turn on \"Block malicious bot User-Agents\" under Spam & Bots."
    3020 msgstr ""
    3021 
    3022 #: includes/class-hardening-score.php:893
    3023 msgid "Nothing is set to send an alert, so nothing will be sent."
    3024 msgstr ""
    3025 
    3026 #: includes/class-hardening-score.php:895
    3027 msgid "Alerts are switched on, but there is no address for them to reach."
    3028 msgstr ""
    3029 
    3030 #: includes/class-hardening-score.php:897
    3031 msgid "Alerts are switched on and an address resolves."
    3032 msgstr ""
    3033 
    3034 #: includes/class-hardening-score.php:902
    3035 msgid "Someone is told when something happens"
    3036 msgstr ""
    3037 
    3038 #: includes/class-hardening-score.php:905
    3039 msgid "A lockout or an integrity change that nobody is told about is a detection that arrives whenever somebody next happens to open the dashboard."
    3040 msgstr ""
    3041 
    3042 #: includes/class-hardening-score.php:908
    30433100msgid "Switch on the lockout, integrity and new-administrator alerts, and set the address they should reach."
    30443101msgstr ""
    30453102
    3046 #: includes/class-hardening-score.php:912
     3103#: includes/class-hardening-score.php:890
    30473104msgid "Staging mode is on, so this copy holds every one of these e-mails back. The setting is right; nothing is being sent from here."
    30483105msgstr ""
    30493106
    3050 #: includes/class-hardening.php:88
     3107#: includes/class-hardening.php:97
    30513108msgid "XML-RPC is disabled on this site."
    30523109msgstr ""
    30533110
    3054 #: includes/class-hardening.php:114
     3111#: includes/class-hardening.php:155
     3112msgid "Invalid user ID."
     3113msgstr ""
     3114
     3115#: includes/class-hardening.php:159
     3116msgid "Sorry, you are not allowed to list users."
     3117msgstr ""
     3118
     3119#: includes/class-hardening.php:214
    30553120msgid "REST API is restricted to authenticated users."
    30563121msgstr ""
    30573122
    3058 #: includes/class-hardening.php:163
     3123#: includes/class-hardening.php:319
     3124msgid "Embeds of your posts on other sites"
     3125msgstr ""
     3126
     3127#: includes/class-hardening.php:320
     3128msgid "WooCommerce block cart and checkout (guest orders)"
     3129msgstr ""
     3130
     3131#: includes/class-hardening.php:321
     3132msgid "Contact Form 7 form submissions"
     3133msgstr ""
     3134
     3135#: includes/class-hardening.php:322
     3136msgid "Jetpack connection to WordPress.com"
     3137msgstr ""
     3138
     3139#: includes/class-hardening.php:323
     3140msgid "Form Forge form submissions"
     3141msgstr ""
     3142
     3143#: includes/class-hardening.php:324
     3144msgid "Cascade Forge webhooks from other services"
     3145msgstr ""
     3146
     3147#: includes/class-hardening.php:325
     3148msgid "Inclusive Forge scan results"
     3149msgstr ""
     3150
     3151#: includes/class-hardening.php:366
    30593152msgid "Comments via REST are disabled."
    30603153msgstr ""
    30613154
    30623155#. translators: %1$d and %2$d are random single-digit operands.
    3063 #: includes/class-hardening.php:293
     3156#: includes/class-hardening.php:519
    30643157#, php-format
    30653158msgid "Verification: %1$d + %2$d = ?"
    30663159msgstr ""
    30673160
    3068 #: includes/class-hardening.php:317
     3161#: includes/class-hardening.php:554
    30693162msgid "<strong>Error:</strong> please answer the verification question."
    30703163msgstr ""
    30713164
    3072 #: includes/class-hardening.php:328
     3165#: includes/class-hardening.php:565
    30733166msgid "<strong>Error:</strong> verification expired, please try again."
    30743167msgstr ""
    30753168
    3076 #: includes/class-hardening.php:331
     3169#: includes/class-hardening.php:568
    30773170msgid "<strong>Error:</strong> the verification answer was wrong."
    30783171msgstr ""
    … …  
    32413334
    32423335#: includes/class-two-factor.php:223
     3336#: includes/class-two-factor.php:340
    32433337msgid "<strong>Error:</strong> two-factor code is invalid."
    32443338msgstr ""
  • guardforge/tags/1.6.4/readme.txt

    r3752344 r3754541  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.6.3
     7Stable tag: 1.6.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    119119Off unless you switch it on. When you do, GuardForge issues a link on your own site that publishes a letter grade and the month it was worked out — nothing else.
    120120
    121 The grade is not your score. It is worked out only from the eleven checks a stranger can already run against your site from outside with no login: the scheme, XML-RPC, whether `?author=1` gives up a login name, whether the REST API answers anonymous callers, the version in your generator tag, your response headers, your Content-Security-Policy header, whether a directory lists its contents, whether sensitive files answer directly, the login form, and the X-Pingback header. Everything on that list is already public, so the badge tells a passer-by nothing they could not have found by loading your site.
     121The grade is not your score. It is worked out only from the eleven checks a stranger can already run against your site from outside with no login: the scheme, XML-RPC, whether `?author=1` gives up a login name, whether the REST API hands your user records to anonymous callers, the version in your generator tag, your response headers, your Content-Security-Policy header, whether a directory lists its contents, whether sensitive files answer directly, the login form, and the X-Pingback header. Everything on that list is already public, so the badge tells a passer-by nothing they could not have found by loading your site.
    122122
    123123Your numeric score, your two-factor coverage, your brute-force thresholds, your integrity results, whether an account is called admin, your pending updates and any vulnerable components are never published, in any form. The link carries an unguessable token so nobody can walk a list of sites looking for weak ones, it can be reissued or turned off at any moment, views are never logged, and until you switch it on the address is not registered at all — your site answers WordPress's own 404, exactly like a site without the plugin.
    … …  
    163163
    164164== Changelog ==
     165
     166= 1.6.4 =
     167* Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before.
     168* The REST API is no longer closed to visitors by default. Until now GuardForge refused every anonymous REST call outside a short list, which stopped the block-based WooCommerce cart and checkout, Contact Form 7, webhooks and other public REST routes for your visitors. The default protection now keeps only user records private (the REST user list and single user records, and the author name and archive link that an embed answer and the users sitemap give out), for visitors and also for customers and subscribers. Sites that already had "Restrict REST API" switched on with the list of exceptions left as it was are moved to this protection by the update. A site that had written its own list of exceptions keeps the whole REST API closed to visitors, with that list: the new separate setting is switched on for it. Either way a notice in the admin, shown once and closable, says what was chosen and where to change it. Refusing every anonymous REST call is now a separate setting, off by default for everybody else; the Settings screen says what it stops (cart, checkout, forms, webhooks) and which active plugins would be affected.
     169* The REST address is read the same way with pretty permalinks (/wp-json/) and with plain ones (?rest_route=), so an allowed route is no longer refused on a site with plain permalinks.
     170* A wrong two-factor code now counts towards the same lockout as a wrong password, so a stolen password cannot be paired with guessed codes without limit. A locked-out address is turned away at the code step too.
     171* The login lockout now holds on every login form: WooCommerce My Account and other forms that use the standard login, and on REST requests with an application password. Failed application-password attempts count as failed logins (one per request), and a locked-out address is refused even with the right password. An administrator who is signed in by cookie behind a server password prompt (htpasswd) is not mistaken for a guess: the block editor keeps working from a locked-out address.
     172* The login captcha is now checked only where it is shown. Logging in through WooCommerce My Account or other forms without the captcha field no longer fails every time.
     173* "Unblock" in the list of lockouts now lifts the block for the address; it used to leave it in place.
    165174
    166175= 1.6.3 =
    … …  
    270279== Upgrade Notice ==
    271280
     281= 1.6.4 =
     282Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before. Anonymous REST access is no longer blocked by default: only user records stay private, so the WooCommerce cart, forms and webhooks work for visitors again.
     283
    272284= 1.6.3 =
    273285Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before.
  • guardforge/trunk/admin/partials/hardening-score.php

    r3731705 r3754541  
    257257            </p>
    258258
    259             <?php if ( GUARDFORGE_Options::get( 'disable_rest_api' ) ) : ?>
     259            <?php if ( GUARDFORGE_Options::get( 'rest_lockdown' ) ) : ?>
    260260                <div class="gf-notice gf-notice-warn">
    261261                    ⚠ <?php esc_html_e( 'Your REST API is restricted to signed-in callers. GuardForge keeps this one route reachable on its own, so the badge still answers — you do not need to widen the allowlist for it.', 'guardforge' ); ?>
  • guardforge/trunk/admin/partials/settings.php

    r3752344 r3754541  
    474474                    <?php
    475475                    $guardforge_render_toggle( 'disable_xmlrpc',        __( 'Disable XML-RPC', 'guardforge' ),                  __( 'Blocks xmlrpc.php — a primary DDoS / brute-force vector.', 'guardforge' ) );
    476                     $guardforge_render_toggle( 'disable_rest_api',      __( 'Restrict REST API to logged-in users', 'guardforge' ), __( 'Anonymous REST access is limited to the namespaces in the allowlist below.', 'guardforge' ) );
     476                    $guardforge_render_toggle( 'disable_rest_api',      __( 'Keep user records out of the REST API', 'guardforge' ), __( 'Visitors and customers cannot list your users or read their records through the REST API, the usual way login names are collected. Checkout, forms and webhooks keep working.', 'guardforge' ) );
    477477                    $guardforge_render_toggle( 'disable_rest_comments', __( 'Forbid comments via REST', 'guardforge' ),         __( 'Blocks POST /wp/v2/comments.', 'guardforge' ) );
     478                    $guardforge_render_toggle( 'rest_lockdown',         __( 'Close the whole REST API to visitors who are not signed in', 'guardforge' ), __( 'Only the namespaces in the REST API allowlist stay open to them. Anything that talks to your site through the REST API without signing in stops working unless its namespace is on that list.', 'guardforge' ), 'opt' );
     479                    $guardforge_rest_casualties = GUARDFORGE_Hardening::lockdown_casualties( GUARDFORGE_Hardening::parse_lines( (string) $opts['rest_allowlist'] ) );
     480                    ?>
     481                    <div class="gf-notice gf-notice-warn">
     482                        ⚠ <?php
     483                        if ( ! empty( $opts['rest_lockdown'] ) ) {
     484                            esc_html_e( 'The REST API is closed to visitors who are not signed in.', 'guardforge' );
     485                        } else {
     486                            esc_html_e( 'Before you close the whole REST API: it breaks the WooCommerce block cart and checkout, contact forms, webhooks other services send to your site, and embeds of your posts on other sites, unless their namespaces are in the allowlist.', 'guardforge' );
     487                        }
     488                        ?>
     489                        <?php if ( $guardforge_rest_casualties ) : ?>
     490                            <br /><?php
     491                            if ( ! empty( $opts['rest_lockdown'] ) ) {
     492                                esc_html_e( 'Not working for them on this site right now:', 'guardforge' );
     493                            } else {
     494                                esc_html_e( 'On this site, these would stop working for visitors:', 'guardforge' );
     495                            }
     496                            ?>
     497                            <ul style="margin:4px 0 0 18px;list-style:disc">
     498                                <?php foreach ( $guardforge_rest_casualties as $guardforge_rest_casualty ) : ?>
     499                                    <li><?php echo esc_html( $guardforge_rest_casualty['label'] ); ?> — <?php
     500                                        echo wp_kses(
     501                                            sprintf(
     502                                                /* translators: %s: a REST namespace such as wc/store */
     503                                                esc_html__( 'add %s to the allowlist to keep it', 'guardforge' ),
     504                                                '<code>' . esc_html( $guardforge_rest_casualty['namespace'] ) . '</code>'
     505                                            ),
     506                                            [ 'code' => [] ]
     507                                        );
     508                                    ?></li>
     509                                <?php endforeach; ?>
     510                            </ul>
     511                        <?php endif; ?>
     512                    </div>
     513                    <?php
    478514                    $guardforge_render_toggle( 'disable_embed',         __( 'Disable oEmbed discovery', 'guardforge' ),         __( 'Removes /oembed information leaks.', 'guardforge' ), 'opt' );
    479515                    $guardforge_render_toggle( 'disable_pingback',      __( 'Disable self-pingbacks', 'guardforge' ),           __( 'Blocks pingbacks pointing at your own URLs.', 'guardforge' ), 'opt' );
    … …  
    490526                    $guardforge_render_toggle( 'disable_user_enumeration', __( 'Block user enumeration', 'guardforge' ),       __( 'Redirects ?author=N and hides anonymous /wp/v2/users.', 'guardforge' ) );
    491527                    $guardforge_render_toggle( 'security_headers',         __( 'Send security HTTP headers', 'guardforge' ),   __( 'Referrer-Policy, X-Content-Type-Options, X-Frame-Options, Permissions-Policy.', 'guardforge' ) );
    492                     $guardforge_render_toggle( 'login_captcha_math',       __( 'Math captcha on login', 'guardforge' ),        __( 'Adds an a + b = ? challenge to the login form.', 'guardforge' ), 'opt' );
     528                    $guardforge_render_toggle( 'login_captcha_math',       __( 'Math captcha on login', 'guardforge' ),        __( 'Adds an a + b = ? challenge to the WordPress login page. Sign-in forms of shops and membership plugins are not affected, so customers can still log in.', 'guardforge' ), 'opt' );
    493529                    ?>
    494530                </div>
    … …  
    701737                        <label><?php esc_html_e( 'REST API allowlist', 'guardforge' ); ?></label>
    702738                        <textarea name="rest_allowlist" rows="3"><?php echo esc_textarea( $opts['rest_allowlist'] ); ?></textarea>
    703                         <div class="gf-field-desc"><?php esc_html_e( 'One namespace prefix per line. Routes whose namespace starts with one of these remain accessible to anonymous callers (oembed, formforge submissions, etc.).', 'guardforge' ); ?></div>
     739                        <div class="gf-field-desc"><?php esc_html_e( 'Used only when the whole REST API is closed to visitors. One route per line; it stays open together with everything under it. The defaults keep embeds, WooCommerce checkout and the public endpoints of Avakode plugins working.', 'guardforge' ); ?></div>
    704740                    </div>
    705741                    <div class="gf-field" style="grid-column:1/-1">
  • guardforge/trunk/admin/partials/unblock.php

    r3731705 r3754541  
    1010
    1111if ( isset( $_POST['guardforge_unblock_ip'] ) && check_admin_referer( 'guardforge_unblock_ip' ) ) {
    12     $guardforge_ip = sanitize_text_field( wp_unslash( $_POST['guardforge_unblock_ip'] ) );
    13     delete_transient( GUARDFORGE_Bruteforce::attempts_key( $guardforge_ip ) );
    14     /* translators: %s is the IP address that was unblocked. */
    15     echo '<div class="gf-notice gf-notice-ok">✓ ' . sprintf( esc_html__( 'IP %s unblocked.', 'guardforge' ), '<code>' . esc_html( $guardforge_ip ) . '</code>' ) . '</div>';
     12    $guardforge_ip   = sanitize_text_field( wp_unslash( $_POST['guardforge_unblock_ip'] ) );
     13    // An address typed in the box, or the lockout key from the list below.
     14    $guardforge_lift = GUARDFORGE_Bruteforce::instance()->unblock( $guardforge_ip );
     15    if ( $guardforge_lift === 'ip' ) {
     16        /* translators: %s is the IP address that was unblocked. */
     17        echo '<div class="gf-notice gf-notice-ok">✓ ' . sprintf( esc_html__( 'IP %s unblocked.', 'guardforge' ), '<code>' . esc_html( $guardforge_ip ) . '</code>' ) . '</div>';
     18    } elseif ( $guardforge_lift === 'key' ) {
     19        echo '<div class="gf-notice gf-notice-ok">✓ ' . esc_html__( 'Lockout lifted.', 'guardforge' ) . '</div>';
     20    } else {
     21        echo '<div class="gf-notice gf-notice-warn">' . esc_html__( 'That is not an IP address, so nothing was unblocked.', 'guardforge' ) . '</div>';
     22    }
    1623}
    1724
  • guardforge/trunk/guardforge.php

    r3752344 r3754541  
    44 * Plugin URI: https://guardforge.app
    55 * Description: Hardening, brute-force protection, two-factor authentication, file-integrity monitoring, audit log and Content-Security-Policy for WordPress. The Pro add-on adds a WAF, malware scanner, CVE feed, Geo-IP and alerts.
    6  * Version: 1.6.3
     6 * Version: 1.6.4
    77 * Author: Avakode
    88 * Author URI: https://avakode.com
    … …  
    1717}
    1818
    19 define( 'GUARDFORGE_VERSION',    '1.6.3' );
    20 define( 'GUARDFORGE_DB_VERSION', '1.6.0' ); // First screen: the switch-on dates (guardforge_*_enabled_since) are stamped once on upgrade.
     19define( 'GUARDFORGE_VERSION',    '1.6.4' );
     20define( 'GUARDFORGE_DB_VERSION', '1.6.4' ); // 1.6.4: REST settings migrated (narrow protection + opt-in lockdown). 1.6.0: switch-on dates stamped once.
    2121define( 'GUARDFORGE_DIR',        plugin_dir_path( __FILE__ ) );
    2222define( 'GUARDFORGE_URL',        plugin_dir_url( __FILE__ ) );
    … …  
    287287            require_once $guardforge_feedback_file;
    288288        }
    289         // The connection of a site to an Avakode account's credits (the AJAX handlers and the return
    290         // from avakode.com). It belongs to the AI client: the wp.org package has neither, so it has
    291         // no connection either.
    292         if ( class_exists( 'GUARDFORGE_Forge_API' ) ) {
    293             $guardforge_credits = GUARDFORGE_Forge_API::credits_connect();
    294             if ( $guardforge_credits ) {
    295                 $guardforge_credits->register();
    296             }
    297         }
     289        // The connection of a site to an Avakode account's credits is built on init, not here: building
     290        // it translates its sentences, and asking for the 'guardforge' text domain before init makes
     291        // WordPress 6.7+ log "_load_textdomain_just_in_time was called incorrectly" on every admin
     292        // request. Priority 1 is still ahead of admin-ajax.php and of the return from avakode.com.
     293        add_action( 'init', 'guardforge_register_credits_connect', 1 );
    298294    }
    299295}
    300296add_action( 'plugins_loaded', 'guardforge_init', 5 );
     297
     298/**
     299 * Registers the connection of a site to an Avakode account's credits (the AJAX handlers and the
     300 * return from avakode.com). It belongs to the AI client: the wp.org package has neither, so it has
     301 * no connection either.
     302 *
     303 * @return void
     304 */
     305function guardforge_register_credits_connect() {
     306    if ( ! class_exists( 'GUARDFORGE_Forge_API' ) ) {
     307        return;
     308    }
     309    $guardforge_credits = GUARDFORGE_Forge_API::credits_connect();
     310    if ( $guardforge_credits ) {
     311        $guardforge_credits->register();
     312    }
     313}
    301314
    302315register_activation_hook( __FILE__, function () {
  • guardforge/trunk/includes/class-bruteforce.php

    r3736618 r3754541  
    2424    }
    2525
     26    /** Whether this request's wrong application password has been counted (see on_app_password_failed). */
     27    private $app_password_failure_counted = false;
     28
    2629    private function __construct() {
    2730        add_action( 'login_init',       [ $this, 'maybe_block_login' ], 1 );
    28         add_action( 'wp_login_failed',  [ $this, 'on_login_failed' ] );
     31        // login_init is fired by wp-login.php only. A login made anywhere else
     32        // (the shop's My Account form, a membership form, xmlrpc) goes through
     33        // authenticate, so the lockout is asked there too — last, after every
     34        // other handler: core's username/password handler (priority 20) finds
     35        // the user and checks the password itself and ignores the WP_Error it
     36        // is handed, so a refusal placed ahead of it never held against the
     37        // correct password.
     38        add_filter( 'authenticate',     [ $this, 'refuse_locked_login' ], PHP_INT_MAX, 3 );
     39        // The failure hook passes the error so a refusal is not counted again.
     40        add_action( 'wp_login_failed',  [ $this, 'on_login_failed' ], 10, 2 );
     41        // Application passwords (REST Basic auth) fail through their own hook.
     42        add_action( 'application_password_failed_authentication', [ $this, 'on_app_password_failed' ] );
     43        add_filter( 'rest_authentication_errors', [ $this, 'refuse_locked_basic_auth' ], 5 );
    2944        add_action( 'wp_login',         [ $this, 'on_login_success' ], 10, 2 );
    3045        add_action( 'guardforge_log_gc_cron', [ $this, 'gc_old_logs' ] );
    … …  
    6479    }
    6580
    66     public function on_login_failed( $username ) {
     81    /**
     82 * Whether the caller's address is out of tries right now, by the same
     83 * rules maybe_block_login applies: protection on, address not listed,
     84 * threshold reached, and the site not a staging copy.
     85 */
     86    private function is_locked_out() {
     87        if ( ! GUARDFORGE_Options::get( 'brute_force_protection' ) ) {
     88            return false;
     89        }
     90        $ip = GUARDFORGE_Ip::client_ip();
     91        if ( $this->is_whitelisted( $ip ) ) {
     92            return false;
     93        }
     94        if ( $this->get_attempts( $ip ) < (int) GUARDFORGE_Options::get( 'bf_max_attempts' ) ) {
     95            return false;
     96        }
     97        return ! GUARDFORGE_Staging::is_active();
     98    }
     99
     100    private function locked_error() {
     101        $minutes = (int) GUARDFORGE_Options::get( 'bf_lockout_minutes' );
     102        return new WP_Error(
     103            'guardforge_locked',
     104            sprintf(
     105                /* translators: %d is the lockout window in minutes. */
     106                esc_html__( 'Too many failed attempts. Try again in %d minutes.', 'guardforge' ),
     107                $minutes
     108            ),
     109            [ 'status' => 429 ]
     110        );
     111    }
     112
     113    /**
     114 * authenticate, last in line: refuse a login from an address that is out
     115 * of tries, whatever the handlers before it decided — a WP_User from the
     116 * right password included. A call with no credentials (a logout, a cookie
     117 * check) is not a login and is left alone.
     118 */
     119    public function refuse_locked_login( $user, $username = '', $password = '' ) {
     120        if ( (string) $username === '' && (string) $password === '' ) {
     121            return $user;
     122        }
     123        return $this->is_locked_out() ? $this->locked_error() : $user;
     124    }
     125
     126    /**
     127 * rest_authentication_errors, early: a request that really tries to log in
     128 * with Basic credentials (an application password) from a locked address
     129 * gets the refusal even if the password was right, so guessing yields
     130 * nothing. A request without them is a visitor reading the public API, and
     131 * keeps reading it.
     132 *
     133 * "Really tries" is decided the way core decides it: both halves of the
     134 * header must have come (PHP_AUTH_USER and PHP_AUTH_PW), and a user found
     135 * by the login cookie comes first, because core tries the application
     136 * password only when no cookie user was found. A web server that protects
     137 * the admin with htpasswd leaves the same two variables behind on every
     138 * request, and an administrator behind it with a valid cookie is not
     139 * guessing anything: refusing that request would take the block editor's
     140 * REST calls away from an editor on a locked address.
     141 */
     142    public function refuse_locked_basic_auth( $result ) {
     143        if ( ! empty( $result ) ) {
     144            return $result;
     145        }
     146        if ( empty( $_SERVER['PHP_AUTH_USER'] ) || ! isset( $_SERVER['PHP_AUTH_PW'] ) ) {
     147            return $result;
     148        }
     149        if ( $this->cookie_user_id() > 0 ) {
     150            return $result;
     151        }
     152        return $this->is_locked_out() ? $this->locked_error() : $result;
     153    }
     154
     155    /**
     156 * The user the login cookie names, 0 when there is none: the answer core's
     157 * determine_current_user gives at priority 10 and 20 before it looks at an
     158 * application password (the auth cookie, then the logged-in cookie that
     159 * front-end and REST requests carry). It reads the cookies only and sets
     160 * no current user, so it cannot start the application-password check
     161 * itself.
     162 */
     163    private function cookie_user_id() {
     164        if ( function_exists( 'wp_validate_auth_cookie' ) ) {
     165            $id = wp_validate_auth_cookie( '' );
     166            if ( $id ) {
     167                return (int) $id;
     168            }
     169            if ( function_exists( 'wp_validate_logged_in_cookie' ) ) {
     170                return (int) wp_validate_logged_in_cookie( false );
     171            }
     172        }
     173        return 0;
     174    }
     175
     176    /**
     177 * A wrong application password over REST: a failed login like any other.
     178 * XML-RPC is left to wp_login_failed, which the same attempt also fires.
     179 *
     180 * One request carries one Basic header, so it is one guess however often
     181 * core works the current user out again (a plugin that resets it makes
     182 * core check the same password a second time and fire this again).
     183 */
     184    public function on_app_password_failed( $error = null ) {
     185        if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
     186            return;
     187        }
     188        if ( $this->app_password_failure_counted ) {
     189            return;
     190        }
     191        $this->app_password_failure_counted = true;
     192        $username = isset( $_SERVER['PHP_AUTH_USER'] ) ? sanitize_text_field( wp_unslash( $_SERVER['PHP_AUTH_USER'] ) ) : '';
     193        $this->on_login_failed( $username );
     194    }
     195
     196    public function on_login_failed( $username, $error = null ) {
     197        // Our own refusal is not a new guess; counting it would push the end of
     198        // the lockout out on every retry.
     199        if ( $error instanceof WP_Error && $error->get_error_code() === 'guardforge_locked' ) {
     200            return;
     201        }
    67202        if ( ! GUARDFORGE_Options::get( 'brute_force_protection' ) ) {
    68203            return;
    … …  
    148283    }
    149284
     285    /**
     286 * Lift a lockout, by address or by the key the "Active lockouts" list
     287 * shows. That list cannot show the address — it is hashed into the key —
     288 * so its Unblock button posts the key, and treating that as an address
     289 * hashed it a second time and cleared a counter that was never there.
     290 *
     291 * A key is accepted only in the exact shape this class writes
     292 * (prefix + md5), so a posted value can never name another transient.
     293 *
     294 * @return string 'key', 'ip', or '' when the value is neither (nothing is deleted).
     295 */
     296    public function unblock( $subject ) {
     297        $subject = trim( (string) $subject );
     298        if ( preg_match( '/^' . preg_quote( self::ATTEMPTS_TRANSIENT_PREFIX, '/' ) . '[0-9a-f]{32}$/', $subject ) ) {
     299            delete_transient( $subject );
     300            return 'key';
     301        }
     302        if ( filter_var( $subject, FILTER_VALIDATE_IP ) ) {
     303            $this->clear_attempts( $subject );
     304            return 'ip';
     305        }
     306        return '';
     307    }
     308
    150309    public static function attempts_key( $ip ) {
    151310        return self::ATTEMPTS_TRANSIENT_PREFIX . md5( (string) $ip );
  • guardforge/trunk/includes/class-core.php

    r3735184 r3754541  
    2424        add_filter( 'admin_body_class', [ $this, 'add_body_class' ] );
    2525        add_action( 'admin_notices', [ $this, 'pro_addon_outdated_notice' ] );
     26        add_action( 'admin_notices', [ $this, 'rest_migration_notice' ] );
     27        add_action( 'admin_post_guardforge_rest_notice_dismiss', [ $this, 'handle_rest_notice_dismiss' ] );
    2628        add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
    2729    }
    … …  
    7476        echo ' <a href="https://avakode.com/dashboard/downloads/" target="_blank" rel="noopener">' . esc_html( __( 'Open Downloads', 'guardforge' ) ) . '</a>';
    7577        echo '</p></div>';
     78    }
     79
     80    /**
     81 * Once, after the 1.6.4 update: what happened to the REST API protection.
     82 *
     83 * The update split "Restrict REST API" in two (see
     84 * GUARDFORGE_Options::migrate_rest_settings) and picked one for the
     85 * site, so the site owner is told which and where to change it. The
     86 * sentences carry no placeholders: the machine translator drops them.
     87 */
     88    public function rest_migration_notice() {
     89        if ( ! self::notice_screen_allows() ) {
     90            return;
     91        }
     92        $mode = GUARDFORGE_Options::rest_migration_notice();
     93        if ( $mode === null ) {
     94            return;
     95        }
     96        $settings = admin_url( 'admin.php?page=guardforge#gf-card-api' );
     97        $dismiss  = wp_nonce_url( admin_url( 'admin-post.php?action=guardforge_rest_notice_dismiss' ), 'guardforge_rest_notice_dismiss' );
     98
     99        echo '<div class="notice notice-warning"><p><strong>';
     100        if ( $mode === 'lockdown' ) {
     101            echo esc_html__( 'GuardForge still closes the REST API to visitors who are not signed in, as you had set it.', 'guardforge' );
     102            echo '</strong></p><p>';
     103            echo esc_html__( 'Version 1.6.4 split the REST API protection in two. Because you had written your own list of exceptions, the switch that closes the whole REST API is now on, with your list. To keep only user records private instead, turn that switch off in Settings, under API & Protocols.', 'guardforge' );
     104        } else {
     105            echo esc_html__( 'GuardForge now keeps only user records private in the REST API.', 'guardforge' );
     106            echo '</strong></p><p>';
     107            echo esc_html__( 'Version 1.6.4 split the REST API protection in two. The protection you had used the default list, which also shut out the WooCommerce cart and checkout, contact forms and webhooks, so it now closes user records to visitors and nothing else. To close the whole REST API to visitors who are not signed in, turn that switch on in Settings, under API & Protocols.', 'guardforge' );
     108        }
     109        echo '</p><p><a class="button button-primary" href="' . esc_url( $settings ) . '">' . esc_html__( 'Open Settings', 'guardforge' ) . '</a> ';
     110        echo '<a class="button" href="' . esc_url( $dismiss ) . '">' . esc_html__( 'Dismiss', 'guardforge' ) . '</a></p></div>';
     111    }
     112
     113    public function handle_rest_notice_dismiss() {
     114        if ( ! current_user_can( 'manage_options' ) ) {
     115            wp_die( esc_html__( 'Access denied.', 'guardforge' ) );
     116        }
     117        check_admin_referer( 'guardforge_rest_notice_dismiss' );
     118        GUARDFORGE_Options::dismiss_rest_migration_notice();
     119        $back = wp_get_referer();
     120        wp_safe_redirect( $back ? $back : admin_url() );
     121        exit;
    76122    }
    77123
  • guardforge/trunk/includes/class-hardening-score.php

    r3735184 r3754541  
    6666        'notify_on_lockout',
    6767        'protect_sensitive_files',
    68         'rest_allowlist',
    6968        'security_headers',
    7069        'staging_force_production',
    … …  
    182181            'user_enumeration_blocked'   => false,
    183182            'rest_restricted'            => false,
    184             'rest_allowlist'             => [],
    185183            'security_headers'           => false,
    186184            'csp_enabled'                => false,
    … …  
    290288        $facts['user_enumeration_blocked'] = ! empty( $opts['disable_user_enumeration'] );
    291289        $facts['rest_restricted']          = ! empty( $opts['disable_rest_api'] );
    292         $facts['rest_allowlist']           = GUARDFORGE_Hardening::parse_lines( (string) ( $opts['rest_allowlist'] ?? '' ) );
    293290        $facts['security_headers']         = ! empty( $opts['security_headers'] );
    294291        $facts['csp_enabled']              = ! empty( $opts['csp_enabled'] );
    … …  
    718715
    719716        /*
    720  * The allowlist is matched by GUARDFORGE_Hardening as
    721  * strpos( $route, $needle ) === 0 — a prefix of the requested route.
    722  * So core comes back in two ways, and both have to count: an entry
    723  * short enough to be a prefix of "wp/v2" ("wp", or the whole thing),
    724  * and an entry that starts with "wp/v2" and re-admits one branch of
    725  * it ("wp/v2/users" is narrower and is still the login names).
    726  */
    727         $readmits_core = false;
    728         foreach ( (array) $f['rest_allowlist'] as $needle ) {
    729             $needle = trim( (string) $needle );
    730             if ( $needle === '' ) {
    731                 continue;
    732             }
    733             if ( strpos( 'wp/v2', $needle ) === 0 || strpos( $needle, 'wp/v2' ) === 0 ) {
    734                 $readmits_core = true;
    735                 break;
    736             }
    737         }
    738         if ( ! $f['rest_restricted'] ) {
    739             $rest_earned  = 0;
    740             $rest_message = __( 'The REST API answers anonymous callers on every namespace.', 'guardforge' );
    741         } elseif ( $readmits_core ) {
    742             $rest_earned  = 0;
    743             $rest_message = __( 'Restricted, but the allowlist lets wp/v2 back in — which is the part that was being restricted.', 'guardforge' );
    744         } else {
    745             $rest_earned  = 1;
    746             $rest_message = __( 'Anonymous REST access is limited to the allowlisted namespaces.', 'guardforge' );
    747         }
     717 * The REST protection that ships on (GUARD-REST-01, 1.6.4): user
     718 * records closed to anyone who is not staff. The full lockdown is not
     719 * scored — it breaks checkout, forms and webhooks, and a score that
     720 * asked for it would push owners into breaking their own site. The
     721 * allowlist belongs to the lockdown and cannot re-open user records,
     722 * so it no longer bears on this row.
     723 */
    748724        $items[] = self::item(
    749725            'rest_restricted',
    750726            self::WEIGHT_MEDIUM,
    751             __( 'The REST API is restricted to signed-in callers', 'guardforge' ),
    752             $rest_earned,
    753             $rest_message,
    754             __( 'An open REST API publishes users, posts, media and some settings to anonymous callers, and an allowlist entry that re-admits wp/v2 undoes the whole restriction while the checkbox still reads as on.', 'guardforge' ),
     727            __( 'The REST API keeps user records private', 'guardforge' ),
     728            $f['rest_restricted'] ? 1 : 0,
     729            $f['rest_restricted']
     730                ? __( 'Visitors and customers cannot list your users or read their records through the REST API.', 'guardforge' )
     731                : __( 'Anyone can list your users through the REST API.', 'guardforge' ),
     732            __( 'The REST users route hands out every author\'s login slug to anyone who asks, which turns password guessing from two unknowns into one.', 'guardforge' ),
    755733            true,
    756734            self::settings_anchor( 'api' ),
    757             __( 'Turn on the REST restriction and remove any allowlist line that matches wp/v2.', 'guardforge' )
     735            __( 'Turn on "Keep user records out of the REST API" under API & Protocols.', 'guardforge' )
    758736        );
    759737
  • guardforge/trunk/includes/class-hardening.php

    r3712655 r3754541  
    3535        add_action( 'init', [ $this, 'block_xmlrpc_php' ], 1 );
    3636
    37         // REST API gating
     37        // REST API. The narrow protection (on by default) judges the request
     38        // WordPress is about to answer, whatever address reached it — served,
     39        // embedded (_embed) or internal. The full lockdown (opt-in) judges
     40        // only requests served over HTTP, so a page that renders REST data on
     41        // the server for a visitor keeps rendering.
     42        add_filter( 'rest_request_before_callbacks', [ $this, 'guard_user_records' ], 10, 3 );
    3843        add_filter( 'rest_authentication_errors', [ $this, 'filter_rest_authentication' ], 99 );
    3944
    … …  
    5661        add_filter( 'rest_endpoints',  [ $this, 'maybe_remove_users_endpoint' ] );
    5762        add_filter( 'rest_user_query', [ $this, 'filter_rest_user_query' ] );
     63        // The other two places core publishes login slugs: the author link in
     64        // an oEmbed answer and the users sitemap (Wordfence closes the same).
     65        add_filter( 'oembed_response_data',    [ $this, 'filter_oembed_author' ], 99 );
     66        add_filter( 'wp_sitemaps_add_provider', [ $this, 'filter_sitemap_provider' ], 99, 2 );
    5867
    5968        // oEmbed
    … …  
    93102
    94103    /**
    95  * Return WP_Error to block REST unless either:
    96  * - the user is logged in, or
    97  * - the requested route matches an allowlisted namespace.
    98  *
    99  * The allowlist prevents the original Lyuhon behaviour from breaking
    100  * block-editor previews, oEmbed, FormForge submissions, etc.
     104 * Narrow protection ('disable_rest_api', on by default): user records.
     105 *
     106 * The REST users route is how login names are harvested — the list, its
     107 * search, and a record by ID all carry the slug, which is usually the
     108 * login. Anyone who cannot write posts is refused it: visitors, and also
     109 * subscribers and customers, because on a store anyone can register and
     110 * "signed in" is no barrier. Staff keep it (the block editor lists
     111 * authors over REST), as does everyone for their own record and for
     112 * users/me, which core already limits to the caller.
     113 *
     114 * Hooked on rest_request_before_callbacks, so the decision is made on the
     115 * handler WordPress picked — not on the address the caller typed. That
     116 * covers /wp-json/, ?rest_route=, any spelling core's case-insensitive
     117 * matching accepts, and the internal request behind _embed=author.
     118 *
     119 * Nothing else is closed by default: the Store API, form submissions,
     120 * webhooks and published content are public by design.
     121 *
     122 * @param mixed $response Null, or an earlier refusal.
     123 * @param array $handler The matched handler.
     124 * @param WP_REST_Request $request
     125 * @return mixed
     126 */
     127    public function guard_user_records( $response, $handler, $request ) {
     128        if ( ! GUARDFORGE_Options::get( 'disable_rest_api' ) ) {
     129            return $response;
     130        }
     131        if ( $response instanceof WP_Error ) {
     132            return $response;
     133        }
     134        if ( ! is_object( $request ) || ! method_exists( $request, 'get_route' ) ) {
     135            return $response;
     136        }
     137        $kind = self::user_record_read( $handler, $request );
     138        if ( $kind === '' ) {
     139            return $response;
     140        }
     141        if ( current_user_can( 'edit_posts' ) ) {
     142            return $response;
     143        }
     144        if ( $kind === 'item' ) {
     145            $own = (int) get_current_user_id();
     146            $id  = (int) $request->get_param( 'id' );
     147            if ( $id === 0 && preg_match( '#/users/+(\d+)/*$#i', (string) $request->get_route(), $m ) ) {
     148                $id = (int) $m[1];
     149            }
     150            if ( $own > 0 && $id === $own ) {
     151                return $response;
     152            }
     153            // Core's own answer for an ID that is not there, so the refusal
     154            // says nothing about whether the account exists.
     155            return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.', 'guardforge' ), [ 'status' => 404 ] );
     156        }
     157        return new WP_Error(
     158            'rest_user_cannot_view',
     159            __( 'Sorry, you are not allowed to list users.', 'guardforge' ),
     160            [ 'status' => rest_authorization_required_code() ]
     161        );
     162    }
     163
     164    /**
     165 * 'list', 'item' or '' — whether this request reads user records.
     166 */
     167    private static function user_record_read( $handler, $request ) {
     168        $method = method_exists( $request, 'get_method' ) ? strtoupper( (string) $request->get_method() ) : 'GET';
     169        if ( $method !== 'GET' && $method !== 'HEAD' ) {
     170            return '';
     171        }
     172        $callback = is_array( $handler ) && isset( $handler['callback'] ) ? $handler['callback'] : null;
     173        if ( is_array( $callback ) && isset( $callback[0], $callback[1] ) && is_object( $callback[0] )
     174            && class_exists( 'WP_REST_Users_Controller' ) && $callback[0] instanceof WP_REST_Users_Controller ) {
     175            $name = strtolower( (string) $callback[1] );
     176            if ( $name === 'get_items' ) {
     177                return 'list';
     178            }
     179            return $name === 'get_item' ? 'item' : '';
     180        }
     181        $route = (string) $request->get_route();
     182        if ( preg_match( '#^/*wp/+v2/+users/*$#i', $route ) ) {
     183            return 'list';
     184        }
     185        if ( preg_match( '#^/*wp/+v2/+users/+\d+/*$#i', $route ) ) {
     186            return 'item';
     187        }
     188        return '';
     189    }
     190
     191    /**
     192 * Full lockdown ('rest_lockdown', off by default): every anonymous REST
     193 * call is refused unless its route is on the allowlist.
     194 *
     195 * The owner switches this on knowing it breaks whatever talks to the site
     196 * without signing in; the settings screen lists what that is on this site
     197 * (lockdown_casualties). The route judged is the one WordPress is
     198 * serving — its parsed rest_route query var, which /wp-json/<route> and
     199 * ?rest_route=<route> both fill — so plain permalinks behave exactly like
     200 * pretty ones.
    101201 */
    102202    public function filter_rest_authentication( $result ) {
    103         if ( ! GUARDFORGE_Options::get( 'disable_rest_api' ) ) {
     203        if ( ! GUARDFORGE_Options::get( 'rest_lockdown' ) ) {
    104204            return $result;
    105205        }
    … …  
    118218
    119219    private function current_rest_route_is_allowlisted() {
    120         $route = '';
    121         if ( function_exists( 'rest_get_url_prefix' ) ) {
    122             $prefix = rest_get_url_prefix();
    123             // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only searched for the REST prefix and compared with the allowlist, never stored or printed; sanitising would change the route being judged.
    124             $path   = wp_unslash( $_SERVER['REQUEST_URI'] ?? '' );
    125             $needle = '/' . trim( $prefix, '/' ) . '/';
    126             $pos    = strpos( $path, $needle );
    127             if ( $pos !== false ) {
    128                 $route = ltrim( substr( $path, $pos + strlen( $needle ) ), '/' );
    129                 $qpos  = strpos( $route, '?' );
    130                 if ( $qpos !== false ) {
    131                     $route = substr( $route, 0, $qpos );
    132                 }
    133             }
    134         }
     220        $route = self::current_rest_route();
    135221        if ( $route === '' ) {
    136222            return false;
    … …  
    146232        $allowlist = apply_filters( 'guardforge/rest_allowlist', $allowlist, $route );
    147233
    148         foreach ( $allowlist as $needle ) {
    149             if ( $needle === '' ) {
     234        return self::route_is_allowlisted( $route, (array) $allowlist );
     235    }
     236
     237    /**
     238 * The REST route of the current request, normalised (see normalise_route).
     239 */
     240    private static function current_rest_route() {
     241        global $wp;
     242        if ( isset( $wp ) && is_object( $wp ) && isset( $wp->query_vars['rest_route'] ) && is_string( $wp->query_vars['rest_route'] ) ) {
     243            return self::normalise_route( $wp->query_vars['rest_route'] );
     244        }
     245        // Before WordPress has parsed the request: read it the way
     246        // WP::parse_request will — the query var first, then the path.
     247        // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- an anonymous REST request names its route here; it is only compared with the allowlist, never stored or printed.
     248        if ( isset( $_GET['rest_route'] ) && is_string( $_GET['rest_route'] ) ) {
     249            // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- same read-only comparison.
     250            return self::normalise_route( wp_unslash( $_GET['rest_route'] ) );
     251        }
     252        if ( ! function_exists( 'rest_get_url_prefix' ) ) {
     253            return '';
     254        }
     255        // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- only searched for the REST prefix and compared with the allowlist, never stored or printed; sanitising would change the route being judged.
     256        $path = (string) wp_unslash( $_SERVER['REQUEST_URI'] ?? '' );
     257        $qpos = strpos( $path, '?' );
     258        if ( $qpos !== false ) {
     259            $path = substr( $path, 0, $qpos );
     260        }
     261        $needle = '/' . trim( rest_get_url_prefix(), '/' ) . '/';
     262        $pos    = strpos( $path, $needle );
     263        if ( $pos === false ) {
     264            return '';
     265        }
     266        return self::normalise_route( substr( $path, $pos + strlen( $needle ) ) );
     267    }
     268
     269    /**
     270 * Lower case, single slashes, no slash at either end: "wc/store/v1/cart".
     271 * Core matches routes case-insensitively, so the allowlist does too.
     272 */
     273    public static function normalise_route( $route ) {
     274        $route = strtolower( (string) $route );
     275        $route = (string) preg_replace( '#/+#', '/', $route );
     276        return trim( $route, '/' );
     277    }
     278
     279    /**
     280 * Whether a route falls under one of the allowlist lines. A line covers
     281 * the route it names and everything below it, on whole segments:
     282 * "formforge/v1" covers "formforge/v1/forms/3/submit" but not
     283 * "formforge/v10", and "flowforge/v1/webhook" does not open the canvas.
     284 *
     285 * @param string $route
     286 * @param string $allowlist
     287 */
     288    public static function route_is_allowlisted( $route, array $allowlist ) {
     289        $route = self::normalise_route( $route );
     290        if ( $route === '' ) {
     291            return false;
     292        }
     293        foreach ( $allowlist as $line ) {
     294            $line = self::normalise_route( $line );
     295            if ( $line === '' ) {
    150296                continue;
    151297            }
    152             if ( strpos( $route, $needle ) === 0 ) {
     298            if ( $route === $line || strpos( $route, $line . '/' ) === 0 ) {
    153299                return true;
    154300            }
     301        }
     302        return false;
     303    }
     304
     305    /**
     306 * What the full lockdown stops for visitors on this site: the public
     307 * REST endpoints of active plugins (and core's oEmbed) that the given
     308 * allowlist does not cover. For the settings screen.
     309 *
     310 * @param string $allowlist
     311 * @param callable|null $is_active fn( string $slug ): bool — for tests.
     312 * @return array<int,array{label:string,namespace:string}>
     313 */
     314    public static function lockdown_casualties( array $allowlist, $is_active = null ) {
     315        if ( ! is_callable( $is_active ) ) {
     316            $is_active = [ __CLASS__, 'plugin_is_active' ];
     317        }
     318        $known = [
     319            [ 'slug' => 'core-oembed',    'namespace' => 'oembed/1.0',                       'label' => __( 'Embeds of your posts on other sites', 'guardforge' ) ],
     320            [ 'slug' => 'woocommerce',    'namespace' => 'wc/store',                         'label' => __( 'WooCommerce block cart and checkout (guest orders)', 'guardforge' ) ],
     321            [ 'slug' => 'contact-form-7', 'namespace' => 'contact-form-7/v1',                'label' => __( 'Contact Form 7 form submissions', 'guardforge' ) ],
     322            [ 'slug' => 'jetpack',        'namespace' => 'jetpack/v4',                       'label' => __( 'Jetpack connection to WordPress.com', 'guardforge' ) ],
     323            [ 'slug' => 'formforge',      'namespace' => 'formforge/v1',                     'label' => __( 'Form Forge form submissions', 'guardforge' ) ],
     324            [ 'slug' => 'flowforge',      'namespace' => 'flowforge/v1/webhook',             'label' => __( 'Cascade Forge webhooks from other services', 'guardforge' ) ],
     325            [ 'slug' => 'inclusiveforge', 'namespace' => 'inclusiveforge/v1/scan-completed', 'label' => __( 'Inclusive Forge scan results', 'guardforge' ) ],
     326        ];
     327        $out = [];
     328        foreach ( $known as $row ) {
     329            if ( $row['slug'] !== 'core-oembed' && ! call_user_func( $is_active, $row['slug'] ) ) {
     330                continue;
     331            }
     332            if ( self::route_is_allowlisted( $row['namespace'], $allowlist ) ) {
     333                continue;
     334            }
     335            $out[] = [ 'label' => $row['label'], 'namespace' => $row['namespace'] ];
     336        }
     337        return $out;
     338    }
     339
     340    /**
     341 * Whether a plugin with a public REST endpoint is running, by the class
     342 * or constant it defines once loaded.
     343 */
     344    public static function plugin_is_active( $slug ) {
     345        switch ( $slug ) {
     346            case 'woocommerce':
     347                return class_exists( 'WooCommerce' );
     348            case 'contact-form-7':
     349                return defined( 'WPCF7_VERSION' );
     350            case 'jetpack':
     351                return defined( 'JETPACK__VERSION' );
     352            case 'formforge':
     353                return defined( 'FORMFORGE_VERSION' );
     354            case 'flowforge':
     355                return defined( 'FLOWFORGE_VERSION' );
     356            case 'inclusiveforge':
     357                return defined( 'INCLUSIVEFORGE_VERSION' );
    155358        }
    156359        return false;
    … …  
    221424        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    222425        return $endpoints;
     426    }
     427
     428    /**
     429 * An oEmbed answer names the author and links their archive, whose slug
     430 * is usually the login.
     431 */
     432    public function filter_oembed_author( $data ) {
     433        if ( ! GUARDFORGE_Options::get( 'disable_user_enumeration' ) || ! is_array( $data ) ) {
     434            return $data;
     435        }
     436        unset( $data['author_name'], $data['author_url'] );
     437        return $data;
     438    }
     439
     440    /**
     441 * The users sitemap (wp-sitemap-users-1.xml) is a list of every author
     442 * archive — every author's slug in one file.
     443 */
     444    public function filter_sitemap_provider( $provider, $name ) {
     445        if ( $name === 'users' && GUARDFORGE_Options::get( 'disable_user_enumeration' ) ) {
     446            return false;
     447        }
     448        return $provider;
    223449    }
    224450
    … …  
    307533            return $user;
    308534        }
     535        // The field is drawn on the login_form action, which only wp-login.php
     536        // fires, so that is where it is checked — plus any form that posted the
     537        // field back because it drew it too. Every other sign-in (the shop's
     538        // My Account form, a membership plugin's form, an application password
     539        // over REST, wp_signon called by another plugin) never showed the
     540        // field and used to fail every time.
     541        // phpcs:ignore WordPress.Security.NonceVerification.Missing -- only asks whether the field was posted; nothing is read or stored.
     542        $field_posted = isset( $_POST['guardforge_captcha_key'] ) || isset( $_POST['guardforge_captcha_answer'] );
     543        if ( ! did_action( 'login_init' ) && ! $field_posted ) {
     544            return $user;
     545        }
    309546        // wp-login.php posts no nonce, and cannot: this runs before anyone is
    310547        // logged in. The key names a ten-minute transient the same form
  • guardforge/trunk/includes/class-options.php

    r3735184 r3754541  
    1919
    2020    /**
     21 * The allowlist every site got before 1.6.4. A stored copy of exactly
     22 * this is a default nobody chose, so the upgrade replaces it with the
     23 * current one (migrate_rest_settings); an edited list is left alone.
     24 */
     25    /** The one-time record of what the 1.6.4 REST migration chose (see migrate_rest_settings). */
     26    const REST_MIGRATION_OPTION = 'guardforge_rest_migration';
     27
     28    const LEGACY_REST_ALLOWLIST = "oembed/1.0\nformforge/v1\nguardforge/v1";
     29
     30    /**
    2131 * Schema. Each entry: ['type' => bool|int|string|email|textarea|csv, 'default' => mixed].
    2232 * Used by `set` to sanitise, and by tests to enumerate.
    … …  
    2636            // API & Protocols
    2737            'disable_xmlrpc'             => [ 'type' => 'bool',     'default' => 1 ],
     38            // Until 1.6.4 'disable_rest_api' refused every anonymous REST call
     39            // outside the allowlist, on by default — and took the WooCommerce
     40            // Store API (block cart and checkout), contact forms and inbound
     41            // webhooks with it. The key keeps its name and its stored "on"; it
     42            // now means the narrow protection (user records closed to anyone
     43            // who is not staff, see GUARDFORGE_Hardening::guard_user_records).
     44            // Closing the whole REST API to visitors is 'rest_lockdown', off
     45            // until the owner asks for it, and only that switch reads the
     46            // allowlist. The allowlist's default carries the public endpoints
     47            // of our own plugins and the Store API: they hold nothing private,
     48            // and closing them only breaks the site.
    2849            'disable_rest_api'           => [ 'type' => 'bool',     'default' => 1 ],
    29             'rest_allowlist'             => [ 'type' => 'textarea', 'default' => "oembed/1.0\nformforge/v1\nguardforge/v1" ],
     50            'rest_lockdown'              => [ 'type' => 'bool',     'default' => 0 ],
     51            'rest_allowlist'             => [ 'type' => 'textarea', 'default' => "oembed/1.0\nguardforge/v1\nformforge/v1\nflowforge/v1/webhook\ninclusiveforge/v1/scan-completed\nwc/store" ],
    3052            'disable_rest_comments'      => [ 'type' => 'bool',     'default' => 1 ],
    3153            'disable_embed'              => [ 'type' => 'bool',     'default' => 0 ],
    … …  
    301323            // from here read as "every secondary screen was switched off".
    302324            'main'     => [
    303                 'disable_xmlrpc', 'disable_rest_api', 'rest_allowlist', 'disable_rest_comments',
     325                'disable_xmlrpc', 'disable_rest_api', 'rest_lockdown', 'rest_allowlist', 'disable_rest_comments',
    304326                'disable_embed', 'disable_pingback', 'hide_wp_version', 'disable_file_edit',
    305327                'disable_user_enumeration', 'security_headers', 'login_captcha_math',
    … …  
    362384
    363385    /**
     386 * 1.6.4 (GUARD-REST-01): the REST settings after the split into the
     387 * narrow protection and the opt-in lockdown.
     388 *
     389 * Before 1.6.4 "disable_rest_api" closed the whole REST API to visitors
     390 * outside an allowlist. It now means the narrow protection, and the old
     391 * behaviour is 'rest_lockdown', off by default. What an update does with a
     392 * site that had it on depends on what the owner did with the list:
     393 *
     394 * - the list is still the old default: nobody chose the full closure, it
     395 * was the default, and it took the cart, forms and webhooks down. The
     396 * site gets the narrow protection and the new default list;
     397 * - the list is the owner's own: they wrote exceptions to a full closure
     398 * and meant it. 'rest_lockdown' is switched on with their list, so the
     399 * update does not loosen a site silently.
     400 *
     401 * A site that had the restriction off changes nothing. In both cases of a
     402 * site that had it on, one notice (GUARDFORGE_Core::rest_migration_notice)
     403 * says what was chosen and where to change it.
     404 *
     405 * The decision is taken once: the first run records it in
     406 * REST_MIGRATION_OPTION, and every later run (the next database version)
     407 * stops there, so an owner who turned the lockdown off, or saved a list of
     408 * their own on the narrow protection, is never moved again. A fresh install
     409 * ($upgrading false) has nothing to move and nothing to say.
     410 *
     411 * @param bool $upgrading False for a site with no recorded database version.
     412 */
     413    public static function migrate_rest_settings( $upgrading = true ) {
     414        if ( false !== get_option( self::REST_MIGRATION_OPTION, false ) ) {
     415            return;
     416        }
     417        $mode = 'none';
     418        if ( $upgrading ) {
     419            $stored = get_option( self::OPTION_KEY, [] );
     420            if ( ! is_array( $stored ) ) {
     421                $stored = [];
     422            }
     423            // Never saved means the defaults of 1.6.3: the restriction on, the old list.
     424            $was_on = ! array_key_exists( 'disable_rest_api', $stored ) || ! empty( $stored['disable_rest_api'] );
     425            $list   = isset( $stored['rest_allowlist'] ) && is_string( $stored['rest_allowlist'] ) ? $stored['rest_allowlist'] : self::LEGACY_REST_ALLOWLIST;
     426            $legacy = GUARDFORGE_Hardening::parse_lines( $list ) === GUARDFORGE_Hardening::parse_lines( self::LEGACY_REST_ALLOWLIST );
     427            if ( $legacy ) {
     428                if ( isset( $stored['rest_allowlist'] ) ) {
     429                    $stored['rest_allowlist'] = self::defaults()['rest_allowlist'];
     430                    update_option( self::OPTION_KEY, $stored );
     431                }
     432                $mode = $was_on ? 'narrow' : 'none';
     433            } elseif ( $was_on ) {
     434                $stored['rest_lockdown'] = 1;
     435                update_option( self::OPTION_KEY, $stored );
     436                $mode = 'lockdown';
     437            }
     438        }
     439        update_option( self::REST_MIGRATION_OPTION, [ 'mode' => $mode, 'notice' => $mode === 'none' ? 0 : 1 ], false );
     440    }
     441
     442    /**
     443 * What the REST migration chose, for the notice: 'lockdown' or 'narrow'
     444 * while it is open for somebody who can change the settings, null
     445 * otherwise (nothing changed, dismissed, or not that person's to read).
     446 *
     447 * @return string|null
     448 */
     449    public static function rest_migration_notice() {
     450        $state = get_option( self::REST_MIGRATION_OPTION, false );
     451        if ( ! is_array( $state ) || empty( $state['notice'] ) || empty( $state['mode'] ) ) {
     452            return null;
     453        }
     454        if ( ! in_array( $state['mode'], [ 'lockdown', 'narrow' ], true ) || ! current_user_can( 'manage_options' ) ) {
     455            return null;
     456        }
     457        return $state['mode'];
     458    }
     459
     460    /** Close the notice for good; the decision itself stays recorded. */
     461    public static function dismiss_rest_migration_notice() {
     462        $state = get_option( self::REST_MIGRATION_OPTION, false );
     463        if ( ! is_array( $state ) ) {
     464            return;
     465        }
     466        $state['notice'] = 0;
     467        update_option( self::REST_MIGRATION_OPTION, $state, false );
     468    }
     469
     470    /**
    364471 * Reset to defaults — used by uninstall.php and tests.
    365472 */
  • guardforge/trunk/includes/class-schema-manager.php

    r3731705 r3754541  
    2222        self::run_dbdelta();
    2323        self::stamp_enabled_since();
     24        // 1.6.4: the REST restriction split into a narrow default and an
     25        // opt-in lockdown; see the method for what it writes and what not.
     26        // No recorded version is a new install: nothing to move.
     27        GUARDFORGE_Options::migrate_rest_settings( $current !== '' );
    2428        update_option( self::VERSION_OPTION, GUARDFORGE_DB_VERSION, false );
    2529    }
  • guardforge/trunk/includes/class-two-factor.php

    r3712655 r3754541  
    272272    }
    273273
     274    /**
     275 * The code page. The redirects live here; what is decided lives in
     276 * judge_challenge, which a test can call without the request ending.
     277 */
    274278    public function handle_verify_challenge() {
    275279        // The pending token stands in for a nonce here, and is the stronger of
    … …  
    280284        // phpcs:ignore WordPress.Security.NonceVerification.Missing -- see above.
    281285        $code  = isset( $_POST['guardforge_2fa_code'] ) ? sanitize_text_field( wp_unslash( $_POST['guardforge_2fa_code'] ) ) : '';
    282         $pending = $token !== '' ? self::read_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token ) : false;
    283         if ( ! is_array( $pending ) ) {
     286
     287        $verdict = $this->judge_challenge( $token, $code );
     288        if ( $verdict['status'] === 'expired' ) {
    284289            wp_safe_redirect( wp_login_url() );
    285290            exit;
    286291        }
    287         if ( ! $this->verify_code( (int) $pending['user_id'], $code ) ) {
     292        if ( $verdict['status'] === 'wrong' ) {
    288293            $url = add_query_arg( [
    289294                'action'   => 'validate_2fa',
    … …  
    294299            exit;
    295300        }
     301        $pending = $verdict['pending'];
    296302        self::forget_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token );
    297303        wp_set_auth_cookie( (int) $pending['user_id'], ! empty( $pending['remember'] ) );
    298304        wp_safe_redirect( admin_url() );
    299305        exit;
     306    }
     307
     308    /**
     309 * Judge one try at the code page: 'expired' (no such pending login),
     310 * 'wrong' or 'ok'.
     311 *
     312 * This page posts to admin-post.php, not wp-login.php, so neither of the
     313 * two things that stop a password guesser ever saw it: core's failure hook
     314 * (fired only when wp-login authenticates) and the lockout check on
     315 * login_init. Someone holding a stolen password could therefore try
     316 * six-digit codes for as long as the token lived. So the lockout is asked
     317 * first, before the code is even looked at, and a wrong code is reported
     318 * through the same failure hook a wrong password is — one counter, one
     319 * threshold, one log, one alert.
     320 *
     321 * @return array{status:string,pending:?array}
     322 */
     323    public function judge_challenge( $token, $code ) {
     324        $pending = $token !== '' ? self::read_transient( self::PENDING_TRANSIENT, self::LEGACY_PENDING_TRANSIENT, $token ) : false;
     325        if ( ! is_array( $pending ) ) {
     326            return [ 'status' => 'expired', 'pending' => null ];
     327        }
     328        if ( class_exists( 'GUARDFORGE_Bruteforce' ) ) {
     329            // Ends the request with the lockout page when this address is out of tries.
     330            GUARDFORGE_Bruteforce::instance()->maybe_block_login();
     331        }
     332        if ( $this->verify_code( (int) $pending['user_id'], $code ) ) {
     333            return [ 'status' => 'ok', 'pending' => $pending ];
     334        }
     335        $account = get_userdata( (int) $pending['user_id'] );
     336        /** This action is documented in wp-includes/pluggable.php */
     337        do_action(
     338            'wp_login_failed', // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core's own action, fired so every failed-login listener counts a wrong code.
     339            $account && isset( $account->user_login ) ? (string) $account->user_login : '',
     340            new WP_Error( 'gf_2fa_wrong', __( '<strong>Error:</strong> two-factor code is invalid.', 'guardforge' ) )
     341        );
     342        return [ 'status' => 'wrong', 'pending' => $pending ];
    300343    }
    301344
  • guardforge/trunk/languages/guardforge.pot

    r3752344 r3754541  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Guard Forge – Security, Login Protection, 2FA & Audit Log 1.6.2\n"
     5"Project-Id-Version: Guard Forge – Security, Login Protection, 2FA & Audit Log 1.6.4\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/guardforge\n"
    7 "POT-Creation-Date: 2026-10-16T09:54:01+00:00\n"
     7"POT-Creation-Date: 2026-10-19T10:40:39+00:00\n"
    88"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    99"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    7070#: includes/class-audit-log.php:198
    7171#: includes/class-case-actions.php:346
     72#: includes/class-core.php:115
    7273#: includes/class-guard-report-export.php:109
    7374#: includes/class-hardening-score-badge.php:457
    74 #: includes/class-hardening-score.php:1533
     75#: includes/class-hardening-score.php:1511
    7576#: includes/class-integrity.php:818
    76 #: includes/class-two-factor.php:306
    77 #: includes/class-two-factor.php:324
     77#: includes/class-two-factor.php:349
     78#: includes/class-two-factor.php:367
    7879msgid "Access denied."
    7980msgstr ""
    … …  
    9091
    9192#: admin/partials/audit-log.php:53
    92 #: includes/class-core.php:138
     93#: includes/class-core.php:184
    9394msgid "Audit log"
    9495msgstr ""
    … …  
    186187
    187188#: admin/partials/audit-log.php:161
    188 #: admin/partials/unblock.php:89
     189#: admin/partials/unblock.php:96
    189190msgid "IP"
    190191msgstr ""
    … …  
    298299#: admin/partials/cases.php:76
    299300#: admin/partials/cases.php:220
    300 #: includes/class-core.php:137
     301#: includes/class-core.php:183
    301302msgid "Cases"
    302303msgstr ""
    … …  
    764765
    765766#: admin/partials/hardening-score.php:50
    766 #: includes/class-core.php:128
     767#: includes/class-core.php:174
    767768msgid "Hardening score"
    768769msgstr ""
    … …  
    937938
    938939#: admin/partials/integrity.php:59
    939 #: includes/class-core.php:131
     940#: includes/class-core.php:177
    940941msgid "File integrity"
    941942msgstr ""
    … …  
    12621263
    12631264#: admin/partials/login-log.php:60
    1264 #: includes/class-core.php:139
     1265#: includes/class-core.php:185
    12651266msgid "Login log"
    12661267msgstr ""
    … …  
    13081309#: admin/partials/scanner.php:15
    13091310#: admin/partials/scanner.php:35
    1310 #: includes/class-core.php:130
     1311#: includes/class-core.php:176
    13111312msgid "Malware scanner"
    13121313msgstr ""
    … …  
    14131414
    14141415#: admin/partials/settings.php:46
    1415 #: includes/class-core.php:127
     1416#: includes/class-core.php:173
    14161417msgid "Settings"
    14171418msgstr ""
    … …  
    15011502
    15021503#: admin/partials/settings.php:190
    1503 #: includes/class-core.php:132
     1504#: includes/class-core.php:178
    15041505msgid "Cloudflare"
    15051506msgstr ""
    … …  
    16011602
    16021603#: admin/partials/settings.php:476
    1603 msgid "Restrict REST API to logged-in users"
     1604msgid "Keep user records out of the REST API"
    16041605msgstr ""
    16051606
    16061607#: admin/partials/settings.php:476
    1607 msgid "Anonymous REST access is limited to the namespaces in the allowlist below."
     1608msgid "Visitors and customers cannot list your users or read their records through the REST API, the usual way login names are collected. Checkout, forms and webhooks keep working."
    16081609msgstr ""
    16091610
    … …  
    16171618
    16181619#: admin/partials/settings.php:478
     1620msgid "Close the whole REST API to visitors who are not signed in"
     1621msgstr ""
     1622
     1623#: admin/partials/settings.php:478
     1624msgid "Only the namespaces in the REST API allowlist stay open to them. Anything that talks to your site through the REST API without signing in stops working unless its namespace is on that list."
     1625msgstr ""
     1626
     1627#: admin/partials/settings.php:484
     1628msgid "The REST API is closed to visitors who are not signed in."
     1629msgstr ""
     1630
     1631#: admin/partials/settings.php:486
     1632msgid "Before you close the whole REST API: it breaks the WooCommerce block cart and checkout, contact forms, webhooks other services send to your site, and embeds of your posts on other sites, unless their namespaces are in the allowlist."
     1633msgstr ""
     1634
     1635#: admin/partials/settings.php:492
     1636msgid "Not working for them on this site right now:"
     1637msgstr ""
     1638
     1639#: admin/partials/settings.php:494
     1640msgid "On this site, these would stop working for visitors:"
     1641msgstr ""
     1642
     1643#. translators: %s: a REST namespace such as wc/store
     1644#: admin/partials/settings.php:503
     1645#, php-format
     1646msgid "add %s to the allowlist to keep it"
     1647msgstr ""
     1648
     1649#: admin/partials/settings.php:514
    16191650msgid "Disable oEmbed discovery"
    16201651msgstr ""
    16211652
    1622 #: admin/partials/settings.php:478
     1653#: admin/partials/settings.php:514
    16231654msgid "Removes /oembed information leaks."
    16241655msgstr ""
    16251656
    1626 #: admin/partials/settings.php:479
     1657#: admin/partials/settings.php:515
    16271658msgid "Disable self-pingbacks"
    16281659msgstr ""
    16291660
    1630 #: admin/partials/settings.php:479
     1661#: admin/partials/settings.php:515
    16311662msgid "Blocks pingbacks pointing at your own URLs."
    16321663msgstr ""
    16331664
    1634 #: admin/partials/settings.php:485
     1665#: admin/partials/settings.php:521
    16351666msgid "Hardening"
    16361667msgstr ""
    16371668
    1638 #: admin/partials/settings.php:488
     1669#: admin/partials/settings.php:524
    16391670msgid "Hide WordPress version"
    16401671msgstr ""
    16411672
    1642 #: admin/partials/settings.php:488
     1673#: admin/partials/settings.php:524
    16431674msgid "Removes the generator meta and ver=… query strings."
    16441675msgstr ""
    16451676
    1646 #: admin/partials/settings.php:489
     1677#: admin/partials/settings.php:525
    16471678msgid "Disable theme/plugin file editor"
    16481679msgstr ""
    16491680
    1650 #: admin/partials/settings.php:489
     1681#: admin/partials/settings.php:525
    16511682msgid "Defines DISALLOW_FILE_EDIT so PHP can't be edited from the admin."
    16521683msgstr ""
    16531684
    1654 #: admin/partials/settings.php:490
     1685#: admin/partials/settings.php:526
    16551686msgid "Block user enumeration"
    16561687msgstr ""
    16571688
    1658 #: admin/partials/settings.php:490
     1689#: admin/partials/settings.php:526
    16591690msgid "Redirects ?author=N and hides anonymous /wp/v2/users."
    16601691msgstr ""
    16611692
    1662 #: admin/partials/settings.php:491
     1693#: admin/partials/settings.php:527
    16631694msgid "Send security HTTP headers"
    16641695msgstr ""
    16651696
    1666 #: admin/partials/settings.php:491
     1697#: admin/partials/settings.php:527
    16671698msgid "Referrer-Policy, X-Content-Type-Options, X-Frame-Options, Permissions-Policy."
    16681699msgstr ""
    16691700
    1670 #: admin/partials/settings.php:492
     1701#: admin/partials/settings.php:528
    16711702msgid "Math captcha on login"
    16721703msgstr ""
    16731704
    1674 #: admin/partials/settings.php:492
    1675 msgid "Adds an a + b = ? challenge to the login form."
    1676 msgstr ""
    1677 
    1678 #: admin/partials/settings.php:498
     1705#: admin/partials/settings.php:528
     1706msgid "Adds an a + b = ? challenge to the WordPress login page. Sign-in forms of shops and membership plugins are not affected, so customers can still log in."
     1707msgstr ""
     1708
     1709#: admin/partials/settings.php:534
    16791710msgid "Files & Directories"
    16801711msgstr ""
    16811712
    1682 #: admin/partials/settings.php:501
     1713#: admin/partials/settings.php:537
    16831714msgid "Protect sensitive files"
    16841715msgstr ""
    16851716
    1686 #: admin/partials/settings.php:501
     1717#: admin/partials/settings.php:537
    16871718msgid "Denies direct access to wp-config.php, .htaccess, readme.html, license.txt via .htaccess."
    16881719msgstr ""
    16891720
    1690 #: admin/partials/settings.php:502
     1721#: admin/partials/settings.php:538
    16911722msgid "Disable directory listing"
    16921723msgstr ""
    16931724
    1694 #: admin/partials/settings.php:502
     1725#: admin/partials/settings.php:538
    16951726msgid "Options -Indexes — folders no longer show their contents."
    16961727msgstr ""
    16971728
    1698 #: admin/partials/settings.php:508
     1729#: admin/partials/settings.php:544
    16991730msgid "Spam & Bots"
    17001731msgstr ""
    17011732
    1702 #: admin/partials/settings.php:511
     1733#: admin/partials/settings.php:547
    17031734msgid "Comment-form honeypot"
    17041735msgstr ""
    17051736
    1706 #: admin/partials/settings.php:511
     1737#: admin/partials/settings.php:547
    17071738msgid "Adds a hidden field bots tend to fill — humans don't."
    17081739msgstr ""
    17091740
    1710 #: admin/partials/settings.php:512
     1741#: admin/partials/settings.php:548
    17111742msgid "Block malicious bot User-Agents"
    17121743msgstr ""
    17131744
    1714 #: admin/partials/settings.php:512
     1745#: admin/partials/settings.php:548
    17151746msgid "Blocks sqlmap, nikto, masscan, wpscan, nessus and similar scanners."
    17161747msgstr ""
    17171748
    1718 #: admin/partials/settings.php:518
     1749#: admin/partials/settings.php:554
    17191750msgid "Staging / development mode"
    17201751msgstr ""
    17211752
    1722 #: admin/partials/settings.php:533
     1753#: admin/partials/settings.php:569
    17231754msgid "Right now: staging mode is ON."
    17241755msgstr ""
    17251756
    1726 #: admin/partials/settings.php:534
     1757#: admin/partials/settings.php:570
    17271758msgid "Right now: staging mode is off and every protection is enforced."
    17281759msgstr ""
    17291760
    1730 #: admin/partials/settings.php:538
     1761#: admin/partials/settings.php:574
    17311762msgid "The address matched against your list:"
    17321763msgstr ""
    17331764
    1734 #: admin/partials/settings.php:544
     1765#: admin/partials/settings.php:580
    17351766msgid "Staging host names"
    17361767msgstr ""
    17371768
    1738 #: admin/partials/settings.php:546
     1769#: admin/partials/settings.php:582
    17391770msgid "One host name per line, matched against the address this site is actually served on. A leading dot matches every subdomain of that name but never the name itself, so \".example.com\" covers dev.example.com and leaves example.com alone. Nothing else is a pattern. Because the match is against the live address, copying this database onto your production site stops it matching the moment the domain changes."
    17401771msgstr ""
    17411772
    1742 #: admin/partials/settings.php:551
     1773#: admin/partials/settings.php:587
    17431774msgid "Always treat this site as production"
    17441775msgstr ""
    17451776
    1746 #: admin/partials/settings.php:552
     1777#: admin/partials/settings.php:588
    17471778msgid "Overrules everything above and every signal below it. Use this when a real site is being mistaken for a copy — it can only ever make GuardForge more protective, never less, which is why it is safe to keep in the database."
    17481779msgstr ""
    17491780
    1750 #: admin/partials/settings.php:557
     1781#: admin/partials/settings.php:593
    17511782msgid "While staging mode is on, GuardForge holds back:"
    17521783msgstr ""
    17531784
    1754 #: admin/partials/settings.php:559
     1785#: admin/partials/settings.php:595
    17551786msgid "Brute-force lockouts — attempts are still counted and written to the login log as \"soft_locked\", but nobody is shut out."
    17561787msgstr ""
    17571788
    1758 #: admin/partials/settings.php:560
     1789#: admin/partials/settings.php:596
    17591790msgid "Every notification e-mail: lockouts, new administrators and file-integrity changes."
    17601791msgstr ""
    17611792
    1762 #: admin/partials/settings.php:569
     1793#: admin/partials/settings.php:605
    17631794msgid "Telegram, Slack and webhook alerts."
    17641795msgstr ""
    17651796
    1766 #: admin/partials/settings.php:572
     1797#: admin/partials/settings.php:608
    17671798msgid "Cloudflare firewall rules — a copy shares the live zone and token, so a block pushed from here would land in front of your real site."
    17681799msgstr ""
    17691800
    1770 #: admin/partials/settings.php:575
     1801#: admin/partials/settings.php:611
    17711802msgid "Auto-lockdown — a spike in lockouts or a malware finding on a copy does not shut the site down."
    17721803msgstr ""
    17731804
    1774 #: admin/partials/settings.php:578
     1805#: admin/partials/settings.php:614
    17751806msgid "AI threat analysis, so a forgotten copy cannot spend your credits."
    17761807msgstr ""
    17771808
    1778 #: admin/partials/settings.php:581
     1809#: admin/partials/settings.php:617
    17791810msgid "To switch staging mode on by hand, add define( 'GUARDFORGE_STAGING_MODE', true ); to wp-config.php. Setting it to false pins the site to production. It lives in wp-config.php rather than in a setting on purpose: a database copied from staging onto your live site must never be able to carry the switch that turns your security off."
    17801811msgstr ""
    17811812
    1782 #: admin/partials/settings.php:587
     1813#: admin/partials/settings.php:623
    17831814msgid "Brute-force protection"
    17841815msgstr ""
    17851816
    1786 #: admin/partials/settings.php:590
     1817#: admin/partials/settings.php:626
    17871818msgid "Enable brute-force protection"
    17881819msgstr ""
    17891820
    1790 #: admin/partials/settings.php:590
     1821#: admin/partials/settings.php:626
    17911822msgid "Locks IPs that exceed the failed-attempt threshold."
    17921823msgstr ""
    17931824
    1794 #: admin/partials/settings.php:591
     1825#: admin/partials/settings.php:627
    17951826msgid "Record login attempts"
    17961827msgstr ""
    17971828
    1798 #: admin/partials/settings.php:591
     1829#: admin/partials/settings.php:627
    17991830msgid "Stores every login attempt in the database."
    18001831msgstr ""
    18011832
    1802 #: admin/partials/settings.php:592
     1833#: admin/partials/settings.php:628
    18031834msgid "Email on lockout"
    18041835msgstr ""
    18051836
    1806 #: admin/partials/settings.php:592
     1837#: admin/partials/settings.php:628
    18071838msgid "Send an email whenever an IP is locked out."
    18081839msgstr ""
    18091840
    1810 #: admin/partials/settings.php:598
     1841#: admin/partials/settings.php:634
    18111842msgid "Integrity monitoring"
    18121843msgstr ""
    18131844
    1814 #: admin/partials/settings.php:603
     1845#: admin/partials/settings.php:639
    18151846msgid "Monitor core file integrity"
    18161847msgstr ""
    18171848
    1818 #: admin/partials/settings.php:606
     1849#: admin/partials/settings.php:642
    18191850msgid "Off by default. When on, this site asks api.wordpress.org once a day for the official checksums of your WordPress version and compares wp-admin and wp-includes against them. The request carries the version and the locale, nothing about your site. \"Run scan now\" on the File integrity screen runs one scan without putting anything on a schedule."
    18201851msgstr ""
    18211852
    1822 #: admin/partials/settings.php:608
     1853#: admin/partials/settings.php:644
    18231854msgid "Email on integrity changes"
    18241855msgstr ""
    18251856
    1826 #: admin/partials/settings.php:608
     1857#: admin/partials/settings.php:644
    18271858msgid "Alerts you when modified or removed files are detected."
    18281859msgstr ""
    18291860
    1830 #: admin/partials/settings.php:609
     1861#: admin/partials/settings.php:645
    18311862msgid "Also monitor plugins & themes"
    18321863msgstr ""
    18331864
    1834 #: admin/partials/settings.php:609
     1865#: admin/partials/settings.php:645
    18351866msgid "Extends the scan to wp-content/plugins and wp-content/themes."
    18361867msgstr ""
    18371868
    1838 #: admin/partials/settings.php:613
     1869#: admin/partials/settings.php:649
    18391870msgid "Last scan:"
    18401871msgstr ""
    18411872
    1842 #: admin/partials/settings.php:638
     1873#: admin/partials/settings.php:674
    18431874msgid "Action audit"
    18441875msgstr ""
    18451876
    1846 #: admin/partials/settings.php:641
     1877#: admin/partials/settings.php:677
    18471878msgid "Log admin actions"
    18481879msgstr ""
    18491880
    1850 #: admin/partials/settings.php:641
     1881#: admin/partials/settings.php:677
    18511882msgid "Records plugin/theme/post/option/user/role changes."
    18521883msgstr ""
    18531884
    1854 #: admin/partials/settings.php:642
     1885#: admin/partials/settings.php:678
    18551886msgid "Email on new administrator"
    18561887msgstr ""
    18571888
    1858 #: admin/partials/settings.php:642
     1889#: admin/partials/settings.php:678
    18591890msgid "Sends an alert whenever a user is promoted to administrator."
    18601891msgstr ""
    18611892
    1862 #: admin/partials/settings.php:648
     1893#: admin/partials/settings.php:684
    18631894msgid "Content Security Policy"
    18641895msgstr ""
    18651896
    1866 #: admin/partials/settings.php:651
     1897#: admin/partials/settings.php:687
    18671898msgid "Send Content-Security-Policy header"
    18681899msgstr ""
    18691900
    1870 #: admin/partials/settings.php:651
     1901#: admin/partials/settings.php:687
    18711902msgid "Controls where scripts and styles may load from. Excellent XSS hardening when tuned."
    18721903msgstr ""
    18731904
    1874 #: admin/partials/settings.php:652
     1905#: admin/partials/settings.php:688
    18751906msgid "Send as report-only (recommended first)"
    18761907msgstr ""
    18771908
    1878 #: admin/partials/settings.php:652
     1909#: admin/partials/settings.php:688
    18791910msgid "Reports violations without blocking — flip off once your policy is tuned."
    18801911msgstr ""
    18811912
    1882 #: admin/partials/settings.php:655
     1913#: admin/partials/settings.php:691
    18831914msgid "CSP policy"
    18841915msgstr ""
    18851916
    1886 #: admin/partials/settings.php:657
     1917#: admin/partials/settings.php:693
    18871918msgid "Value of the Content-Security-Policy header. Test thoroughly — aggressive policies can break plugins."
    18881919msgstr ""
    18891920
    1890 #: admin/partials/settings.php:663
     1921#: admin/partials/settings.php:699
    18911922msgid "Brute-force & notification parameters"
    18921923msgstr ""
    18931924
    1894 #: admin/partials/settings.php:666
     1925#: admin/partials/settings.php:702
    18951926msgid "Max attempts"
    18961927msgstr ""
    18971928
    1898 #: admin/partials/settings.php:668
     1929#: admin/partials/settings.php:704
    18991930msgid "Failed attempts before the IP is locked."
    19001931msgstr ""
    19011932
    1902 #: admin/partials/settings.php:671
     1933#: admin/partials/settings.php:707
    19031934msgid "Lockout duration (minutes)"
    19041935msgstr ""
    19051936
    1906 #: admin/partials/settings.php:673
     1937#: admin/partials/settings.php:709
    19071938msgid "How long an IP stays locked."
    19081939msgstr ""
    19091940
    1910 #: admin/partials/settings.php:676
     1941#: admin/partials/settings.php:712
    19111942msgid "Login log retention (days)"
    19121943msgstr ""
    19131944
    1914 #: admin/partials/settings.php:678
     1945#: admin/partials/settings.php:714
    19151946msgid "Older login-log rows are pruned."
    19161947msgstr ""
    19171948
    1918 #: admin/partials/settings.php:681
     1949#: admin/partials/settings.php:717
    19191950msgid "Audit log retention (days)"
    19201951msgstr ""
    19211952
    1922 #: admin/partials/settings.php:683
     1953#: admin/partials/settings.php:719
    19231954msgid "Older audit rows are pruned."
    19241955msgstr ""
    19251956
    1926 #: admin/partials/settings.php:686
     1957#: admin/partials/settings.php:722
    19271958msgid "Notification email"
    19281959msgstr ""
    19291960
    1930 #: admin/partials/settings.php:688
     1961#: admin/partials/settings.php:724
    19311962msgid "Falls back to the site administrator email."
    19321963msgstr ""
    19331964
    1934 #: admin/partials/settings.php:691
     1965#: admin/partials/settings.php:727
    19351966msgid "IP whitelist"
    19361967msgstr ""
    19371968
    1938 #: admin/partials/settings.php:693
     1969#: admin/partials/settings.php:729
    19391970msgid "One IP or CIDR per line — never blocked."
    19401971msgstr ""
    19411972
    1942 #: admin/partials/settings.php:696
     1973#: admin/partials/settings.php:732
    19431974msgid "Trusted proxy CIDRs"
    19441975msgstr ""
    19451976
    1946 #: admin/partials/settings.php:698
     1977#: admin/partials/settings.php:734
    19471978msgid "Forwarded-IP headers are only trusted when REMOTE_ADDR matches one of these ranges. Leave empty if you do not run behind a proxy."
    19481979msgstr ""
    19491980
    1950 #: admin/partials/settings.php:701
     1981#: admin/partials/settings.php:737
    19511982msgid "REST API allowlist"
    19521983msgstr ""
    19531984
    1954 #: admin/partials/settings.php:703
    1955 msgid "One namespace prefix per line. Routes whose namespace starts with one of these remain accessible to anonymous callers (oembed, formforge submissions, etc.)."
    1956 msgstr ""
    1957 
    1958 #: admin/partials/settings.php:706
     1985#: admin/partials/settings.php:739
     1986msgid "Used only when the whole REST API is closed to visitors. One route per line; it stays open together with everything under it. The defaults keep embeds, WooCommerce checkout and the public endpoints of Avakode plugins working."
     1987msgstr ""
     1988
     1989#: admin/partials/settings.php:742
    19591990msgid "Extra User-Agent blocklist"
    19601991msgstr ""
    19611992
    1962 #: admin/partials/settings.php:708
     1993#: admin/partials/settings.php:744
    19631994msgid "One substring per line. Case-insensitive contains match."
    19641995msgstr ""
    19651996
    1966 #: admin/partials/settings.php:714
     1997#: admin/partials/settings.php:750
    19671998msgid "When GuardForge is deleted"
    19681999msgstr ""
    19692000
    1970 #: admin/partials/settings.php:718
     2001#: admin/partials/settings.php:754
    19712002msgid "Delete GuardForge data on uninstall"
    19722003msgstr ""
    19732004
    1974 #: admin/partials/settings.php:719
     2005#: admin/partials/settings.php:755
    19752006msgid "Off by default: deleting the plugin leaves your login log, integrity snapshots and audit trail in place, so an accidental removal does not take your history with it. Two-factor enrolments are the exception and are always removed — they are shared secrets, and a database that outlives the plugin should not keep them."
    19762007msgstr ""
    19772008
    1978 #: admin/partials/settings.php:728
     2009#: admin/partials/settings.php:764
    19792010msgid "Save settings"
    19802011msgstr ""
    … …  
    20792110
    20802111#. translators: %s is the IP address that was unblocked.
    2081 #: admin/partials/unblock.php:15
     2112#: admin/partials/unblock.php:17
    20822113#, php-format
    20832114msgid "IP %s unblocked."
    20842115msgstr ""
    20852116
    2086 #: admin/partials/unblock.php:41
    2087 #: includes/class-core.php:140
     2117#: admin/partials/unblock.php:19
     2118msgid "Lockout lifted."
     2119msgstr ""
     2120
     2121#: admin/partials/unblock.php:21
     2122msgid "That is not an IP address, so nothing was unblocked."
     2123msgstr ""
     2124
     2125#: admin/partials/unblock.php:48
     2126#: includes/class-core.php:186
    20882127msgid "Unblock IP"
    20892128msgstr ""
    20902129
    2091 #: admin/partials/unblock.php:41
     2130#: admin/partials/unblock.php:48
    20922131msgid "Lift brute-force lockouts"
    20932132msgstr ""
    20942133
    2095 #: admin/partials/unblock.php:44
     2134#: admin/partials/unblock.php:51
    20962135msgid "Manual unblock"
    20972136msgstr ""
    20982137
    2099 #: admin/partials/unblock.php:48
     2138#: admin/partials/unblock.php:55
    21002139msgid "Enter IP address"
    21012140msgstr ""
    21022141
    2103 #: admin/partials/unblock.php:49
    2104 #: admin/partials/unblock.php:75
    2105 #: admin/partials/unblock.php:100
    2106 #: includes/class-core.php:187
     2142#: admin/partials/unblock.php:56
     2143#: admin/partials/unblock.php:82
     2144#: admin/partials/unblock.php:107
     2145#: includes/class-core.php:233
    21072146msgid "Unblock"
    21082147msgstr ""
    21092148
    21102149#. translators: %d is the number of active IP lockouts.
    2111 #: admin/partials/unblock.php:57
     2150#: admin/partials/unblock.php:64
    21122151#, php-format
    21132152msgid "Active lockouts (%d)"
    21142153msgstr ""
    21152154
    2116 #: admin/partials/unblock.php:60
     2155#: admin/partials/unblock.php:67
    21172156msgid "No active lockouts."
    21182157msgstr ""
    21192158
    2120 #: admin/partials/unblock.php:63
     2159#: admin/partials/unblock.php:70
    21212160msgid "Transient key"
    21222161msgstr ""
    21232162
    2124 #: admin/partials/unblock.php:63
     2163#: admin/partials/unblock.php:70
    21252164msgid "Attempts"
    21262165msgstr ""
    21272166
    2128 #: admin/partials/unblock.php:63
    2129 #: admin/partials/unblock.php:89
     2167#: admin/partials/unblock.php:70
     2168#: admin/partials/unblock.php:96
    21302169msgid "Action"
    21312170msgstr ""
    21322171
    2133 #: admin/partials/unblock.php:87
     2172#: admin/partials/unblock.php:94
    21342173msgid "IPs from lockout log"
    21352174msgstr ""
    21362175
    2137 #: admin/partials/unblock.php:89
     2176#: admin/partials/unblock.php:96
    21382177msgid "Times locked"
    21392178msgstr ""
    21402179
    2141 #: admin/partials/unblock.php:89
     2180#: admin/partials/unblock.php:96
    21422181msgid "Last time"
    21432182msgstr ""
    … …  
    21582197
    21592198#: admin/partials/vuln-db.php:105
    2160 #: includes/class-core.php:129
     2199#: includes/class-core.php:175
    21612200msgid "Vulnerabilities"
    21622201msgstr ""
    … …  
    22172256
    22182257#: admin/partials/vuln-db.php:167
     2258#: includes/class-core.php:109
    22192259msgid "Open Settings"
    22202260msgstr ""
    … …  
    23012341
    23022342#. translators: %d is the lockout window in minutes.
    2303 #: includes/class-bruteforce.php:57
     2343#: includes/class-bruteforce.php:72
     2344#: includes/class-bruteforce.php:106
    23042345#, php-format
    23052346msgid "Too many failed attempts. Try again in %d minutes."
    23062347msgstr ""
    23072348
    2308 #: includes/class-bruteforce.php:60
     2349#: includes/class-bruteforce.php:75
    23092350msgid "Access temporarily blocked"
    23102351msgstr ""
    23112352
    2312 #: includes/class-bruteforce.php:250
     2353#: includes/class-bruteforce.php:409
    23132354msgid "GuardForge — IP locked out"
    23142355msgstr ""
    23152356
    23162357#. translators: 1: IP, 2: username, 3: timestamp.
    2317 #: includes/class-bruteforce.php:254
     2358#: includes/class-bruteforce.php:413
    23182359#, php-format
    23192360msgid ""
    … …  
    23422383
    23432384#. translators: 1: installed Pro version, 2: required Pro version
    2344 #: includes/class-core.php:65
     2385#: includes/class-core.php:67
    23452386#, php-format
    23462387msgid "GuardForge Pro %1$s is too old for this version of GuardForge, so it is switched off rather than left running. Install GuardForge Pro %2$s or newer."
    23472388msgstr ""
    23482389
    2349 #: includes/class-core.php:71
     2390#: includes/class-core.php:73
    23502391msgid "Until then alerts to Telegram, Slack or a webhook, the Cloudflare firewall push, automatic lockdown, patch by update, the WAF, malware scanning, AI threat analysis, required 2FA and audit export are unavailable. Your logs, baselines and settings are kept."
    23512392msgstr ""
    23522393
    2353 #: includes/class-core.php:73
     2394#: includes/class-core.php:75
    23542395msgid "If Dashboard → Updates lists no update for it, download the add-on from your Avakode dashboard and upload it over this copy in Plugins → Add New Plugin → Upload Plugin."
    23552396msgstr ""
    23562397
    2357 #: includes/class-core.php:74
     2398#: includes/class-core.php:76
    23582399msgid "Open Downloads"
    23592400msgstr ""
    23602401
    2361 #: includes/class-core.php:102
     2402#: includes/class-core.php:101
     2403msgid "GuardForge still closes the REST API to visitors who are not signed in, as you had set it."
     2404msgstr ""
     2405
    23622406#: includes/class-core.php:103
     2407msgid "Version 1.6.4 split the REST API protection in two. Because you had written your own list of exceptions, the switch that closes the whole REST API is now on, with your list. To keep only user records private instead, turn that switch off in Settings, under API & Protocols."
     2408msgstr ""
     2409
     2410#: includes/class-core.php:105
     2411msgid "GuardForge now keeps only user records private in the REST API."
     2412msgstr ""
     2413
     2414#: includes/class-core.php:107
     2415msgid "Version 1.6.4 split the REST API protection in two. The protection you had used the default list, which also shut out the WooCommerce cart and checkout, contact forms and webhooks, so it now closes user records to visitors and nothing else. To close the whole REST API to visitors who are not signed in, turn that switch on in Settings, under API & Protocols."
     2416msgstr ""
     2417
     2418#: includes/class-core.php:110
     2419msgid "Dismiss"
     2420msgstr ""
     2421
     2422#: includes/class-core.php:148
     2423#: includes/class-core.php:149
    23632424msgid "GuardForge"
    23642425msgstr ""
    23652426
    2366 #: includes/class-core.php:141
     2427#: includes/class-core.php:187
    23672428msgid "Lockdown"
    23682429msgstr ""
    23692430
    2370 #: includes/class-core.php:142
     2431#: includes/class-core.php:188
    23712432msgid "Geo-IP"
    23722433msgstr ""
    23732434
    2374 #: includes/class-core.php:143
     2435#: includes/class-core.php:189
    23752436msgid "2FA"
    23762437msgstr ""
    23772438
    2378 #: includes/class-core.php:185
     2439#: includes/class-core.php:231
    23792440msgid "Clear the log? This cannot be undone."
    23802441msgstr ""
    23812442
    2382 #: includes/class-core.php:186
     2443#: includes/class-core.php:232
    23832444msgid "Scanning…"
    23842445msgstr ""
    … …  
    25722633msgstr ""
    25732634
     2635#: includes/class-hardening-score.php:493
     2636msgid "The site is served over HTTPS"
     2637msgstr ""
     2638
     2639#: includes/class-hardening-score.php:495
     2640msgid "Yes."
     2641msgstr ""
     2642
     2643#: includes/class-hardening-score.php:495
     2644msgid "No — this site answers on plain HTTP."
     2645msgstr ""
     2646
    25742647#: includes/class-hardening-score.php:496
    2575 msgid "The site is served over HTTPS"
    2576 msgstr ""
    2577 
    2578 #: includes/class-hardening-score.php:498
    2579 msgid "Yes."
    2580 msgstr ""
    2581 
    2582 #: includes/class-hardening-score.php:498
    2583 msgid "No — this site answers on plain HTTP."
     2648msgid "Without TLS every password and every session cookie crosses the network readable, so anyone on the same path can take the session and replay it."
    25842649msgstr ""
    25852650
    25862651#: includes/class-hardening-score.php:499
    2587 msgid "Without TLS every password and every session cookie crosses the network readable, so anyone on the same path can take the session and replay it."
    2588 msgstr ""
    2589 
    2590 #: includes/class-hardening-score.php:502
    25912652msgid "Install a certificate with your host, then set the WordPress and site addresses to https."
    25922653msgstr ""
    25932654
    2594 #: includes/class-hardening-score.php:510
     2655#: includes/class-hardening-score.php:507
    25952656msgid "Administrators using two-factor authentication"
    25962657msgstr ""
    25972658
    25982659#. translators: %1$d is the number of enrolled administrators, %2$d the total.
    2599 #: includes/class-hardening-score.php:515
     2660#: includes/class-hardening-score.php:512
    26002661#, php-format
    26012662msgid "%1$d of %2$d administrators are enrolled."
    26022663msgstr ""
    26032664
    2604 #: includes/class-hardening-score.php:519
     2665#: includes/class-hardening-score.php:516
    26052666msgid "This site has no administrator accounts."
    26062667msgstr ""
    26072668
     2669#: includes/class-hardening-score.php:517
     2670msgid "A reused or phished administrator password is the shortest route to running code on the server; a second factor is what makes the password on its own worthless."
     2671msgstr ""
     2672
    26082673#: includes/class-hardening-score.php:520
    2609 msgid "A reused or phished administrator password is the shortest route to running code on the server; a second factor is what makes the password on its own worthless."
    2610 msgstr ""
    2611 
    2612 #: includes/class-hardening-score.php:523
    26132674msgid "Enrol on the 2FA screen, and ask every other administrator to do the same."
    26142675msgstr ""
    26152676
     2677#: includes/class-hardening-score.php:528
     2678msgid "WordPress has not checked for updates yet on this install."
     2679msgstr ""
     2680
    26162681#: includes/class-hardening-score.php:531
    2617 msgid "WordPress has not checked for updates yet on this install."
    2618 msgstr ""
    2619 
    2620 #: includes/class-hardening-score.php:534
    26212682msgid "WordPress core is behind."
    26222683msgstr ""
    26232684
    26242685#. translators: %d is the number of plugins and themes with an update waiting.
    2625 #: includes/class-hardening-score.php:539
     2686#: includes/class-hardening-score.php:536
    26262687#, php-format
    26272688msgid "Core is current; %d plugin or theme updates are waiting."
    26282689msgstr ""
    26292690
    2630 #: includes/class-hardening-score.php:544
     2691#: includes/class-hardening-score.php:541
    26312692msgid "Nothing is waiting to be updated."
    26322693msgstr ""
    26332694
     2695#: includes/class-hardening-score.php:546
     2696msgid "Core, plugins and themes are up to date"
     2697msgstr ""
     2698
    26342699#: includes/class-hardening-score.php:549
    2635 msgid "Core, plugins and themes are up to date"
     2700msgid "Almost every mass compromise of a WordPress site starts with a version whose vulnerability was published, and patched, weeks earlier."
    26362701msgstr ""
    26372702
    26382703#: includes/class-hardening-score.php:552
    2639 msgid "Almost every mass compromise of a WordPress site starts with a version whose vulnerability was published, and patched, weeks earlier."
    2640 msgstr ""
    2641 
    2642 #: includes/class-hardening-score.php:555
    26432704msgid "Apply the waiting updates, then turn on automatic updates for anything you do not review by hand."
    26442705msgstr ""
    26452706
     2707#: includes/class-hardening-score.php:560
     2708msgid "PHP errors are not printed to visitors"
     2709msgstr ""
     2710
    26462711#: includes/class-hardening-score.php:563
    2647 msgid "PHP errors are not printed to visitors"
    2648 msgstr ""
    2649 
    2650 #: includes/class-hardening-score.php:566
    26512712msgid "WP_DEBUG and WP_DEBUG_DISPLAY are both on."
    26522713msgstr ""
    26532714
    2654 #: includes/class-hardening-score.php:567
     2715#: includes/class-hardening-score.php:564
    26552716msgid "Errors are not displayed."
    26562717msgstr ""
    26572718
    2658 #: includes/class-hardening-score.php:568
     2719#: includes/class-hardening-score.php:565
    26592720msgid "A displayed PHP error prints absolute paths, database names and fragments of your queries into the page for whoever triggered it."
    26602721msgstr ""
    26612722
    2662 #: includes/class-hardening-score.php:573
     2723#: includes/class-hardening-score.php:570
    26632724msgid "Edit wp-config.php: set WP_DEBUG to false, or leave WP_DEBUG on and set WP_DEBUG_DISPLAY to false with WP_DEBUG_LOG on. No admin screen can change this."
    26642725msgstr ""
    26652726
     2727#: includes/class-hardening-score.php:576
     2728msgid "XML-RPC is switched off"
     2729msgstr ""
     2730
     2731#: includes/class-hardening-score.php:578
     2732#: includes/class-hardening-score.php:647
     2733#: includes/class-hardening-score.php:837
     2734#: includes/class-hardening-score.php:851
     2735msgid "Off."
     2736msgstr ""
     2737
     2738#: includes/class-hardening-score.php:578
     2739msgid "On — xmlrpc.php answers anonymous callers."
     2740msgstr ""
     2741
    26662742#: includes/class-hardening-score.php:579
    2667 msgid "XML-RPC is switched off"
    2668 msgstr ""
    2669 
    2670 #: includes/class-hardening-score.php:581
    2671 #: includes/class-hardening-score.php:650
    2672 #: includes/class-hardening-score.php:859
    2673 #: includes/class-hardening-score.php:873
    2674 msgid "Off."
    2675 msgstr ""
    2676 
    2677 #: includes/class-hardening-score.php:581
    2678 msgid "On — xmlrpc.php answers anonymous callers."
     2743msgid "One xmlrpc.php request can try hundreds of passwords through system.multicall, and the same endpoint answers pingback.ping for reflection attacks against other people."
    26792744msgstr ""
    26802745
    26812746#: includes/class-hardening-score.php:582
    2682 msgid "One xmlrpc.php request can try hundreds of passwords through system.multicall, and the same endpoint answers pingback.ping for reflection attacks against other people."
    2683 msgstr ""
    2684 
    2685 #: includes/class-hardening-score.php:585
    26862747msgid "Turn on \"Disable XML-RPC\" under API & Protocols. Only turn it back on if you still publish from a desktop or mobile client that needs it."
    26872748msgstr ""
    26882749
    2689 #: includes/class-hardening-score.php:591
     2750#: includes/class-hardening-score.php:588
    26902751msgid "Off — failed logins are never counted."
    26912752msgstr ""
    26922753
    26932754#. translators: %d is the configured number of failed attempts before lockout.
    2694 #: includes/class-hardening-score.php:596
     2755#: includes/class-hardening-score.php:593
    26952756#, php-format
    26962757msgid "On, locking out after %d failed attempts."
    … …  
    26982759
    26992760#. translators: %d is the configured number of failed attempts before lockout.
    2700 #: includes/class-hardening-score.php:603
     2761#: includes/class-hardening-score.php:600
    27012762#, php-format
    27022763msgid "On, but %d attempts is a generous budget for a guessing script."
    … …  
    27042765
    27052766#. translators: %d is the configured number of failed attempts before lockout.
    2706 #: includes/class-hardening-score.php:610
     2767#: includes/class-hardening-score.php:607
    27072768#, php-format
    27082769msgid "On, but a threshold of %d will never trip in practice."
    27092770msgstr ""
    27102771
     2772#: includes/class-hardening-score.php:614
     2773msgid "Brute-force protection locks out guessers"
     2774msgstr ""
     2775
    27112776#: includes/class-hardening-score.php:617
    2712 msgid "Brute-force protection locks out guessers"
     2777msgid "Password spraying only stops when the attempts stop. A threshold set so high that it never trips is a log, not a defence."
    27132778msgstr ""
    27142779
    27152780#: includes/class-hardening-score.php:620
    2716 msgid "Password spraying only stops when the attempts stop. A threshold set so high that it never trips is a log, not a defence."
    2717 msgstr ""
    2718 
    2719 #: includes/class-hardening-score.php:623
    27202781msgid "Turn on brute-force protection and set the maximum attempts to ten or fewer."
    27212782msgstr ""
    27222783
    2723 #: includes/class-hardening-score.php:627
     2784#: includes/class-hardening-score.php:624
    27242785msgid "Staging mode is on, so this copy writes the lockout down and lets the request through. The setting is right; nothing is being blocked here."
    27252786msgstr ""
    27262787
     2788#: includes/class-hardening-score.php:631
     2789msgid "The built-in theme and plugin editor is off"
     2790msgstr ""
     2791
    27272792#: includes/class-hardening-score.php:634
    2728 msgid "The built-in theme and plugin editor is off"
    2729 msgstr ""
    2730 
    2731 #: includes/class-hardening-score.php:637
    27322793msgid "DISALLOW_FILE_EDIT is in force."
    27332794msgstr ""
    27342795
    2735 #: includes/class-hardening-score.php:638
     2796#: includes/class-hardening-score.php:635
    27362797msgid "The editor is reachable — DISALLOW_FILE_EDIT is not in force on this request."
    27372798msgstr ""
    27382799
     2800#: includes/class-hardening-score.php:636
     2801msgid "The theme editor turns one hijacked administrator session into arbitrary PHP on your server, with no upload and no file access needed."
     2802msgstr ""
     2803
    27392804#: includes/class-hardening-score.php:639
    2740 msgid "The theme editor turns one hijacked administrator session into arbitrary PHP on your server, with no upload and no file access needed."
    2741 msgstr ""
    2742 
    2743 #: includes/class-hardening-score.php:642
    27442805msgid "Turn on \"Disable theme/plugin file editor\". If it is already on, something in wp-config.php defines DISALLOW_FILE_EDIT as false and wins — fix it there."
    27452806msgstr ""
    27462807
    2747 #: includes/class-hardening-score.php:652
     2808#: includes/class-hardening-score.php:649
    27482809msgid "On, but no baseline has ever been taken — there is nothing to compare against."
    27492810msgstr ""
    27502811
    27512812#. translators: %d is the number of files found that wordpress.org does not list.
    2752 #: includes/class-hardening-score.php:656
     2813#: includes/class-hardening-score.php:653
    27532814#, php-format
    27542815msgid "The last scan found %d file that is not in the official build."
    … …  
    27572818msgstr[1] ""
    27582819
    2759 #: includes/class-hardening-score.php:665
     2820#: includes/class-hardening-score.php:662
    27602821msgid "A baseline exists, but the last scan is more than a week old."
    27612822msgstr ""
    27622823
    2763 #: includes/class-hardening-score.php:667
     2824#: includes/class-hardening-score.php:664
    27642825msgid "A baseline exists and the last scan is recent."
    27652826msgstr ""
    27662827
    2767 #: includes/class-hardening-score.php:672
     2828#: includes/class-hardening-score.php:669
    27682829msgid "File integrity has a fresh baseline"
    27692830msgstr ""
    27702831
    2771 #: includes/class-hardening-score.php:679
     2832#: includes/class-hardening-score.php:676
    27722833msgid "A backdoor written into a core or plugin file looks like nothing at all from the dashboard; only a hash taken before it arrived can tell you it is there."
    27732834msgstr ""
    27742835
    2775 #: includes/class-hardening-score.php:683
     2836#: includes/class-hardening-score.php:680
    27762837msgid "Open the File integrity screen and look at what was found. A PHP file wordpress.org does not list, sitting in wp-admin or wp-includes, is not something a WordPress update leaves behind."
    27772838msgstr ""
    27782839
    2779 #: includes/class-hardening-score.php:684
     2840#: includes/class-hardening-score.php:681
    27802841msgid "Run a scan on the File integrity screen to create the baseline, and check that the daily cron is firing."
    27812842msgstr ""
    27822843
     2844#: includes/class-hardening-score.php:693
     2845msgid "No account is called \"admin\""
     2846msgstr ""
     2847
    27832848#: includes/class-hardening-score.php:696
    2784 msgid "No account is called \"admin\""
    2785 msgstr ""
    2786 
    2787 #: includes/class-hardening-score.php:699
    27882849msgid "An account with the login \"admin\" exists."
    27892850msgstr ""
    27902851
    2791 #: includes/class-hardening-score.php:700
     2852#: includes/class-hardening-score.php:697
    27922853msgid "No account uses that login."
    27932854msgstr ""
    27942855
     2856#: includes/class-hardening-score.php:698
     2857msgid "An account literally named admin hands over half of every credential pair before the guessing starts."
     2858msgstr ""
     2859
    27952860#: includes/class-hardening-score.php:701
    2796 msgid "An account literally named admin hands over half of every credential pair before the guessing starts."
    2797 msgstr ""
    2798 
    2799 #: includes/class-hardening-score.php:704
    28002861msgid "Create a new administrator with a different login, move the content to it, and delete the old one."
    28012862msgstr ""
    28022863
     2864#: includes/class-hardening-score.php:707
     2865msgid "Login names are not published"
     2866msgstr ""
     2867
     2868#: includes/class-hardening-score.php:709
     2869#: includes/class-hardening-score.php:863
     2870msgid "Blocked."
     2871msgstr ""
     2872
     2873#: includes/class-hardening-score.php:709
     2874msgid "Anyone can list your login names."
     2875msgstr ""
     2876
    28032877#: includes/class-hardening-score.php:710
    2804 msgid "Login names are not published"
    2805 msgstr ""
    2806 
    2807 #: includes/class-hardening-score.php:712
    2808 #: includes/class-hardening-score.php:885
    2809 msgid "Blocked."
    2810 msgstr ""
    2811 
    2812 #: includes/class-hardening-score.php:712
    2813 msgid "Anyone can list your login names."
     2878msgid "The ?author=1 redirect and the REST users route hand out real login names, which turns password guessing from two unknowns into one."
    28142879msgstr ""
    28152880
    28162881#: includes/class-hardening-score.php:713
    2817 msgid "The ?author=1 redirect and the REST users route hand out real login names, which turns password guessing from two unknowns into one."
    2818 msgstr ""
    2819 
    2820 #: includes/class-hardening-score.php:716
    28212882msgid "Turn on \"Block user enumeration\" under Hardening."
    28222883msgstr ""
    28232884
    2824 #: includes/class-hardening-score.php:740
    2825 msgid "The REST API answers anonymous callers on every namespace."
     2885#: includes/class-hardening-score.php:727
     2886msgid "The REST API keeps user records private"
     2887msgstr ""
     2888
     2889#: includes/class-hardening-score.php:730
     2890msgid "Visitors and customers cannot list your users or read their records through the REST API."
     2891msgstr ""
     2892
     2893#: includes/class-hardening-score.php:731
     2894msgid "Anyone can list your users through the REST API."
     2895msgstr ""
     2896
     2897#: includes/class-hardening-score.php:732
     2898msgid "The REST users route hands out every author's login slug to anyone who asks, which turns password guessing from two unknowns into one."
     2899msgstr ""
     2900
     2901#: includes/class-hardening-score.php:735
     2902msgid "Turn on \"Keep user records out of the REST API\" under API & Protocols."
     2903msgstr ""
     2904
     2905#: includes/class-hardening-score.php:741
     2906msgid "Security response headers are sent"
    28262907msgstr ""
    28272908
    28282909#: includes/class-hardening-score.php:743
    2829 msgid "Restricted, but the allowlist lets wp/v2 back in — which is the part that was being restricted."
    2830 msgstr ""
    2831 
    2832 #: includes/class-hardening-score.php:746
    2833 msgid "Anonymous REST access is limited to the allowlisted namespaces."
    2834 msgstr ""
    2835 
    2836 #: includes/class-hardening-score.php:751
    2837 msgid "The REST API is restricted to signed-in callers"
    2838 msgstr ""
    2839 
    2840 #: includes/class-hardening-score.php:754
    2841 msgid "An open REST API publishes users, posts, media and some settings to anonymous callers, and an allowlist entry that re-admits wp/v2 undoes the whole restriction while the checkbox still reads as on."
    2842 msgstr ""
    2843 
    2844 #: includes/class-hardening-score.php:757
    2845 msgid "Turn on the REST restriction and remove any allowlist line that matches wp/v2."
     2910msgid "Sent."
     2911msgstr ""
     2912
     2913#: includes/class-hardening-score.php:743
     2914msgid "Not sent."
     2915msgstr ""
     2916
     2917#: includes/class-hardening-score.php:744
     2918msgid "Without them the browser will sniff content types, render your pages inside somebody else's frame, and leak the full URL of every page as a referrer."
     2919msgstr ""
     2920
     2921#: includes/class-hardening-score.php:747
     2922msgid "Turn on \"Send security HTTP headers\" under Hardening."
     2923msgstr ""
     2924
     2925#: includes/class-hardening-score.php:752
     2926msgid "No Content-Security-Policy header is sent."
     2927msgstr ""
     2928
     2929#: includes/class-hardening-score.php:755
     2930msgid "Sent in report-only mode, which records violations and blocks nothing."
     2931msgstr ""
     2932
     2933#: includes/class-hardening-score.php:758
     2934msgid "Sent and enforcing."
    28462935msgstr ""
    28472936
    28482937#: includes/class-hardening-score.php:763
    2849 msgid "Security response headers are sent"
    2850 msgstr ""
    2851 
    2852 #: includes/class-hardening-score.php:765
    2853 msgid "Sent."
    2854 msgstr ""
    2855 
    2856 #: includes/class-hardening-score.php:765
    2857 msgid "Not sent."
     2938msgid "A Content-Security-Policy is enforced"
    28582939msgstr ""
    28592940
    28602941#: includes/class-hardening-score.php:766
    2861 msgid "Without them the browser will sniff content types, render your pages inside somebody else's frame, and leak the full URL of every page as a referrer."
     2942msgid "A policy is the last line that stops an injected script from running at all. Report-only is the correct place to start and it is worth half — it watches, and it blocks nothing."
    28622943msgstr ""
    28632944
    28642945#: includes/class-hardening-score.php:769
    2865 msgid "Turn on \"Send security HTTP headers\" under Hardening."
    2866 msgstr ""
    2867 
    2868 #: includes/class-hardening-score.php:774
    2869 msgid "No Content-Security-Policy header is sent."
     2946msgid "Run report-only until the reports are quiet, then turn report-only off so the policy actually blocks."
    28702947msgstr ""
    28712948
    28722949#: includes/class-hardening-score.php:777
    2873 msgid "Sent in report-only mode, which records violations and blocks nothing."
     2950msgid "Sensitive files are not directly readable"
    28742951msgstr ""
    28752952
    28762953#: includes/class-hardening-score.php:780
    2877 msgid "Sent and enforcing."
    2878 msgstr ""
    2879 
    2880 #: includes/class-hardening-score.php:785
    2881 msgid "A Content-Security-Policy is enforced"
    2882 msgstr ""
    2883 
    2884 #: includes/class-hardening-score.php:788
    2885 msgid "A policy is the last line that stops an injected script from running at all. Report-only is the correct place to start and it is worth half — it watches, and it blocks nothing."
    2886 msgstr ""
    2887 
    2888 #: includes/class-hardening-score.php:791
    2889 msgid "Run report-only until the reports are quiet, then turn report-only off so the policy actually blocks."
     2954#: includes/class-hardening-score.php:822
     2955msgid "This server does not read .htaccess, so GuardForge cannot answer for it here."
     2956msgstr ""
     2957
     2958#: includes/class-hardening-score.php:782
     2959msgid "The deny rules are present in .htaccess."
     2960msgstr ""
     2961
     2962#: includes/class-hardening-score.php:783
     2963msgid "The deny rules are not in .htaccess."
     2964msgstr ""
     2965
     2966#: includes/class-hardening-score.php:784
     2967msgid "A readable wp-config.php or a forgotten debug.log hands over database credentials, salts and query fragments without needing a single exploit."
     2968msgstr ""
     2969
     2970#: includes/class-hardening-score.php:787
     2971msgid "Turn on \"Protect sensitive files\" and make sure .htaccess is writable so the rules can be written."
     2972msgstr ""
     2973
     2974#: includes/class-hardening-score.php:793
     2975msgid "Administrator actions are recorded"
     2976msgstr ""
     2977
     2978#: includes/class-hardening-score.php:795
     2979msgid "Recorded."
     2980msgstr ""
     2981
     2982#: includes/class-hardening-score.php:795
     2983msgid "Not recorded."
     2984msgstr ""
     2985
     2986#: includes/class-hardening-score.php:796
     2987msgid "Without a trail you cannot say which account changed what or when, so an incident ends in guesswork instead of a timeline."
    28902988msgstr ""
    28912989
    28922990#: includes/class-hardening-score.php:799
    2893 msgid "Sensitive files are not directly readable"
    2894 msgstr ""
    2895 
    2896 #: includes/class-hardening-score.php:802
    2897 #: includes/class-hardening-score.php:844
    2898 msgid "This server does not read .htaccess, so GuardForge cannot answer for it here."
    2899 msgstr ""
    2900 
    2901 #: includes/class-hardening-score.php:804
    2902 msgid "The deny rules are present in .htaccess."
    2903 msgstr ""
    2904 
    2905 #: includes/class-hardening-score.php:805
    2906 msgid "The deny rules are not in .htaccess."
    2907 msgstr ""
    2908 
    2909 #: includes/class-hardening-score.php:806
    2910 msgid "A readable wp-config.php or a forgotten debug.log hands over database credentials, salts and query fragments without needing a single exploit."
     2991msgid "Turn on \"Log admin actions\" under Action audit."
     2992msgstr ""
     2993
     2994#: includes/class-hardening-score.php:807
     2995msgid "The WordPress version is not advertised"
    29112996msgstr ""
    29122997
    29132998#: includes/class-hardening-score.php:809
    2914 msgid "Turn on \"Protect sensitive files\" and make sure .htaccess is writable so the rules can be written."
    2915 msgstr ""
    2916 
    2917 #: includes/class-hardening-score.php:815
    2918 msgid "Administrator actions are recorded"
    2919 msgstr ""
    2920 
    2921 #: includes/class-hardening-score.php:817
    2922 msgid "Recorded."
    2923 msgstr ""
    2924 
    2925 #: includes/class-hardening-score.php:817
    2926 msgid "Not recorded."
    2927 msgstr ""
    2928 
    2929 #: includes/class-hardening-score.php:818
    2930 msgid "Without a trail you cannot say which account changed what or when, so an incident ends in guesswork instead of a timeline."
    2931 msgstr ""
    2932 
    2933 #: includes/class-hardening-score.php:821
    2934 msgid "Turn on \"Log admin actions\" under Action audit."
     2999msgid "Hidden."
     3000msgstr ""
     3001
     3002#: includes/class-hardening-score.php:809
     3003msgid "Published in the generator tag and asset URLs."
     3004msgstr ""
     3005
     3006#: includes/class-hardening-score.php:810
     3007msgid "A version in the generator tag turns a scan into a lookup: read it once, and you know which exploits are worth trying."
     3008msgstr ""
     3009
     3010#: includes/class-hardening-score.php:813
     3011msgid "Turn on \"Hide WordPress version\" under Hardening."
     3012msgstr ""
     3013
     3014#: includes/class-hardening-score.php:819
     3015msgid "Directories do not list their contents"
     3016msgstr ""
     3017
     3018#: includes/class-hardening-score.php:824
     3019msgid "Options -Indexes is in place."
     3020msgstr ""
     3021
     3022#: includes/class-hardening-score.php:825
     3023msgid "Options -Indexes is not in place."
     3024msgstr ""
     3025
     3026#: includes/class-hardening-score.php:826
     3027msgid "An open directory index lists the backups, exports and stray archives that nobody ever linked to and everybody forgets about."
    29353028msgstr ""
    29363029
    29373030#: includes/class-hardening-score.php:829
    2938 msgid "The WordPress version is not advertised"
    2939 msgstr ""
    2940 
    2941 #: includes/class-hardening-score.php:831
    2942 msgid "Hidden."
    2943 msgstr ""
    2944 
    2945 #: includes/class-hardening-score.php:831
    2946 msgid "Published in the generator tag and asset URLs."
    2947 msgstr ""
    2948 
    2949 #: includes/class-hardening-score.php:832
    2950 msgid "A version in the generator tag turns a scan into a lookup: read it once, and you know which exploits are worth trying."
     3031msgid "Turn on \"Disable directory listing\" under Files & Directories."
    29513032msgstr ""
    29523033
    29533034#: includes/class-hardening-score.php:835
    2954 msgid "Turn on \"Hide WordPress version\" under Hardening."
     3035msgid "The login form asks a question a script cannot answer"
     3036msgstr ""
     3037
     3038#: includes/class-hardening-score.php:837
     3039#: includes/class-hardening-score.php:851
     3040msgid "On."
     3041msgstr ""
     3042
     3043#: includes/class-hardening-score.php:838
     3044msgid "A trivial arithmetic challenge costs a person two seconds and stops the cheapest credential-stuffing bots outright."
    29553045msgstr ""
    29563046
    29573047#: includes/class-hardening-score.php:841
    2958 msgid "Directories do not list their contents"
    2959 msgstr ""
    2960 
    2961 #: includes/class-hardening-score.php:846
    2962 msgid "Options -Indexes is in place."
    2963 msgstr ""
    2964 
    2965 #: includes/class-hardening-score.php:847
    2966 msgid "Options -Indexes is not in place."
    2967 msgstr ""
    2968 
    2969 #: includes/class-hardening-score.php:848
    2970 msgid "An open directory index lists the backups, exports and stray archives that nobody ever linked to and everybody forgets about."
    2971 msgstr ""
    2972 
    2973 #: includes/class-hardening-score.php:851
    2974 msgid "Turn on \"Disable directory listing\" under Files & Directories."
    2975 msgstr ""
    2976 
    2977 #: includes/class-hardening-score.php:857
    2978 msgid "The login form asks a question a script cannot answer"
    2979 msgstr ""
    2980 
    2981 #: includes/class-hardening-score.php:859
     3048msgid "Turn on \"Math captcha on login\" under Hardening."
     3049msgstr ""
     3050
     3051#: includes/class-hardening-score.php:849
     3052msgid "Pingbacks are switched off"
     3053msgstr ""
     3054
     3055#: includes/class-hardening-score.php:852
     3056msgid "Pingbacks let your site be pointed at somebody else's as a reflector in a denial-of-service, and they advertise that with an X-Pingback header."
     3057msgstr ""
     3058
     3059#: includes/class-hardening-score.php:855
     3060msgid "Turn on \"Disable self-pingbacks\" under API & Protocols."
     3061msgstr ""
     3062
     3063#: includes/class-hardening-score.php:861
     3064msgid "Known scanner User-Agents are blocked"
     3065msgstr ""
     3066
     3067#: includes/class-hardening-score.php:863
     3068msgid "Not blocked."
     3069msgstr ""
     3070
     3071#: includes/class-hardening-score.php:864
     3072msgid "Blocking the default signatures of sqlmap, nikto and wpscan removes the noisy, automated half of hostile traffic before it reaches PHP at all."
     3073msgstr ""
     3074
     3075#: includes/class-hardening-score.php:867
     3076msgid "Turn on \"Block malicious bot User-Agents\" under Spam & Bots."
     3077msgstr ""
     3078
     3079#: includes/class-hardening-score.php:871
     3080msgid "Nothing is set to send an alert, so nothing will be sent."
     3081msgstr ""
     3082
    29823083#: includes/class-hardening-score.php:873
    2983 msgid "On."
    2984 msgstr ""
    2985 
    2986 #: includes/class-hardening-score.php:860
    2987 msgid "A trivial arithmetic challenge costs a person two seconds and stops the cheapest credential-stuffing bots outright."
    2988 msgstr ""
    2989 
    2990 #: includes/class-hardening-score.php:863
    2991 msgid "Turn on \"Math captcha on login\" under Hardening."
    2992 msgstr ""
    2993 
    2994 #: includes/class-hardening-score.php:871
    2995 msgid "Pingbacks are switched off"
    2996 msgstr ""
    2997 
    2998 #: includes/class-hardening-score.php:874
    2999 msgid "Pingbacks let your site be pointed at somebody else's as a reflector in a denial-of-service, and they advertise that with an X-Pingback header."
    3000 msgstr ""
    3001 
    3002 #: includes/class-hardening-score.php:877
    3003 msgid "Turn on \"Disable self-pingbacks\" under API & Protocols."
     3084msgid "Alerts are switched on, but there is no address for them to reach."
     3085msgstr ""
     3086
     3087#: includes/class-hardening-score.php:875
     3088msgid "Alerts are switched on and an address resolves."
     3089msgstr ""
     3090
     3091#: includes/class-hardening-score.php:880
     3092msgid "Someone is told when something happens"
    30043093msgstr ""
    30053094
    30063095#: includes/class-hardening-score.php:883
    3007 msgid "Known scanner User-Agents are blocked"
    3008 msgstr ""
    3009 
    3010 #: includes/class-hardening-score.php:885
    3011 msgid "Not blocked."
     3096msgid "A lockout or an integrity change that nobody is told about is a detection that arrives whenever somebody next happens to open the dashboard."
    30123097msgstr ""
    30133098
    30143099#: includes/class-hardening-score.php:886
    3015 msgid "Blocking the default signatures of sqlmap, nikto and wpscan removes the noisy, automated half of hostile traffic before it reaches PHP at all."
    3016 msgstr ""
    3017 
    3018 #: includes/class-hardening-score.php:889
    3019 msgid "Turn on \"Block malicious bot User-Agents\" under Spam & Bots."
    3020 msgstr ""
    3021 
    3022 #: includes/class-hardening-score.php:893
    3023 msgid "Nothing is set to send an alert, so nothing will be sent."
    3024 msgstr ""
    3025 
    3026 #: includes/class-hardening-score.php:895
    3027 msgid "Alerts are switched on, but there is no address for them to reach."
    3028 msgstr ""
    3029 
    3030 #: includes/class-hardening-score.php:897
    3031 msgid "Alerts are switched on and an address resolves."
    3032 msgstr ""
    3033 
    3034 #: includes/class-hardening-score.php:902
    3035 msgid "Someone is told when something happens"
    3036 msgstr ""
    3037 
    3038 #: includes/class-hardening-score.php:905
    3039 msgid "A lockout or an integrity change that nobody is told about is a detection that arrives whenever somebody next happens to open the dashboard."
    3040 msgstr ""
    3041 
    3042 #: includes/class-hardening-score.php:908
    30433100msgid "Switch on the lockout, integrity and new-administrator alerts, and set the address they should reach."
    30443101msgstr ""
    30453102
    3046 #: includes/class-hardening-score.php:912
     3103#: includes/class-hardening-score.php:890
    30473104msgid "Staging mode is on, so this copy holds every one of these e-mails back. The setting is right; nothing is being sent from here."
    30483105msgstr ""
    30493106
    3050 #: includes/class-hardening.php:88
     3107#: includes/class-hardening.php:97
    30513108msgid "XML-RPC is disabled on this site."
    30523109msgstr ""
    30533110
    3054 #: includes/class-hardening.php:114
     3111#: includes/class-hardening.php:155
     3112msgid "Invalid user ID."
     3113msgstr ""
     3114
     3115#: includes/class-hardening.php:159
     3116msgid "Sorry, you are not allowed to list users."
     3117msgstr ""
     3118
     3119#: includes/class-hardening.php:214
    30553120msgid "REST API is restricted to authenticated users."
    30563121msgstr ""
    30573122
    3058 #: includes/class-hardening.php:163
     3123#: includes/class-hardening.php:319
     3124msgid "Embeds of your posts on other sites"
     3125msgstr ""
     3126
     3127#: includes/class-hardening.php:320
     3128msgid "WooCommerce block cart and checkout (guest orders)"
     3129msgstr ""
     3130
     3131#: includes/class-hardening.php:321
     3132msgid "Contact Form 7 form submissions"
     3133msgstr ""
     3134
     3135#: includes/class-hardening.php:322
     3136msgid "Jetpack connection to WordPress.com"
     3137msgstr ""
     3138
     3139#: includes/class-hardening.php:323
     3140msgid "Form Forge form submissions"
     3141msgstr ""
     3142
     3143#: includes/class-hardening.php:324
     3144msgid "Cascade Forge webhooks from other services"
     3145msgstr ""
     3146
     3147#: includes/class-hardening.php:325
     3148msgid "Inclusive Forge scan results"
     3149msgstr ""
     3150
     3151#: includes/class-hardening.php:366
    30593152msgid "Comments via REST are disabled."
    30603153msgstr ""
    30613154
    30623155#. translators: %1$d and %2$d are random single-digit operands.
    3063 #: includes/class-hardening.php:293
     3156#: includes/class-hardening.php:519
    30643157#, php-format
    30653158msgid "Verification: %1$d + %2$d = ?"
    30663159msgstr ""
    30673160
    3068 #: includes/class-hardening.php:317
     3161#: includes/class-hardening.php:554
    30693162msgid "<strong>Error:</strong> please answer the verification question."
    30703163msgstr ""
    30713164
    3072 #: includes/class-hardening.php:328
     3165#: includes/class-hardening.php:565
    30733166msgid "<strong>Error:</strong> verification expired, please try again."
    30743167msgstr ""
    30753168
    3076 #: includes/class-hardening.php:331
     3169#: includes/class-hardening.php:568
    30773170msgid "<strong>Error:</strong> the verification answer was wrong."
    30783171msgstr ""
    … …  
    32413334
    32423335#: includes/class-two-factor.php:223
     3336#: includes/class-two-factor.php:340
    32433337msgid "<strong>Error:</strong> two-factor code is invalid."
    32443338msgstr ""
  • guardforge/trunk/readme.txt

    r3752344 r3754541  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.6.3
     7Stable tag: 1.6.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    119119Off unless you switch it on. When you do, GuardForge issues a link on your own site that publishes a letter grade and the month it was worked out — nothing else.
    120120
    121 The grade is not your score. It is worked out only from the eleven checks a stranger can already run against your site from outside with no login: the scheme, XML-RPC, whether `?author=1` gives up a login name, whether the REST API answers anonymous callers, the version in your generator tag, your response headers, your Content-Security-Policy header, whether a directory lists its contents, whether sensitive files answer directly, the login form, and the X-Pingback header. Everything on that list is already public, so the badge tells a passer-by nothing they could not have found by loading your site.
     121The grade is not your score. It is worked out only from the eleven checks a stranger can already run against your site from outside with no login: the scheme, XML-RPC, whether `?author=1` gives up a login name, whether the REST API hands your user records to anonymous callers, the version in your generator tag, your response headers, your Content-Security-Policy header, whether a directory lists its contents, whether sensitive files answer directly, the login form, and the X-Pingback header. Everything on that list is already public, so the badge tells a passer-by nothing they could not have found by loading your site.
    122122
    123123Your numeric score, your two-factor coverage, your brute-force thresholds, your integrity results, whether an account is called admin, your pending updates and any vulnerable components are never published, in any form. The link carries an unguessable token so nobody can walk a list of sites looking for weak ones, it can be reissued or turned off at any moment, views are never logged, and until you switch it on the address is not registered at all — your site answers WordPress's own 404, exactly like a site without the plugin.
    … …  
    163163
    164164== Changelog ==
     165
     166= 1.6.4 =
     167* Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before.
     168* The REST API is no longer closed to visitors by default. Until now GuardForge refused every anonymous REST call outside a short list, which stopped the block-based WooCommerce cart and checkout, Contact Form 7, webhooks and other public REST routes for your visitors. The default protection now keeps only user records private (the REST user list and single user records, and the author name and archive link that an embed answer and the users sitemap give out), for visitors and also for customers and subscribers. Sites that already had "Restrict REST API" switched on with the list of exceptions left as it was are moved to this protection by the update. A site that had written its own list of exceptions keeps the whole REST API closed to visitors, with that list: the new separate setting is switched on for it. Either way a notice in the admin, shown once and closable, says what was chosen and where to change it. Refusing every anonymous REST call is now a separate setting, off by default for everybody else; the Settings screen says what it stops (cart, checkout, forms, webhooks) and which active plugins would be affected.
     169* The REST address is read the same way with pretty permalinks (/wp-json/) and with plain ones (?rest_route=), so an allowed route is no longer refused on a site with plain permalinks.
     170* A wrong two-factor code now counts towards the same lockout as a wrong password, so a stolen password cannot be paired with guessed codes without limit. A locked-out address is turned away at the code step too.
     171* The login lockout now holds on every login form: WooCommerce My Account and other forms that use the standard login, and on REST requests with an application password. Failed application-password attempts count as failed logins (one per request), and a locked-out address is refused even with the right password. An administrator who is signed in by cookie behind a server password prompt (htpasswd) is not mistaken for a guess: the block editor keeps working from a locked-out address.
     172* The login captcha is now checked only where it is shown. Logging in through WooCommerce My Account or other forms without the captcha field no longer fails every time.
     173* "Unblock" in the list of lockouts now lifts the block for the address; it used to leave it in place.
    165174
    166175= 1.6.3 =
    … …  
    270279== Upgrade Notice ==
    271280
     281= 1.6.4 =
     282Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before. Anonymous REST access is no longer blocked by default: only user records stay private, so the WooCommerce cart, forms and webhooks work for visitors again.
     283
    272284= 1.6.3 =
    273285Needs GuardForge Pro 1.4.0 or newer if you run the add-on, as before.
Note: See TracChangeset for help on using the changeset viewer.