Make WordPress Core

Changeset 65466


Ignore:
Timestamp:
11/13/2026 01:28:17 AM (8 days ago)
Author:
johnbillion
Message:

Security: Mark two more Secrets API parameters as sensitive.

Follow-up to r64337, r65375.

See #66187, #66414.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/secrets/class-wp-secret.php

    r65272 r65466  
    9898         *                                  is not a string. $value may be empty.
    9999         */
    100         public function __construct( string $name, $value, string $fingerprint ) {
     100        public function __construct(
     101                string $name,
     102                #[\SensitiveParameter]
     103                $value,
     104                string $fingerprint
     105        ) {
    101106                if ( '' === $name ) {
    102107                        throw new InvalidArgumentException( 'WP_Secret requires a non-empty name.' );
  • trunk/src/wp-includes/secrets/class-wp-secrets-cipher.php

    r65375 r65466  
    315315         * @phpstan-param WP_Secret_Version::CURRENT|WP_Secret_Version::PREVIOUS $slot
    316316         */
    317         private function validate_common( string $master_key, string $scope, int $site_id, string $name, string $slot ) {
     317        private function validate_common(
     318                #[\SensitiveParameter]
     319                string $master_key,
     320                string $scope,
     321                int $site_id,
     322                string $name,
     323                string $slot
     324        ) {
    318325                if ( ! in_array( $scope, array( 'site', 'network' ), true ) ) {
    319326                        return $this->invalid_argument( __( 'The scope must be "site" or "network".' ) );
  • trunk/tests/phpunit/tests/secrets/wpSetSecretAndWpGetSecret.php

    r65377 r65466  
    417417                        'WP_Secrets_Cipher::decrypt_value() key'       => array( array( WP_Secrets_Cipher::class, 'decrypt_value' ), 'master_key' ),
    418418                        'WP_Secrets_Cipher::fingerprint() key'         => array( array( WP_Secrets_Cipher::class, 'fingerprint' ), 'master_key' ),
     419                        'WP_Secrets_Cipher::validate_common() key'     => array( array( WP_Secrets_Cipher::class, 'validate_common' ), 'master_key' ),
     420                        'WP_Secret::__construct()'                     => array( array( WP_Secret::class, '__construct' ), 'value' ),
    419421                        'WP_Secrets_Keyring::wrap()'                   => array( array( WP_Secrets_Keyring::class, 'wrap' ), 'key_material' ),
    420422                        'WP_Secrets_Config_Key_Provider::wrap()'       => array( array( WP_Secrets_Config_Key_Provider::class, 'wrap' ), 'key_material' ),
Note: See TracChangeset for help on using the changeset viewer.