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

insecure_wpdb_query_14() defined twice #58

Open
iandunn opened this issue May 26, 2021 · 0 comments
Open

insecure_wpdb_query_14() defined twice #58

iandunn opened this issue May 26, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@iandunn
Copy link
Member

iandunn commented May 26, 2021

function insecure_wpdb_query_14() {
// Cribbed from some real code
global $wpdb;
parse_str( $_REQUEST['order'], $data );
if ( is_array( $data ) ) {
$id_arr = array( );
foreach ( $data as $key => $values ) {
foreach ( $values as $position => $id ) {
$id_arr[] = $id;
}
}
$menu_order_arr = array( );
foreach ( $id_arr as $key => $id ) {
$results = $wpdb->get_results( "SELECT menu_order FROM $wpdb->posts WHERE ID = " . $id ); // unsafe
}
}
}
function insecure_wpdb_query_14() {

Haven't checked if it's causing any tangible problems, but it may cause confusion, etc. DirectDBUnitTest::test_unsafe_code does have an error, which might be related: Undefined array key 9 but it's not immediately obvious because of #50. Probably a low priority.

@iandunn iandunn added the bug Something isn't working label May 26, 2021
@iandunn iandunn added this to the 1: Create Plugin Standard milestone May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant