Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #41925, comment 7


Ignore:
Timestamp:
09/20/2017 03:02:08 PM (8 years ago)
Author:
soulseekah
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #41925, comment 7

    initial v1  
    99
    1010Includes over 20 test cases. Let's write some more.
     11
     12From the time spent writing the patch I understood that the  original vulnerability with %1$s was that it was not quoted and would result in a SQL injection, nothing more, nothing else.
     13
     14So $wpdb->prepare( 'SELECT * FROM wp_posts WHERE post_ID = %1$s', '1 OR 1 = 1' ); would yield
     15
     16SELECT * FROM wp_posts WHERE post_ID = 1 OR 1 = 1; a classic injection.
     17
     18Yes, it's bad. Anyone who used it without quoting it like '%1%s' is vulnerable. A false sense of security was attained by those who did. Let's make things right again. For everyone. For those who wanted numbered placeholders but read that WordPress doesn't support it, for those who found out that it worked and used it in a vulnerable way, and for those who used it in a safe way but can now no longer use it.
     19
     20Let's make wpdb::prepare great again.