Skip to content

Restrict manual Reprint export setup to administrators - #8

Merged
fredrikekelund merged 1 commit into
trunkfrom
fix/restrict-manual-export-to-admins
Sep 28, 2026
Merged

fredrikekelund merged 1 commit into
trunkfrom
fix/restrict-manual-export-to-admins

Conversation

@fredrikekelund

@fredrikekelund fredrikekelund commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Require the administrator role to view the manual Reprint screen and submit its credential and exporter forms, matching the existing REST routes for rotating the secret and enabling export.
  • Cover a custom role with manage_options in the Playground screen scenario, including the manual secret display and all three form actions.
  • Update the manual setup access description in the README.

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_options capability. This change closes the manual-page path that let a non-administrator with manage_options set 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 with manage_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.sh
  • composer lint
  • composer lint:php:compat
  • composer test:e2e (all nine scenarios)

@fredrikekelund
fredrikekelund merged commit 3acc5aa into trunk Sep 28, 2026
5 checks passed
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.

1 participant