Opened 21 months ago
Last modified 16 months ago
#62477 new defect (bug)
Do not use $_POST['action'] in the sanitize function.
| Reported by: | nikitasolanki1812 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | coding-standards |
Description
wp-admin\includes\ajax-actions.php
Attachments (1)
Change History (4)
This ticket was mentioned in PR #7839 on WordPress/wordpress-develop by @im3dabasia1.
21 months ago
#1
#2
@
21 months ago
I have added an improved version of the previous patch. I hope this works well.
- Fixed missing sanitization in other areas.
- Eliminated redundant isset checks for the same variable.
- Removed unnecessary variable casting for $post_category as it is already handled in the condition.
PluginVulnerabilities commented on PR #7839:
16 months ago
#3
It looks like sanitize_key() might be the more appropriate sanitization function instead of sanitize_text_field(). That is what is already used in similar code in the file.
Another function in the file, wp_ajax_add_tag(), looks like it still needs sanitization added.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/62477
### Description:
Sanitize $_POSTaction in _wp_ajax_add_hierarchical_term to enhance security.