diff --git a/ext/mysqli/tests/fake_server.inc b/ext/mysqli/tests/fake_server.inc index ff49ae896066..82b20de26590 100644 --- a/ext/mysqli/tests/fake_server.inc +++ b/ext/mysqli/tests/fake_server.inc @@ -1373,8 +1373,6 @@ function my_mysqli_test_stmt_response_row_over_read_status(my_mysqli_fake_server function my_mysqli_test_stmt_response_field_len_faulty(my_mysqli_fake_server_conn $conn): void { - $rh = $conn->packet_generator->server_stmt_execute_items_response(); - $conn->send_server_greetings(); $conn->read(); $conn->send_server_ok(); @@ -1385,8 +1383,6 @@ function my_mysqli_test_stmt_response_field_len_faulty(my_mysqli_fake_server_con $packets[2]->packet_length = '1f0000'; $conn->send($conn->packets_to_bytes($packets), "Stmt prepare items"); $conn->read(); - $conn->send($conn->packets_to_bytes($rh), "Malicious Stmt Response for fields [Extract heap through buffer over-read]"); - $conn->read(65536); } function my_mysqli_test_stmt_response_field_len_premature(my_mysqli_fake_server_conn $conn): void diff --git a/ext/mysqli/tests/ghsa-h35g-vwh6-m678-def.phpt b/ext/mysqli/tests/ghsa-h35g-vwh6-m678-def.phpt index 0883962321d2..dfdd02728ddd 100644 --- a/ext/mysqli/tests/ghsa-h35g-vwh6-m678-def.phpt +++ b/ext/mysqli/tests/ghsa-h35g-vwh6-m678-def.phpt @@ -25,8 +25,6 @@ if ($result) { var_dump(get_object_vars($all_fields[0])["def"]); } -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-2-bytes.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-2-bytes.phpt index 45d33cdf7fc1..cbfbf05ca5bb 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-2-bytes.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-2-bytes.phpt @@ -16,8 +16,6 @@ $process->wait(); $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ); echo "[*] connect_errno: ", $conn->connect_errno, "\n"; -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-8-bytes.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-8-bytes.phpt index 63233ad8291e..e6a976db0a42 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-8-bytes.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-8-bytes.phpt @@ -16,8 +16,6 @@ $process->wait(); $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ); echo "[*] connect_errno: ", $conn->connect_errno, "\n"; -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-null-length.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-null-length.phpt index 6a18f36d37c6..ee3a6a1238f5 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-null-length.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-auth-packet-affected-rows-null-length.phpt @@ -16,8 +16,6 @@ $process->wait(); $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ); echo "[*] connect_errno: ", $conn->connect_errno, "\n"; -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-cached-sha2-switch-unterminated.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-cached-sha2-switch-unterminated.phpt index 2554a46c5a00..316d9fc0d286 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-cached-sha2-switch-unterminated.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-cached-sha2-switch-unterminated.phpt @@ -20,8 +20,6 @@ $process->wait(); $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ); echo "[*] connect_errno: ", $conn->connect_errno, "\n"; -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-query-row-eof-short.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-query-row-eof-short.phpt index 685af9948ba3..b5446d5dea99 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-query-row-eof-short.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-query-row-eof-short.phpt @@ -23,8 +23,6 @@ if ($result->num_rows > 0) { var_dump($row); } } -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-faulty.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-faulty.phpt index 44d61c244149..8ce911893d2f 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-faulty.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-faulty.phpt @@ -18,9 +18,7 @@ $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ) echo "[*] Preparing statement on the fake server...\n"; $conn->prepare("SELECT item FROM items"); -$conn->close(); - -$process->terminate(); +$process->terminate(true); print "done!"; ?> @@ -35,4 +33,6 @@ print "done!"; [*] Sending - Stmt prepare items: 0c0000010001000000010000000000003000000203646566087068705f74657374056974656d73056974656d73046974656dfe6974656d0ce000c8000000fd01100000001f000003fe00000200 Warning: mysqli::prepare(): Protocol error. Server sent NULL_LENGTH. The server is faulty in %s on line %d +[*] Received: 050000001901000000 +[*] Server finished done! diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-premature.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-premature.phpt index 69756273b9a8..9bc0fcc3f719 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-premature.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-field-len-premature.phpt @@ -18,9 +18,7 @@ $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ) echo "[*] Preparing statement on the fake server...\n"; $conn->prepare("SELECT item FROM items"); -$conn->close(); - -$process->terminate(); +$process->terminate(true); print "done!"; ?> @@ -39,4 +37,6 @@ Warning: mysqli::prepare(): Protocol error. Server sent false length. Expected 1 Warning: mysqli::prepare(): Premature end of data (mysqlnd_wireprotocol.c:%d) in %s on line %d Warning: mysqli::prepare(): Result set field packet shorter than expected in %s on line %d +[*] Received: 050000001901000000 +[*] Server finished done! diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-row-status.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-row-status.phpt index 1c71da1cbbc4..4d72e7add5b6 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-row-status.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-response-row-status.phpt @@ -18,8 +18,6 @@ $conn = new mysqli( $servername, $username, $password, "", $process->getPort() ) echo "[*] Preparing statement on the fake server...\n"; $conn->prepare("SELECT item FROM items"); -$conn->close(); - $process->terminate(); print "done!"; diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-date.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-date.phpt index e01dc3ff5c66..ecc92c798014 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-date.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-date.phpt @@ -25,7 +25,7 @@ while ($row = $result->fetch_row()) { $stmt->close(); $conn->close(); -$process->terminate(); +$process->terminate(true); print "done!"; ?> @@ -42,4 +42,6 @@ print "done!"; [*] Sending - Malicious Stmt Response for data datval [length too short]: 01000001023200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f74657374046461746104646174610664617476616c0664617476616c0c3f000a0000000a811000000005000004fe00002200090000050000047465737401de05000006fe00002200 Warning: mysqli_result::fetch_row(): Malformed server packet. Field length is too short for the field type in %s on line %d +[*] Received: 0500000019010000000100000001 +[*] Server finished done! diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-datetime.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-datetime.phpt index 8e86d4039879..797fb9145ee7 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-datetime.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-datetime.phpt @@ -25,7 +25,7 @@ while ($row = $result->fetch_row()) { $stmt->close(); $conn->close(); -$process->terminate(); +$process->terminate(true); print "done!"; ?> @@ -42,4 +42,6 @@ print "done!"; [*] Sending - Malicious Stmt Response for data dtival [length too short]: 01000001023200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f74657374046461746104646174610664746976616c0664746976616c0c3f00130000000c811000000005000004fe00002200090000050000047465737401de05000006fe00002200 Warning: mysqli_result::fetch_row(): Malformed server packet. Field length is too short for the field type in %s on line %d +[*] Received: 0500000019010000000100000001 +[*] Server finished done! diff --git a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-time.phpt b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-time.phpt index 0b9335c42f4e..a1406c7a6824 100644 --- a/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-time.phpt +++ b/ext/mysqli/tests/ghsa-r6x9-5r99-36j7-stmt-row-short-length-time.phpt @@ -25,7 +25,7 @@ while ($row = $result->fetch_row()) { $stmt->close(); $conn->close(); -$process->terminate(); +$process->terminate(true); print "done!"; ?> @@ -42,4 +42,6 @@ print "done!"; [*] Sending - Malicious Stmt Response for data timval [length too short]: 01000001023200000203646566087068705f74657374046461746104646174610673747276616c0673747276616c0ce000c8000000fd01100000003200000303646566087068705f74657374046461746104646174610674696d76616c0674696d76616c0c3f000a0000000b811000000005000004fe00002200090000050000047465737401de05000006fe00002200 Warning: mysqli_result::fetch_row(): Malformed server packet. Field length is too short for the field type in %s on line %d +[*] Received: 0500000019010000000100000001 +[*] Server finished done!