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/ms-functions.php

    r59738 r59754  
    939939 * @return bool
    940940 */
    941 function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $user_email, $key, $meta = array() ) {
     941function wpmu_signup_blog_notification(
     942    $domain,
     943    $path,
     944    $title,
     945    $user_login,
     946    $user_email,
     947    #[\SensitiveParameter]
     948    $key,
     949    $meta = array()
     950) {
    942951    /**
    943952     * Filters whether to bypass the new site email notification.
     
    10741083 * @return bool
    10751084 */
    1076 function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta = array() ) {
     1085function wpmu_signup_user_notification(
     1086    $user_login,
     1087    $user_email,
     1088    #[\SensitiveParameter]
     1089    $key,
     1090    $meta = array()
     1091) {
    10771092    /**
    10781093     * Filters whether to bypass the email notification for new user sign-up.
     
    11761191 * @return array|WP_Error An array containing information about the activated user and/or blog.
    11771192 */
    1178 function wpmu_activate_signup( $key ) {
     1193function wpmu_activate_signup(
     1194    #[\SensitiveParameter]
     1195    $key
     1196) {
    11791197    global $wpdb;
    11801198
     
    13281346 * @return int|false Returns false on failure, or int $user_id on success.
    13291347 */
    1330 function wpmu_create_user( $user_name, $password, $email ) {
     1348function wpmu_create_user(
     1349    $user_name,
     1350    #[\SensitiveParameter]
     1351    $password,
     1352    $email
     1353) {
    13311354    $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    13321355
     
    16121635 * @return bool Whether the email notification was sent.
    16131636 */
    1614 function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) {
     1637function wpmu_welcome_notification(
     1638    $blog_id,
     1639    $user_id,
     1640    #[\SensitiveParameter]
     1641    $password,
     1642    $title,
     1643    $meta = array()
     1644) {
    16151645    $current_network = get_network();
    16161646
     
    18461876 * @return bool
    18471877 */
    1848 function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) {
     1878function wpmu_welcome_user_notification(
     1879    $user_id,
     1880    #[\SensitiveParameter]
     1881    $password,
     1882    $meta = array()
     1883) {
    18491884    $current_network = get_network();
    18501885
     
    22722307 * @param array  $meta     Signup meta data.
    22732308 */
    2274 function add_new_user_to_blog( $user_id, $password, $meta ) {
     2309function add_new_user_to_blog(
     2310    $user_id,
     2311    #[\SensitiveParameter]
     2312    $password,
     2313    $meta
     2314) {
    22752315    if ( ! empty( $meta['add_to_blog'] ) ) {
    22762316        $blog_id = $meta['add_to_blog'];
Note: See TracChangeset for help on using the changeset viewer.