Make WordPress Core


Ignore:
Timestamp:
02/03/2025 07:50:50 PM (10 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/class-wp-application-passwords.php

    r59084 r59754  
    460460     * @return string The chunked password.
    461461     */
    462     public static function chunk_password( $raw_password ) {
     462    public static function chunk_password(
     463        #[\SensitiveParameter]
     464        $raw_password
     465    ) {
    463466        $raw_password = preg_replace( '/[^a-z\d]/i', '', $raw_password );
    464467
Note: See TracChangeset for help on using the changeset viewer.