close
Skip to content

refactor: validate author selection in post author components#71300

Draft
R1shabh-Gupta wants to merge 1 commit intoWordPress:trunkfrom
R1shabh-Gupta:fix/71299-author-validation
Draft

refactor: validate author selection in post author components#71300
R1shabh-Gupta wants to merge 1 commit intoWordPress:trunkfrom
R1shabh-Gupta:fix/71299-author-validation

Conversation

@R1shabh-Gupta
Copy link
Contributor

@R1shabh-Gupta R1shabh-Gupta commented Aug 21, 2025

What?

Closes #71299

Adds client-side validation to post author selection components to prevent assignment of posts to users without proper authoring capabilities.

Why?

Currently, the Gutenberg editor correctly filters the author dropdown to show only users with authoring capabilities (Administrator, Editor, Contributor). However, there's no validation when the author field is updated programmatically. This allows malicious users to assign posts to Subscribers (who shouldn't be able to author content) by manipulating the dropdown value through browser developer tools, bypassing WordPress role-based security.

How?

  • Added validation in PostAuthorSelect and PostAuthorCombobox components
  • Invalid assignments are silently rejected to maintain user experience

Testing Instructions

Follow the steps provided in the issue description, and in the end, verify that the post author remains unchanged and is not reassigned to the Subscriber.

Screenshots or screencast

Screen.Recording.2025-08-22.at.1.36.09.AM.mov

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Document Settings Document settings experience Needs Decision Needs a decision to be actionable or relevant labels Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Document Settings Document settings experience Needs Decision Needs a decision to be actionable or relevant [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Post author can be assigned to Subscribers via DOM manipulation in editor

2 participants