Make WordPress Core


Ignore:
Timestamp:
02/03/2025 07:50:50 PM (12 months ago)
Author:
johnbillion
Message:

Security: Add the SensitiveParameter attribute to sensitive parameters.

Values passed to parameters with this attribute will be redacted if present in a stack trace when using PHP 8.2 or later. This reduces the chance that passwords and security keys get accidentally exposed in debug logs and bug reports.

Props petitphp, TobiasBg, jrf, johnbillion.

Fixes #57304

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r59357 r59754  
    13111311     * @return string|WP_Error The sanitized password, if valid, otherwise an error.
    13121312     */
    1313     public function check_user_password( $value, $request, $param ) {
     1313    public function check_user_password(
     1314        #[\SensitiveParameter]
     1315        $value,
     1316        $request,
     1317        $param
     1318    ) {
    13141319        $password = (string) $value;
    13151320
Note: See TracChangeset for help on using the changeset viewer.