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-admin/includes/class-wp-importer.php

    r56396 r59754  
    196196     * @return array
    197197     */
    198     public function get_page( $url, $username = '', $password = '', $head = false ) {
     198    public function get_page(
     199        $url,
     200        $username = '',
     201        #[\SensitiveParameter]
     202        $password = '',
     203        $head = false
     204    ) {
    199205        // Increase the timeout.
    200206        add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );
Note: See TracChangeset for help on using the changeset viewer.