You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit db24fa7
Browse filesBrowse the repository at this point in the historyBrowse files
Security: Harden secret names, value parameters and the root key on All Settings.
Three small fixes to the Secrets API:
* `wp_secrets_validate_name()` anchors its segment pattern with `\z`. With `$`, a name with a trailing newline passed, and since option names are trimmed it shared a row with the name without the newline while encrypting for itself.
* Parameters that carry a plaintext value through `wp_set_secret()` and `wp_set_network_secret()` are marked `#[\SensitiveParameter]`, and so are the parameters that carry key material: `$key_material` on `WP_Secrets_Keyring::wrap()` and its implementations, and `$master_key` on the `WP_Secrets_Cipher` methods and `WP_Secrets_Libsodium_Provider::demote_slot()`. An exception thrown while saving does not print the value or a key in a stack trace.
* Settings > All Settings masks `_wp_secrets_root_key` and excludes it from the save, as it already does for connector API keys. Replacing the root key made every stored secret unreadable.
Props aryanjasala, ericmann, dhrupo.
Fixes #66414.
0 commit comments