Repository navigation
Restrict manual Reprint export setup to administrators - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
manage_optionsin the Playground screen scenario, including the manual secret display and all three form actions.Security model and scope
A Reprint export includes the site's database and files. The intended authorization boundary is the administrator role, not the generic
manage_optionscapability. This change closes the manual-page path that let a non-administrator withmanage_optionsset or replace the credential and open the export window.This is not, by itself, a complete confidentiality fix for the current HMAC design. The shared secret is still stored in plaintext in
wp_options, and WordPress's All Settings page can expose ordinary options to users withmanage_options. Such a user may therefore obtain the secret and use it while the export window is open, even though this PR prevents them from opening that window through the manual page.WordPress/reprint#832 is upstream work toward public-key authentication: the source site would hold enrolled public keys while the client retains the private key, so reading the source site's options would not provide signing authority. That PR retains HMAC on hosts without OpenSSL and requires embedders to adopt the new authenticator and key storage. It is not yet integrated here. Key enrollment, replacement, and export activation must remain administrator-only when this plugin adopts that model. This PR establishes the manual-page authorization boundary, but the plaintext-secret exposure remains until the authentication migration is implemented here.
Verification
bin/build.shcomposer lintcomposer lint:php:compatcomposer test:e2e(all nine scenarios)