Backport: Improve validation and permission checks for WP_HTTP_Polling_Sync_Server#76987
Backport: Improve validation and permission checks for WP_HTTP_Polling_Sync_Server#76987peterwilsoncc merged 2 commits intotrunkfrom
WP_HTTP_Polling_Sync_Server#76987Conversation
…g_Sync_Server Backport of WordPress/wordpress-develop#11296. Hardens WP_HTTP_Polling_Sync_Server endpoints with additional validation and permission checks: - Add MAX_BODY_SIZE, MAX_ROOMS_PER_REQUEST, MAX_UPDATE_DATA_SIZE constants - Add maxLength constraint for update data strings - Add maxItems constraint for rooms per request - Add route-level validate_callback for request body size - Improve can_user_sync_entity_type() to use ctype_digit() for object ID validation, verify post type matches, validate taxonomy terms exist in the correct taxonomy, and reject zero/negative object IDs - Add comprehensive test coverage for new validation and permission checks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 521da9e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23879753130
|
peterwilsoncc
left a comment
There was a problem hiding this comment.
Thanks Chris, this matches the changes in the WordPress-Develop repo.
…ng_Sync_Server` (#76987) * Backport: Improve validation and permission checks for WP_HTTP_Polling_Sync_Server Backport of WordPress/wordpress-develop#11296. Hardens WP_HTTP_Polling_Sync_Server endpoints with additional validation and permission checks: - Add MAX_BODY_SIZE, MAX_ROOMS_PER_REQUEST, MAX_UPDATE_DATA_SIZE constants - Add maxLength constraint for update data strings - Add maxItems constraint for rooms per request - Add route-level validate_callback for request body size - Improve can_user_sync_entity_type() to use ctype_digit() for object ID validation, verify post type matches, validate taxonomy terms exist in the correct taxonomy, and reject zero/negative object IDs - Add comprehensive test coverage for new validation and permission checks * Add backport changelog --------- Co-authored-by: chriszarate <czarate@git.wordpress.org> Co-authored-by: peterwilsoncc <peterwilsoncc@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: cd91928 |
What?
Hardens WP_HTTP_Polling_Sync_Server endpoints with additional validation and permission checks.
Why?
Backport of WordPress/wordpress-develop#11296
How?