Skip to content

Secrets API: Reject the translated salt placeholder as key material. - #15148

Closed
t-hamano wants to merge 1 commit into
WordPress:trunkfrom
t-hamano:66187-salt-placeholder
Closed

t-hamano wants to merge 1 commit into
WordPress:trunkfrom
t-hamano:66187-salt-placeholder

Conversation

@t-hamano

@t-hamano t-hamano commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Addresses the following point in comment:27:

As WP_Secrets_Config_Key_Provider::KNOWN_PLACEHOLDER only checks the English value, non English sites may end up with secrets encrypted with a known value. Review wp_salt() for how this is handled for the other constants.

Trac ticket: https://core.trac.wordpress.org/ticket/66187

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Drafting the change, the test, and this description. I reviewed the change.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

🤖 Generated with Claude Code

When WP_SECRETS_KEY is not defined, the default keyring derives its key from LOGGED_IN_KEY and LOGGED_IN_SALT, but it only rejected the English wp-config-sample.php placeholder. A site installed with a localized wp-config-sample.php that still has the translated placeholder had its secrets encrypted with a publicly known value.

The keyring now also rejects the translated placeholder, in the same way as wp_salt().

Follow-up to [64337].

See #66187.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

rejaulalomkhan

This comment was marked as abuse.

@t-hamano
t-hamano marked this pull request as ready for review October 29, 2026 14:34
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props wildworks, rejaulalomkhan, ericmann.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@t-hamano

Copy link
Copy Markdown
Contributor Author

@rejaulalomkhan, thanks for taking the time to review this PR. However, your review reads as if AI simply put the code diff into words. One purpose of a code review is to actually look for flaws in the diff, or to suggest an approach you think would be better. Using AI to assist with reviews is fine, but AI cannot be the sole reviewer. See the AI Guidelines.

@rejaulalomkhan

Copy link
Copy Markdown
Member

Thank you for the candid feedback and guidance, @t-hamano, and my sincere apologies for the noise!

You are completely right — while I ran the test suites locally to verify the pass, my note simply rephrased the diff rather than providing genuine critical evaluation or catching flaws. I take the WordPress AI Guidelines seriously, and I will make sure any future reviews are strictly reserved for when I have concrete technical critique, alternative approaches, or edge-case catches to offer.

Thank you for your leadership and patience!

@ericmann

Copy link
Copy Markdown

Thanks for picking this up so quickly. #15258 now requires WP_SECRETS_KEY and rejects any key equal to one of the keys and salts. An unfilled sample, translated or not, gives them all the same phrase, so that check covers the translated placeholder without __(). With __(), the result changes depending on whether the default textdomain is loaded yet, and on the user's locale. I think this can be closed once #15258 lands. Details are on the ticket.

@t-hamano

t-hamano commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@ericmann Thank you for pointing that out. I think your suggestion is more secure, so let's close this PR.

@t-hamano t-hamano closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants