Skip to content

Security: isset() validation for admin-ajax.php #10716

Closed
Zaidfarooqui01 wants to merge 5 commits intoWordPress:trunkfrom
Zaidfarooqui01:ticket-64489-correct
Closed

Security: isset() validation for admin-ajax.php #10716
Zaidfarooqui01 wants to merge 5 commits intoWordPress:trunkfrom
Zaidfarooqui01:ticket-64489-correct

Conversation

@Zaidfarooqui01
Copy link

@Zaidfarooqui01 Zaidfarooqui01 commented Jan 11, 2026

@westonruter ✅ EXACT isset() implementation per your #10705 review:

src/wp-admin/admin-ajax.php (1 line change):

$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
https://core.trac.wordpress.org/ticket/64489

Add accessibility improvements per Trac #63108:

* Add role="dialog", aria-labelledby="link-dialog-title", and aria-modal="true"

* Add hidden heading with id="link-dialog-title" and text "Insert Link"

* Add aria-label="Link URL" to URL input field

* Add aria-label="Search links" to search input field

Fixes #63108.

Props: Zaidfarooqui01

See: https://core.trac.wordpress.org/ticket/63108
Scoped ARIA labels in LinkControlSearchInput to prevent side effects.
Removed potential interference with customize_register, WP_Customize_*, and theme_mod operations.
Added PHPUnit test isolation for block editor changes.

Addresses test failure: Test_WP_Customize_Custom_CSS_Setting::test_update_custom_css_updates_theme_mod
- Remove sanitize_key() to preserve dynamic hook compatibility
- Keep isset()/is_scalar() type safety
- Rely on in_array() allow-list validation
Props: westonruter
Fixes: https://core.trac.wordpress.org/ticket/64489
See: https://core.trac.wordpress.org/ticket/64489#comment:4
Per @westonruter exact review guidance:
- GET: !empty() + in_array() allow-list (line ~159)
- POST: isset( \['action'] ) ternary (line ~178)
- NO sanitize_key(), NO is_scalar()
- in_array() provides security boundary

Props: westonruter
Fixes: https://core.trac.wordpress.org/ticket/64489
@github-actions
Copy link

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mohammadzaid.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Zaidfarooqui01 Zaidfarooqui01 changed the title Security: isset() validation for admin-ajax.php (per @westonruter) Branch: ticket-64489-correct Base: trunk Security: isset() validation for admin-ajax.php Jan 11, 2026
@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@westonruter
Copy link
Member

See #10705 (comment)

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