Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix search XSS #173

Merged
merged 1 commit into from May 8, 2020
Merged

Fix search XSS #173

merged 1 commit into from May 8, 2020

Conversation

defunctl
Copy link
Contributor

@defunctl defunctl commented Feb 5, 2020

Pretty serious XSS after WordPress changed the way LIKE queries work a while back. Tested a few sites with panels enabled and using the default WordPress search.

https://site.com/?s=test('hi')

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '\'hi\')%'))) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_p' at line 1]
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE '%test(\'hi\')%') OR (wp_posts.post_excerpt LIKE '%test(\'hi\')%') OR (wp_posts.post_content LIKE '%test(\'hi\') OR (wp_posts.post_content_filtered LIKE '%test(\'hi\')%'))) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_author = 35 AND wp_posts.post_status = 'private') ORDER BY wp_posts.post_title LIKE '%test(\'hi\')%' DESC, wp_posts.post_date DESC LIMIT 0, 9

Copy link
Contributor

@jbrinley jbrinley left a comment

Choose a reason for hiding this comment

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

Thanks, @defunctl

@defunctl defunctl merged commit 4528d4f into 3.3-branch May 8, 2020
@defunctl defunctl deleted the security/fix-search-xss branch May 8, 2020 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants