Skip to content

Add additional nonce & capability checks - #869

Merged
agibson-godaddy merged 4 commits into
release/6.2.5from
DEVX-1263
Oct 30, 2026
Merged

agibson-godaddy merged 4 commits into
release/6.2.5from
DEVX-1263

Conversation

@agibson-godaddy

@agibson-godaddy agibson-godaddy commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds additional nonce and capability checks.

Story: https://godaddy-corp.atlassian.net/browse/DEVX-1263

Release: #868

Before merge

  • I have confirmed these changes in each supported minor WooCommerce version

@agibson-godaddy agibson-godaddy self-assigned this Oct 30, 2026
@agibson-godaddy agibson-godaddy changed the title Devx 1263 Add additional nonce & capability checks Oct 30, 2026
@agibson-godaddy
agibson-godaddy requested a balanced review from Copilot October 30, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two newly introduced methods use snake_case instead of the framework’s newer camelCase convention and need renaming along with updates to their call sites.

2 open issues
What changed in this PR

This PR hardens AJAX operations in the WooCommerce plugin framework by adding nonce validation and capability checks for notice dismissal and job handling.

Changes:

  • Add plugin-specific dismissal nonces, POST requests, input validation, and permission checks for admin notices.
  • Require an overridable capability, defaulting to manage_woocommerce, to process or cancel jobs.
  • Document the security hardening in the 6.2.5 changelog.
File Description
woocommerce/​utilities/​class-sv-wp-job-batch-handler.php Add capability checks to job-processing and cancellation endpoints.
woocommerce/​class-sv-wc-admin-notice-handler.php Validate nonces, permissions, and input for notice dismissal.
woocommerce/​changelog.txt Record the additional nonce and permission checks.

Review effort: Balanced

*
* @return string
*/
protected function get_dismiss_notice_nonce_action() : string {
*
* @return string
*/
protected function get_required_capability() : string {
@agibson-godaddy
agibson-godaddy merged commit 83bbf7c into release/6.2.5 Oct 30, 2026
6 checks passed
@agibson-godaddy
agibson-godaddy deleted the DEVX-1263 branch October 30, 2026 11:12
@agibson-godaddy agibson-godaddy mentioned this pull request Oct 30, 2026
2 tasks done
agibson-godaddy added a commit that referenced this pull request Oct 30, 2026
* Version 6.2.5

* Fix "event is not a function" error on My Payment Methods page (#867)

* Fix event handler syntax error on My Payment Methods page (MWC-20379)

* Update changelog

---------

Co-authored-by: Ashley Gibson <agibson@godaddy.com>

* Add additional nonce & capability checks (#869)

* Add nonce checks to notice dismissal

* Add capaiblity check to batch handling

* Add changelog entry

* Change since version

* Fix false _doing_it_wrong in ScriptHelper::addInlineScript() on WP 6.9+ block editor (#864)

* Update class-sv-wc-admin-notice-handler.php

* Add fallback for wp_print_inline_script_tag function

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Updated Tests

* Code updates to address Ashely's comment

* Update ScriptHelperTest to correct failing tests

* Update namespace

* Customize messaging based on required hook

* Update changelog

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ashley Gibson <agibson@godaddy.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: smoen-godaddy <76167060+smoen-godaddy@users.noreply.github.com>
Co-authored-by: Ashley Gibson <agibson@godaddy.com>
Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants