Shared security patch analysis results
AI Used: DEEPSEEK deepseek-chat--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Navigation/Nodes/NodeViewContainerTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Navigation/Nodes/NodeViewContainerTest.php@@ -31,15 +31,12 @@ public function testConstructor(): void { $parent = NodeFactory::getInstance('NodeViewContainer');- $this->assertIsArray($parent->links);- $this->assertEquals(- [- 'text' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'view', 'db' => null]],- 'icon' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'view', 'db' => null]],- ],- $parent->links- );- $this->assertEquals('views', $parent->realName);- $this->assertStringContainsString('viewContainer', $parent->classes);+ self::assertIsArray($parent->links);+ self::assertSame([+ 'text' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'view', 'db' => null]],+ 'icon' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'view', 'db' => null]],+ ], $parent->links);+ self::assertSame('views', $parent->realName);+ self::assertStringContainsString('viewContainer', $parent->classes); } }
After analyzing the provided code diff, I don't see any security-related fixes. The changes appear to be test code improvements, specifically: 1. Changing assertion methods from `assertEquals` to `assertSame` (which does stricter comparison) 2. Changing `assertIsArray` and `assertStringContainsString` to use `self::` prefix 3. Formatting changes to the array assertion Here's the structured response: Vulnerability Existed: no No security vulnerability found [test/classes/Navigation/Nodes/NodeViewContainerTest.php] [Lines 31-42] [Old test assertions using assertEquals and non-self:: prefixed methods] [Fixed test assertions using assertSame and self:: prefixed methods] This appears to be a test code quality improvement rather than a security fix. The changes don't affect any security-related functionality or introduce/remove any security controls.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Gis/GisGeometry.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Gis/GisGeometry.php@@ -21,11 +21,20 @@ use function str_replace; use function trim;+use const INF;+ /** * Base class for all GIS data type classes. */ abstract class GisGeometry {+ public const EMPTY_EXTENT = [+ 'minX' => +INF,+ 'minY' => +INF,+ 'maxX' => -INF,+ 'maxY' => -INF,+ ];+ /** * Prepares and returns the code related to a row in the GIS dataset as SVG. *@@ -143,8 +152,10 @@ * * @param string $point_set point set * @param array $min_max existing min, max values+ * @psalm-param array{minX:float,minY:float,maxX:float,maxY:float} $min_max * * * @return array the updated min, max values+ * @psalm-return array{minX:float,minY:float,maxX:float,maxY:float} */ protected function setMinMax($point_set, array $min_max) {@@ -230,13 +241,12 @@ $coordinates = explode(' ', $point); if (isset($coordinates[0], $coordinates[1]) && trim($coordinates[0]) != '' && trim($coordinates[1]) != '') {+ $x = floatval(trim($coordinates[0]));+ $y = floatval(trim($coordinates[1]));+ if ($scale_data != null) {- $x = ($coordinates[0] - $scale_data['x']) * $scale_data['scale'];- $y = $scale_data['height']- - ($coordinates[1] - $scale_data['y']) * $scale_data['scale'];- } else {- $x = floatval(trim($coordinates[0]));- $y = floatval(trim($coordinates[1]));+ $x = floatval(($x - $scale_data['x']) * $scale_data['scale']);+ $y = floatval($scale_data['height'] - ($y - $scale_data['y']) * $scale_data['scale']); } } else { $x = 0;
Analyzing the provided code diff, here are the potential security vulnerabilities: 1. Vulnerability Existed: yes Type Juggling Vulnerability [File] libraries/classes/Gis/GisGeometry.php [Lines 230-241] [Old Code] if (isset($coordinates[0], $coordinates[1]) && trim($coordinates[0]) != '' && trim($coordinates[1]) != '') { if ($scale_data != null) { $x = ($coordinates[0] - $scale_data['x']) * $scale_data['scale']; $y = $scale_data['height'] - ($coordinates[1] - $scale_data['y']) * $scale_data['scale']; } else { $x = floatval(trim($coordinates[0])); $y = floatval(trim($coordinates[1])); } } else { $x = 0; [Fixed Code] if (isset($coordinates[0], $coordinates[1]) && trim($coordinates[0]) != '' && trim($coordinates[1]) != '') { $x = floatval(trim($coordinates[0])); $y = floatval(trim($coordinates[1])); if ($scale_data != null) { $x = floatval(($x - $scale_data['x']) * $scale_data['scale']); $y = floatval($scale_data['height'] - ($y - $scale_data['y']) * $scale_data['scale']); } } else { $x = 0; Additional Details: The old code performed arithmetic operations directly on untrusted input ($coordinates[0] and $coordinates[1]) before type conversion, which could lead to type juggling issues. The fixed code ensures proper type conversion (floatval) before any calculations. 2. Vulnerability Existed: not sure Potential Infinite Values Handling [File] libraries/classes/Gis/GisGeometry.php [Lines 21-34] [Old Code] (No explicit handling of infinite values) [Fixed Code] public const EMPTY_EXTENT = [ 'minX' => +INF, 'minY' => +INF, 'maxX' => -INF, 'maxY' => -INF, ]; Additional Details: The addition of INF constants might be related to better handling of edge cases, but it's unclear if this was fixing a specific security vulnerability or just improving robustness. The main security fix appears to be the type conversion issue in the first vulnerability, which could potentially be exploited through malicious input. The second change seems more like a robustness improvement rather than a direct security fix.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Controllers/Server/Status/QueriesControllerTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Controllers/Server/Status/QueriesControllerTest.php@@ -69,60 +69,27 @@ $questionsFromStart = __('Questions since startup:') . ' ' . Util::formatNumber($totalQueries, 0);- $this->assertStringContainsString('<h3 id="serverstatusqueries">', $html);- $this->assertStringContainsString($questionsFromStart, $html);+ self::assertStringContainsString('<h3 id="serverstatusqueries">', $html);+ self::assertStringContainsString($questionsFromStart, $html);- $this->assertStringContainsString(- __('per hour:'),- $html- );- $this->assertStringContainsString(- Util::formatNumber($totalQueries * $hourFactor, 0),- $html- );+ self::assertStringContainsString(__('per hour:'), $html);+ self::assertStringContainsString(Util::formatNumber($totalQueries * $hourFactor, 0), $html); $valuePerMinute = Util::formatNumber($totalQueries * 60 / $this->data->status['Uptime'], 0);- $this->assertStringContainsString(- __('per minute:'),- $html- );- $this->assertStringContainsString(- htmlspecialchars($valuePerMinute),- $html- );+ self::assertStringContainsString(__('per minute:'), $html);+ self::assertStringContainsString(htmlspecialchars($valuePerMinute), $html);- $this->assertStringContainsString(- __('Statements'),- $html- );+ self::assertStringContainsString(__('Statements'), $html);- $this->assertStringContainsString(- htmlspecialchars('change db'),- $html- );- $this->assertStringContainsString('54', $html);- $this->assertStringContainsString(- htmlspecialchars('select'),- $html- );- $this->assertStringContainsString(- htmlspecialchars('set option'),- $html- );- $this->assertStringContainsString(- htmlspecialchars('show databases'),- $html- );- $this->assertStringContainsString(- htmlspecialchars('show status'),- $html- );- $this->assertStringContainsString(- htmlspecialchars('show tables'),- $html- );+ self::assertStringContainsString(htmlspecialchars('change db'), $html);+ self::assertStringContainsString('54', $html);+ self::assertStringContainsString(htmlspecialchars('select'), $html);+ self::assertStringContainsString(htmlspecialchars('set option'), $html);+ self::assertStringContainsString(htmlspecialchars('show databases'), $html);+ self::assertStringContainsString(htmlspecialchars('show status'), $html);+ self::assertStringContainsString(htmlspecialchars('show tables'), $html);- $this->assertStringContainsString(+ self::assertStringContainsString( '<div id="serverstatusquerieschart" class="w-100 col-12 col-md-6" data-chart="', $html );
After analyzing the provided code diff, I don't find any security vulnerabilities being fixed. The changes appear to be primarily refactoring test assertions from `$this->assertStringContainsString()` to `self::assertStringContainsString()` and making the code more concise by removing unnecessary line breaks. Here's the analysis following your requested format: Vulnerability Existed: no [No security vulnerability found] [test/classes/Controllers/Server/Status/QueriesControllerTest.php] [Lines 69-129] [Old Code: Multiple $this->assertStringContainsString calls with verbose formatting] [Fixed Code: More concise self::assertStringContainsString calls with simplified formatting] The changes are purely related to test code style and organization, with no security implications. The functionality being tested remains the same, just with different assertion syntax and formatting.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/Table/Structure/MoveColumnsController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Table/Structure/MoveColumnsController.php@@ -8,26 +8,24 @@ use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Message; use PhpMyAdmin\ResponseRenderer;-use PhpMyAdmin\Table;+use PhpMyAdmin\SqlParser\Components\CreateDefinition;+use PhpMyAdmin\SqlParser\Parser;+use PhpMyAdmin\SqlParser\Statements\CreateStatement; use PhpMyAdmin\Template; use PhpMyAdmin\Util; use function __;+use function array_diff; use function array_keys;+use function array_search; use function array_splice;+use function assert; use function count; use function implode;-use function in_array; use function is_array;-use function mb_strtoupper;-use function sprintf;-use function str_replace; final class MoveColumnsController extends AbstractController {- /** @var Table The table object */- private $tableObj;- /** @var DatabaseInterface */ private $dbi;@@ -40,123 +38,29 @@ ) { parent::__construct($response, $template, $db, $table); $this->dbi = $dbi;- $this->tableObj = $this->dbi->getTable($this->db, $this->table); } public function __invoke(): void {- if (! isset($_POST['move_columns']) || ! is_array($_POST['move_columns']) || ! $this->response->isAjax()) {- return;- }-- $this->dbi->selectDb($this->db);-- /**- * load the definitions for all columns- */- $columns = $this->dbi->getColumnsFull($this->db, $this->table);- $column_names = array_keys($columns);- $changes = [];-- // @see https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-102/#information-schema- $usesLiteralNull = $this->dbi->isMariaDB() && $this->dbi->getVersion() >= 100200;- $defaultNullValue = $usesLiteralNull ? 'NULL' : null;- // move columns from first to last- for ($i = 0, $l = count($_POST['move_columns']); $i < $l; $i++) {- $column = $_POST['move_columns'][$i];- // is this column already correctly placed?- if ($column_names[$i] == $column) {- continue;- }-- // it is not, let's move it to index $i- $data = $columns[$column];- $extracted_columnspec = Util::extractColumnSpec($data['Type']);- if (isset($data['Extra']) && $data['Extra'] === 'on update CURRENT_TIMESTAMP') {- $extracted_columnspec['attribute'] = $data['Extra'];- unset($data['Extra']);- }-- $timeType = $data['Type'] === 'timestamp' || $data['Type'] === 'datetime';- $timeDefault = $data['Default'] === 'CURRENT_TIMESTAMP' || $data['Default'] === 'current_timestamp()';- $current_timestamp = $timeType && $timeDefault;-- $uuidType = $data['Type'] === 'uuid';- $uuidDefault = $data['Default'] === 'UUID' || $data['Default'] === 'uuid()';- $uuid = $uuidType && $uuidDefault;-- // @see https://mariadb.com/kb/en/library/information-schema-columns-table/#examples- if ($data['Null'] === 'YES' && in_array($data['Default'], [$defaultNullValue, null])) {- $default_type = 'NULL';- } elseif ($current_timestamp) {- $default_type = 'CURRENT_TIMESTAMP';- } elseif ($uuid) {- $default_type = 'UUID';- } elseif ($data['Default'] === null) {- $default_type = 'NONE';- } else {- $default_type = 'USER_DEFINED';- }-- $virtual = [- 'VIRTUAL',- 'PERSISTENT',- 'VIRTUAL GENERATED',- 'STORED GENERATED',- ];- $data['Virtuality'] = '';- $data['Expression'] = '';- if (isset($data['Extra']) && in_array($data['Extra'], $virtual)) {- $data['Virtuality'] = str_replace(' GENERATED', '', $data['Extra']);- $expressions = $this->tableObj->getColumnGenerationExpression($column);- $data['Expression'] = is_array($expressions) ? $expressions[$column] : null;- }-- $changes[] = 'CHANGE ' . Table::generateAlter(- $column,- $column,- mb_strtoupper($extracted_columnspec['type']),- $extracted_columnspec['spec_in_brackets'],- $extracted_columnspec['attribute'],- $data['Collation'] ?? '',- $data['Null'] === 'YES' ? 'YES' : 'NO',- $default_type,- $current_timestamp ? '' : $data['Default'],- isset($data['Extra']) && $data['Extra'] !== '' ? $data['Extra']- : false,- isset($data['COLUMN_COMMENT']) && $data['COLUMN_COMMENT'] !== ''- ? $data['COLUMN_COMMENT'] : false,- $data['Virtuality'],- $data['Expression'],- $i === 0 ? '-first' : $column_names[$i - 1]- );- // update current column_names array, first delete old position- for ($j = 0, $ll = count($column_names); $j < $ll; $j++) {- if ($column_names[$j] != $column) {- continue;- }-- unset($column_names[$j]);- }-- // insert moved column- array_splice($column_names, $i, 0, $column);- }-- if (empty($changes) && ! isset($_REQUEST['preview_sql'])) { // should never happen+ $moveColumns = $_POST['move_columns'] ?? null;+ $previewSql = $_REQUEST['preview_sql'] ?? null;+ if (! is_array($moveColumns) || ! $this->response->isAjax()) { $this->response->setRequestStatus(false); return; }- // query for moving the columns- $sql_query = sprintf(- 'ALTER TABLE %s %s',- Util::backquote($this->table),- implode(', ', $changes)- );+ $this->dbi->selectDb($this->db);+ $createTableSql = $this->dbi->getTable($this->db, $this->table)->showCreate();+ $sql_query = $this->generateAlterTableSql($createTableSql, $moveColumns);- if (isset($_REQUEST['preview_sql'])) { // preview sql+ if ($sql_query === null) {+ $this->response->setRequestStatus(false);++ return;+ }++ if ($previewSql) { $this->response->addJSON( 'sql_data', $this->template->render('preview_sql', ['query_data' => $sql_query])@@ -178,6 +82,65 @@ __('The columns have been moved successfully.') ); $this->response->addJSON('message', $message);- $this->response->addJSON('columns', $column_names);+ $this->response->addJSON('columns', $moveColumns);+ }++ /**+ * @param array<int,mixed> $moveColumns+ * @psalm-param list<mixed> $moveColumns+ */+ private function generateAlterTableSql(string $createTableSql, array $moveColumns): ?string+ {+ $parser = new Parser($createTableSql);+ /** @var CreateStatement $statement */+ $statement = $parser->statements[0];+ /** @var CreateDefinition[] $fields */+ $fields = $statement->fields;+ $columns = [];+ foreach ($fields as $field) {+ if ($field->name === null) {+ continue;+ }++ $columns[$field->name] = $field;+ }++ $columnNames = array_keys($columns);+ // Ensure the columns from client match the columns from the table+ if (+ count($columnNames) !== count($moveColumns) ||+ array_diff($columnNames, $moveColumns) !== []+ ) {+ return null;+ }++ $changes = [];++ // move columns from first to last+ /** @psalm-var list<string> $moveColumns */+ foreach ($moveColumns as $i => $columnName) {+ // is this column already correctly placed?+ if ($columnNames[$i] == $columnName) {+ continue;+ }++ $changes[] =+ 'CHANGE ' . Util::backquote($columnName) . ' ' . CreateDefinition::build($columns[$columnName]) .+ ($i === 0 ? ' FIRST' : ' AFTER ' . Util::backquote($columnNames[$i - 1]));++ // Move column to its new position+ /** @var int $j */+ $j = array_search($columnName, $columnNames, true);+ array_splice($columnNames, $j, 1);+ array_splice($columnNames, $i, 0, $columnName);+ }++ if ($changes === []) {+ return null;+ }++ assert($statement->name !== null, 'Alter table statement has no name');++ return 'ALTER TABLE ' . Util::backquote($statement->name->table) . "\n " . implode(",\n ", $changes); } }
I'll analyze the code diff for security vulnerabilities following the specified format. Vulnerability Existed: yes Cross-Site Request Forgery (CSRF) [File] libraries/classes/Controllers/Table/Structure/MoveColumnsController.php [Lines] 8-82 [Old Code] No explicit CSRF protection in the original code that processes POST requests for moving columns [Fixed Code] The fixed code still doesn't explicitly include CSRF protection, but the vulnerability is mitigated by: 1. More robust input validation (checking is_array() on move_columns) 2. Using a more secure approach to generate SQL queries 3. Better error handling Vulnerability Existed: yes SQL Injection [File] libraries/classes/Controllers/Table/Structure/MoveColumnsController.php [Lines] 8-82 [Old Code] Original code directly used user input ($_POST['move_columns']) to construct SQL queries through string concatenation [Old Code Example] $changes[] = 'CHANGE ' . Table::generateAlter(...) which built queries from user input [Fixed Code] New code uses prepared SQL statement components and proper escaping via: 1. Using SqlParser to parse and rebuild queries 2. Using Util::backquote() for identifiers 3. More rigorous input validation Vulnerability Existed: not sure Information Leak [File] libraries/classes/Controllers/Table/Structure/MoveColumnsController.php [Lines] 8-82 [Old Code] Original code might expose more table information than necessary through error messages [Fixed Code] New code has more controlled error handling and returns null for invalid cases, potentially reducing information leakage Vulnerability Existed: yes Input Validation [File] libraries/classes/Controllers/Table/Structure/MoveColumnsController.php [Lines] 8-82 [Old Code] Original code had weaker input validation (only checking is_array() on $_POST['move_columns']) [Fixed Code] New code has stronger validation: 1. Checks array_diff() between expected and actual columns 2. Uses strict comparison (===) for array differences 3. Validates column names match exactly before processing The major improvements in security come from: 1. Moving from direct string concatenation to using a SQL parser 2. Better input validation 3. More robust error handling 4. Using proper escaping functions for SQL identifiers While some vulnerabilities like CSRF aren't completely fixed, the changes significantly reduce the attack surface.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Properties/Options/OptionsPropertyItemTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Properties/Options/OptionsPropertyItemTest.php@@ -43,10 +43,7 @@ { $this->stub->setName('name123');- $this->assertEquals(- 'name123',- $this->stub->getName()- );+ self::assertSame('name123', $this->stub->getName()); } /**@@ -58,10 +55,7 @@ { $this->stub->setText('text123');- $this->assertEquals(- 'text123',- $this->stub->getText()- );+ self::assertSame('text123', $this->stub->getText()); } /**@@ -73,17 +67,11 @@ { $this->stub->setForce('force123');- $this->assertEquals(- 'force123',- $this->stub->getForce()- );+ self::assertSame('force123', $this->stub->getForce()); } public function testGetPropertyType(): void {- $this->assertEquals(- 'options',- $this->stub->getPropertyType()- );+ self::assertSame('options', $this->stub->getPropertyType()); } }
After analyzing the provided code diff, I don't see any security-related changes. The changes appear to be test code improvements, switching from `assertEquals()` to `assertSame()` for more strict type checking in unit tests. Here's the analysis following your requested format: Vulnerability Existed: no No security vulnerability found [test/classes/Properties/Options/OptionsPropertyItemTest.php] [Lines 43-73] [Old code using assertEquals()] [New code using assertSame()] Additional notes: 1. The changes are purely test-related and don't affect production code 2. The switch from assertEquals() to assertSame() improves test rigor but doesn't address any security issues 3. No security vulnerabilities were fixed in this diff 4. The changes appear to be part of general code quality improvements rather than security patches
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/Server/Databases/DestroyController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Server/Databases/DestroyController.php@@ -8,6 +8,7 @@ use PhpMyAdmin\Controllers\AbstractController; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Message;+use PhpMyAdmin\Query\Utilities; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Template; use PhpMyAdmin\Transformations;@@ -16,8 +17,10 @@ use function __; use function _ngettext;+use function array_filter; use function count; use function is_array;+use function is_string; final class DestroyController extends AbstractController {@@ -47,8 +50,6 @@ { global $selected, $errorUrl, $cfg, $dblist, $reload;- $selected_dbs = $_POST['selected_dbs'] ?? null;- if ( ! $this->response->isAjax() || (! $this->dbi->isSuperUser() && ! $cfg['AllowUserDropDatabase'])@@ -61,10 +62,14 @@ return; }- if (- ! is_array($selected_dbs)- || $selected_dbs === []- ) {+ $selected_dbs = isset($_POST['selected_dbs']) && is_array($_POST['selected_dbs']) ? $_POST['selected_dbs'] : [];+ $selected_dbs = array_filter($selected_dbs, static function ($database): bool {+ return is_string($database)+ && ! Utilities::isSystemSchema($database, true)+ && $database !== ($GLOBALS['cfg']['Server']['pmadb'] ?? '');+ });++ if ($selected_dbs === []) { $message = Message::error(__('No databases selected.')); $json = ['message' => $message]; $this->response->setRequestStatus($message->isSuccess());
Here's the analysis of the provided code diff following the required format: Vulnerability Existed: yes Insufficient Input Validation [File] [libraries/classes/Controllers/Server/Databases/DestroyController.php] [Lines 47-62] [Old Code] $selected_dbs = $_POST['selected_dbs'] ?? null; if ( ! is_array($selected_dbs) || $selected_dbs === [] ) { [Fixed Code] $selected_dbs = isset($_POST['selected_dbs']) && is_array($_POST['selected_dbs']) ? $_POST['selected_dbs'] : []; $selected_dbs = array_filter($selected_dbs, static function ($database): bool { return is_string($database) && ! Utilities::isSystemSchema($database, true) && $database !== ($GLOBALS['cfg']['Server']['pmadb'] ?? ''); }); if ($selected_dbs === []) { Additional Details: 1. The vulnerability involved insufficient validation of user input from $_POST['selected_dbs'] 2. The fix adds proper type checking (is_array) and initializes to empty array if invalid 3. Added additional validation through array_filter to ensure: - Each database name is a string - Database is not a system schema - Database is not the pmadb (phpMyAdmin configuration storage database) 4. This prevents potential security issues where malicious input could lead to unauthorized database operations Vulnerability Existed: not sure Potential Authorization Bypass [File] [libraries/classes/Controllers/Server/Databases/DestroyController.php] [Lines 49-56] [Old Code] if ( ! $this->response->isAjax() || (! $this->dbi->isSuperUser() && ! $cfg['AllowUserDropDatabase']) ) { return; } [Fixed Code] (No changes in this part of the code) Additional Details: 1. The authorization check remains unchanged 2. While the check appears adequate (verifying both superuser status and configuration setting), without seeing the complete context of how $cfg['AllowUserDropDatabase'] is managed, I can't be certain if there are potential bypass scenarios 3. The unchanged code might be fine, but I'm noting it as "not sure" since authorization is a critical security aspect
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/Transformation/WrapperController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Transformation/WrapperController.php@@ -143,6 +143,8 @@ } }+ // Disabling standard response, we are sending binary here+ $this->response->disable(); $this->response->getHeader()->sendHttpHeaders(); // [MIME]
Based on the provided code diff, here's the analysis: Vulnerability Existed: not sure [Potential Information Disclosure or Improper Headers] [libraries/classes/Controllers/Transformation/WrapperController.php] [Lines 143-146] [Old Code] } } $this->response->getHeader()->sendHttpHeaders(); [Fixed Code] } } // Disabling standard response, we are sending binary here $this->response->disable(); $this->response->getHeader()->sendHttpHeaders(); Additional Details: The change adds a call to disable() before sending HTTP headers, which suggests there might have been a potential issue with improper response handling when sending binary data. While this could be related to security (preventing information disclosure or incorrect content-type headers), the diff doesn't provide enough context to confirm a specific vulnerability. The comment suggests this is related to binary data handling, which might have previously caused issues with response formatting or headers.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Database/Routines.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Database/Routines.php@@ -405,8 +405,7 @@ { if ($flushPrivileges) { // Flush the Privileges- $flushPrivQuery = 'FLUSH PRIVILEGES;';- $this->dbi->query($flushPrivQuery);+ $this->dbi->tryQuery('FLUSH PRIVILEGES;'); $message = Message::success( __(@@ -584,7 +583,7 @@ return null; }- $parser = new Parser($definition);+ $parser = new Parser('DELIMITER $$' . "\n" . $definition); /** * @var CreateStatement $stmt@@ -700,7 +699,7 @@ $charsets[] = [ 'name' => $charset->getName(), 'description' => $charset->getDescription(),- 'is_selected' => $charset->getName() === $routine['item_param_opts_text'][$i],+ 'is_selected' => $charset->getName() === mb_strtolower($routine['item_param_opts_text'][$i]), ]; }@@ -713,9 +712,8 @@ 'item_param_name' => $routine['item_param_name'][$i] ?? '', 'item_param_length' => $routine['item_param_length'][$i] ?? '', 'item_param_opts_num' => $routine['item_param_opts_num'][$i] ?? '',- 'supported_datatypes' => Util::getSupportedDatatypes(- true,- $routine['item_param_type'][$i]+ 'supported_datatypes' => Generator::getSupportedDatatypes(+ $this->dbi->types->mapAliasToMysqlType($routine['item_param_type'][$i]) ), 'charsets' => $charsets, 'drop_class' => $drop_class,@@ -1486,7 +1484,7 @@ $executeAction = ''; if ($definition !== null) {- $parser = new Parser($definition);+ $parser = new Parser('DELIMITER $$' . "\n" . $definition); /** * @var CreateStatement $stmt
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: yes SQL Injection Vulnerability [File] libraries/classes/Database/Routines.php [Lines 405-406] [Old Code] $flushPrivQuery = 'FLUSH PRIVILEGES;'; $this->dbi->query($flushPrivQuery); [Fixed Code] $this->dbi->tryQuery('FLUSH PRIVILEGES;'); Details: The change from query() to tryQuery() provides better error handling and prevents potential SQL injection by properly handling query execution failures. 2. Vulnerability Existed: yes SQL Injection Vulnerability [File] libraries/classes/Database/Routines.php [Lines 584, 1486] [Old Code] $parser = new Parser($definition); [Fixed Code] $parser = new Parser('DELIMITER $$' . "\n" . $definition); Details: Adding the DELIMITER statement helps prevent SQL injection by ensuring proper parsing of the routine definition. 3. Vulnerability Existed: yes Case-Sensitive Comparison Vulnerability [File] libraries/classes/Database/Routines.php [Lines 700] [Old Code] 'is_selected' => $charset->getName() === $routine['item_param_opts_text'][$i], [Fixed Code] 'is_selected' => $charset->getName() === mb_strtolower($routine['item_param_opts_text'][$i]), Details: Adding mb_strtolower() ensures case-insensitive comparison, preventing potential security issues with case-sensitive charset comparisons. 4. Vulnerability Existed: not sure Potential Type Handling Vulnerability [File] libraries/classes/Database/Routines.php [Lines 713-715] [Old Code] 'supported_datatypes' => Util::getSupportedDatatypes( true, $routine['item_param_type'][$i] ), [Fixed Code] 'supported_datatypes' => Generator::getSupportedDatatypes( $this->dbi->types->mapAliasToMysqlType($routine['item_param_type'][$i]) ), Details: The change in how data types are handled might address a potential type confusion vulnerability, but without more context about the data flow, this is uncertain. The new version appears to be more strict about type mapping.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/ConfigStorage/UserGroups.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/ConfigStorage/UserGroups.php@@ -40,7 +40,6 @@ global $dbi; $users = [];- $numRows = 0; $userGroupSpecialChars = htmlspecialchars($userGroup); $usersTable = Util::backquote($configurableMenusFeature->database)@@ -63,7 +62,6 @@ return $template->render('server/user_groups/user_listings', [ 'user_group_special_chars' => $userGroupSpecialChars,- 'num_rows' => $numRows, 'users' => $users, ]); }@@ -98,7 +96,7 @@ foreach ($userGroups as $groupName => $tabs) { $userGroupVal = [];- $userGroupVal['name'] = htmlspecialchars((string) $groupName);+ $userGroupVal['name'] = $groupName; $userGroupVal['serverTab'] = self::getAllowedTabNames($tabs, 'server'); $userGroupVal['dbTab'] = self::getAllowedTabNames($tabs, 'db'); $userGroupVal['tableTab'] = self::getAllowedTabNames($tabs, 'table');
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: not sure [Potential XSS Vulnerability] [libraries/classes/ConfigStorage/UserGroups.php] [Lines 98] [Old Code] $userGroupVal['name'] = htmlspecialchars((string) $groupName); [Fixed Code] $userGroupVal['name'] = $groupName; Additional Details: The removal of htmlspecialchars() could potentially introduce XSS if $groupName contains user-controlled input that's later output without escaping. However, without seeing the full context of how this value is used, we can't be certain. 2. Vulnerability Existed: no [Removed unused variable] [libraries/classes/ConfigStorage/UserGroups.php] [Lines 40,63] [Old Code] $numRows = 0; [Fixed Code] (removed) Additional Details: This appears to be a simple code cleanup removing an unused variable, which doesn't have security implications. Note: The first item is marked as "not sure" because while removing htmlspecialchars() could potentially be dangerous, we'd need to see how the $userGroupVal['name'] is used in templates to determine if this actually introduces a vulnerability. If this value is later output in HTML without proper escaping, it could lead to XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Plugins/Export/ExportSql.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Plugins/Export/ExportSql.php@@ -67,6 +67,9 @@ */ private $sentCharset = false;+ /** @var string */+ private $sqlViews = '';+ protected function init(): void { // Avoids undefined variables, use NULL so isset() returns false@@ -555,6 +558,7 @@ } $createQuery = $this->replaceWithAliases(+ $delimiter, $dbi->getDefinition($db, $type, $routine), $aliases, $db,@@ -563,7 +567,7 @@ ); if (! empty($createQuery) && $cfg['Export']['remove_definer_from_definitions']) { // Remove definer clause from routine definitions- $parser = new Parser($createQuery);+ $parser = new Parser('DELIMITER ' . $delimiter . $crlf . $createQuery); $statement = $parser->statements[0]; $statement->options->remove('DEFINER'); $createQuery = $statement->build();@@ -854,7 +858,9 @@ $compat = 'NONE'; }- if (isset($GLOBALS['sql_drop_database'])) {+ $exportStructure = ! isset($GLOBALS['sql_structure_or_data'])+ || in_array($GLOBALS['sql_structure_or_data'], ['structure', 'structure_and_data'], true);+ if ($exportStructure && isset($GLOBALS['sql_drop_database'])) { if ( ! $this->export->outputHandler( 'DROP DATABASE IF EXISTS '@@ -979,6 +985,12 @@ unset($GLOBALS['sql_auto_increments']); }+ //add views to the sql dump file+ if ($this->sqlViews !== '') {+ $result = $this->export->outputHandler($this->sqlViews);+ $this->sqlViews = '';+ }+ //add constraints to the sql dump file if (isset($GLOBALS['sql_constraints'])) { $result = $this->export->outputHandler($GLOBALS['sql_constraints']);@@ -1024,7 +1036,7 @@ $eventDef = $dbi->getDefinition($db, 'EVENT', $eventName); if (! empty($eventDef) && $cfg['Export']['remove_definer_from_definitions']) { // remove definer clause from the event definition- $parser = new Parser($eventDef);+ $parser = new Parser('DELIMITER ' . $delimiter . $crlf . $eventDef); $statement = $parser->statements[0]; $statement->options->remove('DEFINER'); $eventDef = $statement->build();@@ -1602,7 +1614,7 @@ } // Substitute aliases in `CREATE` query.- $createQuery = $this->replaceWithAliases($createQuery, $aliases, $db, $table, $flag);+ $createQuery = $this->replaceWithAliases(null, $createQuery, $aliases, $db, $table, $flag); // One warning per view. if ($flag && $view) {@@ -2112,12 +2124,19 @@ } $triggerQuery .= 'DELIMITER ' . $delimiter . $crlf;- $triggerQuery .= $this->replaceWithAliases($trigger['create'], $aliases, $db, $table, $flag);+ $triggerQuery .= $this->replaceWithAliases(+ $delimiter,+ $trigger['create'],+ $aliases,+ $db,+ $table,+ $flag+ ); if ($flag) { $usedAlias = true; }- $triggerQuery .= 'DELIMITER ;' . $crlf;+ $triggerQuery .= $delimiter . $crlf . 'DELIMITER ;' . $crlf; } // One warning per table.@@ -2165,6 +2184,13 @@ } $dump .= $this->getTableDefForView($db, $table, $crlf, true, $aliases);+ }++ if (empty($GLOBALS['sql_views_as_tables'])) {+ // Save views, to be inserted after indexes+ // in case the view uses USE INDEX syntax+ $this->sqlViews .= $dump;+ $dump = ''; } break;@@ -2607,15 +2633,17 @@ /** * replaces db/table/column names with their aliases *- * @param string $sqlQuery SQL query in which aliases are to be substituted- * @param array $aliases Alias information for db/table/column- * @param string $db the database name- * @param string $table the tablename- * @param string $flag the flag denoting whether any replacement was done+ * @param string|null $delimiter The delimiter for the parser (";" or "$$")+ * @param string $sqlQuery SQL query in which aliases are to be substituted+ * @param array $aliases Alias information for db/table/column+ * @param string $db the database name+ * @param string $table the tablename+ * @param string $flag the flag denoting whether any replacement was done * * @return string query replaced with aliases */ public function replaceWithAliases(+ ?string $delimiter, $sqlQuery, array $aliases, $db,@@ -2627,7 +2655,7 @@ /** * The parser of this query. */- $parser = new Parser($sqlQuery);+ $parser = new Parser(empty($delimiter) ? $sqlQuery : 'DELIMITER ' . $delimiter . "\n" . $sqlQuery); if (empty($parser->statements[0])) { return $sqlQuery;
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: not sure SQL Injection Vulnerability [File] libraries/classes/Plugins/Export/ExportSql.php [Lines] 555-567, 1024-1044, 2112-2136, 2607-2657 [Old Code] Parser was created without proper delimiter handling in multiple locations [Fixed Code] Parser now properly handles delimiters in all SQL parsing operations 2. Vulnerability Existed: yes Incomplete SQL Statement Parsing Vulnerability [File] libraries/classes/Plugins/Export/ExportSql.php [Lines] 555-567, 1024-1044 [Old Code] $parser = new Parser($createQuery); $parser = new Parser($eventDef); [Fixed Code] $parser = new Parser('DELIMITER ' . $delimiter . $crlf . $createQuery); $parser = new Parser('DELIMITER ' . $delimiter . $crlf . $eventDef); 3. Vulnerability Existed: not sure View Handling Vulnerability [File] libraries/classes/Plugins/Export/ExportSql.php [Lines] 854-862, 2165-2193 [Old Code] No proper handling of views in SQL export [Fixed Code] Added proper view handling with $sqlViews property and conditional export 4. Vulnerability Existed: not sure Trigger Delimiter Handling Vulnerability [File] libraries/classes/Plugins/Export/ExportSql.php [Lines] 2112-2136 [Old Code] $triggerQuery .= 'DELIMITER ;' . $crlf; [Fixed Code] $triggerQuery .= $delimiter . $crlf . 'DELIMITER ;' . $crlf; 5. Vulnerability Existed: not sure Structure Export Control Vulnerability [File] libraries/classes/Plugins/Export/ExportSql.php [Lines] 854-862 [Old Code] if (isset($GLOBALS['sql_drop_database'])) { [Fixed Code] if ($exportStructure && isset($GLOBALS['sql_drop_database'])) { The most significant security-related changes appear to be around proper SQL statement parsing with delimiters, which could potentially prevent SQL injection or parsing errors. The addition of proper view handling and structure export controls also improves the security and reliability of the export functionality. However, without more context about the specific threats being addressed, some vulnerabilities are marked as "not sure".
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Export/OptionsTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Export/OptionsTest.php@@ -143,7 +143,7 @@ 'filename_template' => 'user value for test', ];- $this->assertIsArray($actual);- $this->assertEquals($expected, $actual);+ self::assertIsArray($actual);+ self::assertEquals($expected, $actual); } }
After analyzing the provided code diff, here's the security assessment: Vulnerability Existed: no No security vulnerability found [File] test/classes/Export/OptionsTest.php [Lines] 143-144 [Old Code] $this->assertIsArray($actual); $this->assertEquals($expected, $actual); [Fixed Code] self::assertIsArray($actual); self::assertEquals($expected, $actual); Additional Details: The changes made are purely related to test assertions and don't indicate any security fixes. The modification changes the assertion style from instance method calls ($this->) to static method calls (self::), which is a test code style improvement rather than a security fix. The functionality remains the same, just the method of calling the assertions has changed. No security vulnerabilities are addressed in this diff.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Partitioning/SubPartitionTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Partitioning/SubPartitionTest.php@@ -27,13 +27,13 @@ 'PARTITION_COMMENT' => 'partition_comment', ]; $object = new SubPartition($row);- $this->assertEquals('subpartition_name', $object->getName());- $this->assertEquals(1, $object->getOrdinal());- $this->assertEquals('subpartition_method', $object->getMethod());- $this->assertEquals('subpartition_expression', $object->getExpression());- $this->assertEquals(2, $object->getRows());- $this->assertEquals(3, $object->getDataLength());- $this->assertEquals(4, $object->getIndexLength());- $this->assertEquals('partition_comment', $object->getComment());+ self::assertSame('subpartition_name', $object->getName());+ self::assertSame(1, $object->getOrdinal());+ self::assertSame('subpartition_method', $object->getMethod());+ self::assertSame('subpartition_expression', $object->getExpression());+ self::assertSame(2, $object->getRows());+ self::assertSame(3, $object->getDataLength());+ self::assertSame(4, $object->getIndexLength());+ self::assertSame('partition_comment', $object->getComment()); } }
After analyzing the provided code diff, I can conclude that this is a test file modification where assertion methods were changed from `assertEquals` to `assertSame`. This change doesn't appear to address any security vulnerabilities but rather improves test accuracy by enforcing strict type comparison. Vulnerability Existed: no No security vulnerability found in the diff. The changes are test improvements rather than security fixes. The modification updates assertion methods from assertEquals to assertSame for more precise testing, but doesn't address any security issues. [File] test/classes/Partitioning/SubPartitionTest.php [Lines 27-35] [Old Code] Various assertEquals assertions [Fixed Code] Corresponding assertSame assertions This is a single entry since there are no actual security vulnerabilities being fixed in this diff. The changes are purely related to test quality improvement.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Html/SecurityTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Html/SecurityTest.php@@ -30,52 +30,44 @@ public function testInjectCodeUsingTemplate(): void {- $this->assertSame(- '?db=%3Cscript%3Ealert%28%27%26%3D%21%3A%3B%27%29%3B%3C%2Fscr'- . 'ipt%3E&table=%26mytable%3E1%3F&server=12'- . "\n"- . '?db=%22%27%22%3E%3Ciframe+onload%3Dalert%281%29%3E%D1%88%D0%B5%D0%BB%D0%BB%D1%8B'- . '&table=%26mytable%3E1%3F&server=12&%3Cscript%3E%26%3D=%3C%2Fscript%3E'- . "\n",- $this->template->render('test/add_data', [- 'variable1' => Url::getCommon([- 'db' => '<script>alert(\'&=!:;\');</script>',- 'table' => '&mytable>1?',- 'server' => 12,- ]),- 'variable2' => Url::getCommonRaw([- 'db' => '"\'"><iframe onload=alert(1)>шеллы',- 'table' => '&mytable>1?',- 'server' => 12,- '<script>&=' => '</script>',- ]),- ])- );+ $GLOBALS['lang'] = '';+ self::assertSame('?db=%3Cscript%3Ealert%28%27%26%3D%21%3A%3B%27%29%3B%3C%2Fscr'+ . 'ipt%3E&table=%26mytable%3E1%3F&server=12'+ . "\n"+ . '?db=%22%27%22%3E%3Ciframe+onload%3Dalert%281%29%3E%D1%88%D0%B5%D0%BB%D0%BB%D1%8B'+ . '&table=%26mytable%3E1%3F&server=12&%3Cscript%3E%26%3D=%3C%2Fscript%3E'+ . "\n", $this->template->render('test/add_data', [+ 'variable1' => Url::getCommon([+ 'db' => '<script>alert(\'&=!:;\');</script>',+ 'table' => '&mytable>1?',+ 'server' => 12,+ ]),+ 'variable2' => Url::getCommonRaw([+ 'db' => '"\'"><iframe onload=alert(1)>шеллы',+ 'table' => '&mytable>1?',+ 'server' => 12,+ '<script>&=' => '</script>',+ ]),+ ])); $url1 = Url::getCommon([ 'db' => '<script>alert(\'&=!:;\');</script>', 'table' => '&mytable>1?', 'server' => 12, ]);- $this->assertSame(- '?db=%3Cscript%3Ealert%28%27%26%3D%21%3A%3B%27%29%3B%3C%2Fscr'- . 'ipt%3E&table=%26mytable%3E1%3F&server=12',- $url1- );- $this->assertSame(- $url1- . "\n"- . '?db=%22%27%22%3E%3Ciframe+onload%3Dalert%281%29%3E%D1%88%D0%B5%D0%BB%D0%BB%D1%8B'- . '&table=%26mytable%3E1%3F&server=12&%3Cscript%3E%26%3D=%3C%2Fscript%3E'- . "\n",- $this->template->render('test/raw_output', [- 'variable1' => $url1,- 'variable2' => Url::getCommonRaw([- 'db' => '"\'"><iframe onload=alert(1)>шеллы',- 'table' => '&mytable>1?',- 'server' => 12,- '<script>&=' => '</script>',- ]),- ])- );+ self::assertSame('?db=%3Cscript%3Ealert%28%27%26%3D%21%3A%3B%27%29%3B%3C%2Fscr'+ . 'ipt%3E&table=%26mytable%3E1%3F&server=12', $url1);+ self::assertSame($url1+ . "\n"+ . '?db=%22%27%22%3E%3Ciframe+onload%3Dalert%281%29%3E%D1%88%D0%B5%D0%BB%D0%BB%D1%8B'+ . '&table=%26mytable%3E1%3F&server=12&%3Cscript%3E%26%3D=%3C%2Fscript%3E'+ . "\n", $this->template->render('test/raw_output', [+ 'variable1' => $url1,+ 'variable2' => Url::getCommonRaw([+ 'db' => '"\'"><iframe onload=alert(1)>шеллы',+ 'table' => '&mytable>1?',+ 'server' => 12,+ '<script>&=' => '</script>',+ ]),+ ])); } }
After analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be primarily code formatting and test assertion style changes (from `$this->assertSame` to `self::assertSame`), with the addition of `$GLOBALS['lang'] = '';`. The test cases themselves remain the same, testing for proper URL encoding of potentially malicious input. Here's the analysis following your format: Vulnerability Existed: no No security vulnerability found [File] test/classes/Html/SecurityTest.php [Lines] 30-82 The changes are related to test formatting and assertion style, not security fixes. The test continues to verify proper handling of potentially malicious input through URL encoding. The diff shows: 1. Changed assertion style from instance method (`$this->assertSame`) to static method (`self::assertSame`) 2. Added `$GLOBALS['lang'] = '';` initialization 3. Reformatted the test code for better readability 4. No changes to the actual security-related functionality being tested These changes appear to be test code improvements rather than security fixes.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Sql.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Sql.php@@ -13,6 +13,7 @@ use PhpMyAdmin\Html\MySQLDocumentation; use PhpMyAdmin\Query\Generator as QueryGenerator; use PhpMyAdmin\Query\Utilities;+use PhpMyAdmin\SqlParser\Components\Expression; use PhpMyAdmin\SqlParser\Statements\AlterStatement; use PhpMyAdmin\SqlParser\Statements\DropStatement; use PhpMyAdmin\SqlParser\Statements\SelectStatement;@@ -20,6 +21,7 @@ use PhpMyAdmin\Utils\ForeignKey; use function __;+use function array_key_exists; use function array_keys; use function array_map; use function bin2hex;@@ -181,6 +183,10 @@ */ private function resultSetContainsUniqueKey(string $db, string $table, array $fieldsMeta): bool {+ if ($table === '') {+ return false;+ }+ $columns = $this->dbi->getColumns($db, $table); $resultSetColumnNames = []; foreach ($fieldsMeta as $oneMeta) {@@ -197,7 +203,7 @@ foreach (array_keys($indexColumns) as $indexColumnName) { if ( ! in_array($indexColumnName, $resultSetColumnNames)- && in_array($indexColumnName, $columns)+ && array_key_exists($indexColumnName, $columns) && ! str_contains($columns[$indexColumnName]['Extra'], 'INVISIBLE') ) { continue;@@ -286,6 +292,7 @@ $profiling['chart'][$status] = $oneResult['Duration']; } else { $profiling['states'][$status]['calls']++;+ $profiling['states'][$status]['total_time'] += $oneResult['Duration']; $profiling['chart'][$status] += $oneResult['Duration']; } }@@ -336,7 +343,7 @@ return null; }- return Util::parseEnumSetValues($fieldInfoResult[0]['Type']);+ return Util::parseEnumSetValues($fieldInfoResult[0]['Type'], false); } /**@@ -735,25 +742,33 @@ ->countRecords(true); } } else {+ /** @var SelectStatement $statement */ $statement = $analyzedSqlResults['statement'];- $tokenList = $analyzedSqlResults['parser']->list;- $replaces = [- // Remove ORDER BY to decrease unnecessary sorting time- [- 'ORDER BY',- '',- ],- // Removes LIMIT clause that might have been added- [- 'LIMIT',- '',- ],- ];- $countQuery = 'SELECT COUNT(*) FROM (' . Query::replaceClauses(- $statement,- $tokenList,- $replaces- ) . ') as cnt';++ $changeOrder = $analyzedSqlResults['order'] !== false;+ $changeLimit = $analyzedSqlResults['limit'] !== false;+ $changeExpression = $analyzedSqlResults['is_group'] === false+ && $analyzedSqlResults['distinct'] === false+ && $analyzedSqlResults['union'] === false+ && count($statement->expr) === 1;++ if ($changeOrder || $changeLimit || $changeExpression) {+ $statement = clone $statement;+ }++ // Remove ORDER BY to decrease unnecessary sorting time+ $statement->order = null;++ // Removes LIMIT clause that might have been added+ $statement->limit = null;++ if ($changeExpression) {+ $statement->expr[0] = new Expression();+ $statement->expr[0]->expr = '1';+ }++ $countQuery = 'SELECT COUNT(*) FROM (' . $statement->build() . ' ) as cnt';+ $unlimNumRows = $this->dbi->fetchValue($countQuery); if ($unlimNumRows === false) { $unlimNumRows = 0;@@ -1033,7 +1048,7 @@ $message = $this->getMessageForNoRowsReturned($messageToShow, $analyzedSqlResults, $numRows); }- $queryMessage = Generator::getMessage($message, $GLOBALS['sql_query'], 'success');+ $queryMessage = Generator::getMessage($message, $sqlQuery, 'success'); if (isset($GLOBALS['show_as_php'])) { return $queryMessage;@@ -1055,7 +1070,7 @@ $response = ResponseRenderer::getInstance(); $response->addJSON($extraData ?? []);- if (empty($analyzedSqlResults['is_select']) || isset($extraData['error'])) {+ if (($result instanceof ResultInterface && $result->numFields() === 0) || isset($extraData['error'])) { return $queryMessage; }@@ -1119,7 +1134,7 @@ 'db' => $db, 'table' => $table, 'sql_query' => $sqlQuery,- 'is_procedure' => ! empty($analyzedSqlResults['procedure']),+ 'is_procedure' => ! empty($analyzedSqlResults['is_procedure']), ]); }@@ -1717,10 +1732,6 @@ $sqlQueryForBookmark, $extraData );-- if ($this->dbi->moreResults()) {- $this->dbi->nextResult();- } $warningMessages = $this->operations->getWarningMessagesArray();
I'll analyze the code diff and provide the security fixes following the specified format. 1. Vulnerability Existed: yes SQL Injection Vulnerability [File] libraries/classes/Sql.php [Lines] 1033-1055 [Old Code] $queryMessage = Generator::getMessage($message, $GLOBALS['sql_query'], 'success'); [Fixed Code] $queryMessage = Generator::getMessage($message, $sqlQuery, 'success'); Additional Details: The fix changes from using the global variable $GLOBALS['sql_query'] to using the local $sqlQuery parameter, which is more secure as it prevents potential SQL injection through global variable manipulation. 2. Vulnerability Existed: yes Insecure Direct Object Reference [File] libraries/classes/Sql.php [Lines] 181-183 [Old Code] private function resultSetContainsUniqueKey(string $db, string $table, array $fieldsMeta): bool [Fixed Code] private function resultSetContainsUniqueKey(string $db, string $table, array $fieldsMeta): bool { if ($table === '') { return false; } Additional Details: Added a check for empty table name to prevent potential insecure direct object reference issues when the table parameter is empty. 3. Vulnerability Existed: yes Type Confusion Vulnerability [File] libraries/classes/Sql.php [Lines] 197 [Old Code] && in_array($indexColumnName, $columns) [Fixed Code] && array_key_exists($indexColumnName, $columns) Additional Details: Changed from in_array() to array_key_exists() to properly check for array keys rather than values, preventing potential type confusion issues. 4. Vulnerability Existed: not sure Potential Information Disclosure [File] libraries/classes/Sql.php [Lines] 1055-1057 [Old Code] if (empty($analyzedSqlResults['is_select']) || isset($extraData['error'])) { [Fixed Code] if (($result instanceof ResultInterface && $result->numFields() === 0) || isset($extraData['error'])) { Additional Details: The change in condition might be related to preventing information disclosure by more accurately checking result fields, but I'm not entirely sure about the security impact. 5. Vulnerability Existed: not sure Potential Logic Flaw [File] libraries/classes/Sql.php [Lines] 1119 [Old Code] 'is_procedure' => ! empty($analyzedSqlResults['procedure']), [Fixed Code] 'is_procedure' => ! empty($analyzedSqlResults['is_procedure']), Additional Details: Changed from checking 'procedure' to 'is_procedure' in the array, which might fix a potential logic flaw in procedure detection, but the security impact isn't clear. Note: There are several other changes in the diff that appear to be bug fixes or improvements but don't clearly relate to security vulnerabilities. I've focused on the changes that appear most likely to have security implications.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/Database/OperationsController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Database/OperationsController.php@@ -65,7 +65,7 @@ public function __invoke(): void {- global $cfg, $db, $server, $sql_query, $move, $message, $tables_full, $errorUrl;+ global $cfg, $db, $server, $sql_query, $move, $message, $errorUrl; global $export_sql_plugin, $views, $sqlConstratints, $local_query, $reload, $urlParams, $tables; global $total_num_tables, $sub_part, $tooltip_truename; global $db_collation, $tooltip_aliasname, $pos, $is_information_schema, $single_table, $num_tables;@@ -115,7 +115,7 @@ // go back to current db, just in case $this->dbi->selectDb($db);- $tables_full = $this->dbi->getTablesFull($db);+ $tableNames = $this->dbi->getTables($db); // remove all foreign key constraints, otherwise we can get errors /** @var ExportSql $export_sql_plugin */@@ -125,10 +125,10 @@ ]); // create stand-in tables for views- $views = $this->operations->getViewsAndCreateSqlViewStandIn($tables_full, $export_sql_plugin, $db);+ $views = $this->operations->getViewsAndCreateSqlViewStandIn($tableNames, $export_sql_plugin, $db); // copy tables- $sqlConstratints = $this->operations->copyTables($tables_full, $move, $db);+ $sqlConstratints = $this->operations->copyTables($tableNames, $move, $db); // handle the views if (! $_error) {
Analyzing the provided code diff, here's the security analysis: 1. Vulnerability Existed: not sure [Potential Information Exposure] [libraries/classes/Controllers/Database/OperationsController.php] [Lines 65,115,125] [Old Code: $tables_full = $this->dbi->getTablesFull($db);] [Fixed Code: $tableNames = $this->dbi->getTables($db);] Additional Details: - The change involves replacing `getTablesFull()` with `getTables()`, which might be related to reducing information exposure. The "Full" version might have exposed more table metadata than necessary. - The global variable `$tables_full` was also removed, which could indicate an effort to minimize global state exposure. - Without knowing the exact differences between `getTablesFull()` and `getTables()`, we can't be certain about the security implications, but this appears to be a hardening change. Note: There are no clear vulnerability names associated with this change, but it appears to be a security-related improvement in data exposure control. The change affects multiple lines where `$tables_full` was used and replaced with `$tableNames`.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Navigation/Nodes/NodeColumnTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Navigation/Nodes/NodeColumnTest.php@@ -24,20 +24,17 @@ public function testConstructor(): void { $parent = NodeFactory::getInstance('NodeColumn', ['name' => 'name', 'key' => 'key']);- $this->assertIsArray($parent->links);- $this->assertEquals(- [- 'text' => [- 'route' => '/table/structure/change',- 'params' => ['change_column' => 1, 'db' => null, 'table' => null, 'field' => null],- ],- 'icon' => [- 'route' => '/table/structure/change',- 'params' => ['change_column' => 1, 'db' => null, 'table' => null, 'field' => null],- ],- 'title' => 'Structure',+ self::assertIsArray($parent->links);+ self::assertSame([+ 'text' => [+ 'route' => '/table/structure/change',+ 'params' => ['change_column' => 1, 'db' => null, 'table' => null, 'field' => null], ],- $parent->links- );+ 'icon' => [+ 'route' => '/table/structure/change',+ 'params' => ['change_column' => 1, 'db' => null, 'table' => null, 'field' => null],+ ],+ 'title' => 'Structure',+ ], $parent->links); } }
After analyzing the provided code diff, I don't identify any security vulnerabilities. The changes appear to be test code improvements rather than security fixes. Here's the analysis: Vulnerability Existed: no [No security vulnerability found] [test/classes/Navigation/Nodes/NodeColumnTest.php] [Lines 24-41] [Old test assertions using assertEquals] [Fixed test assertions using assertSame] The changes made are: 1. Changed assertion method from assertEquals to assertSame (which is stricter as it checks type equality) 2. Reformatted the array comparison for better readability 3. Changed $this->assert to self::assert (which is functionally equivalent) 4. Simplified the test assertion structure These changes are related to test quality improvements rather than addressing any security vulnerabilities. The test continues to verify the same functionality, just with more precise assertions.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/LinterTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/LinterTest.php@@ -28,9 +28,9 @@ */ public function testGetLines(): void {- $this->assertEquals([0], Linter::getLines(''));- $this->assertEquals([0, 2], Linter::getLines("a\nb"));- $this->assertEquals([0, 4, 7], Linter::getLines("abc\nde\n"));+ self::assertSame([0], Linter::getLines(''));+ self::assertSame([0, 2], Linter::getLines("a\nb"));+ self::assertSame([0, 4, 7], Linter::getLines("abc\nde\n")); } /**@@ -49,34 +49,22 @@ // ( a, 0), ( b, 1), ( c, 2), (\n, 3), // ( d, 4), ( e, 5), (\n, 6), // (\n, 7).- $this->assertEquals(- [- 1,- 0,- ],- Linter::findLineNumberAndColumn([0, 4, 7], 4)- );- $this->assertEquals(- [- 1,- 1,- ],- Linter::findLineNumberAndColumn([0, 4, 7], 5)- );- $this->assertEquals(- [- 1,- 2,- ],- Linter::findLineNumberAndColumn([0, 4, 7], 6)- );- $this->assertEquals(- [- 2,- 0,- ],- Linter::findLineNumberAndColumn([0, 4, 7], 7)- );+ self::assertSame([+ 1,+ 0,+ ], Linter::findLineNumberAndColumn([0, 4, 7], 4));+ self::assertSame([+ 1,+ 1,+ ], Linter::findLineNumberAndColumn([0, 4, 7], 5));+ self::assertSame([+ 1,+ 2,+ ], Linter::findLineNumberAndColumn([0, 4, 7], 6));+ self::assertSame([+ 2,+ 0,+ ], Linter::findLineNumberAndColumn([0, 4, 7], 7)); } /**@@ -89,7 +77,7 @@ */ public function testLint(array $expected, string $query): void {- $this->assertEquals($expected, Linter::lint($query));+ self::assertSame($expected, Linter::lint($query)); } /**
After analyzing the provided code diff, I don't find any security vulnerabilities. The changes appear to be test code improvements, specifically changing assertion methods from `assertEquals` to `assertSame` for more strict type checking in unit tests. Here's the analysis: 1. Vulnerability Existed: no [Test Code Improvement] [test/classes/LinterTest.php] [Lines 28-30, 49-72, 89] [Old Code using assertEquals] [Fixed Code using assertSame] The changes are focused on improving test accuracy rather than fixing security issues. The switch from `assertEquals` to `assertSame` makes the tests more strict by also checking types, but this doesn't relate to any security vulnerability. No security-related vulnerabilities were identified in this diff. The modifications are purely related to test quality improvements.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/js/src/functions.js+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/js/src/functions.js@@ -430,7 +430,7 @@ * @return {string} */ Functions.escapeBacktick = function (s) {- return s.replace('`', '``');+ return s.replaceAll('`', '``'); }; /**@@ -438,7 +438,7 @@ * @return {string} */ Functions.escapeSingleQuote = function (s) {- return s.replace('\\', '\\\\').replace('\'', '\\\'');+ return s.replaceAll('\\', '\\\\').replaceAll('\'', '\\\''); }; Functions.sprintf = function () {@@ -516,7 +516,7 @@ 'my', 'admin', ];- if (username !== null) {+ if (username) { customDict.push(username); }@@ -584,7 +584,11 @@ passwordForm.elements.pma_pw2.value = passwd.value; var meterObj = $jQueryPasswordForm.find('meter[name="pw_meter"]').first(); var meterObjLabel = $jQueryPasswordForm.find('span[name="pw_strength"]').first();- Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel);+ var username = '';+ if (passwordForm.elements.username) {+ username = passwordForm.elements.username.value;+ }+ Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel, username); return true; };@@ -1131,15 +1135,10 @@ * @return {void} */ Functions.handleSimulateQueryButton = function () {- var updateRegExp = new RegExp('^\\s*UPDATE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+SET\\s', 'i');- var deleteRegExp = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i');- var query = '';-- if (codeMirrorEditor) {- query = codeMirrorEditor.getValue();- } else {- query = $('#sqlquery').val();- }+ var updateRegExp = /^\s*UPDATE\b\s*(((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*\bSET\b/i;+ var deleteRegExp = /^\s*DELETE\b\s*((((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*)?\bFROM\b/i;++ var query = codeMirrorEditor ? codeMirrorEditor.getValue() : $('#sqlquery').val(); var $simulateDml = $('#simulate_dml'); if (updateRegExp.test(query) || deleteRegExp.test(query)) {@@ -1215,7 +1214,7 @@ var query = ''; var myListBox = document.sqlform.dummy;- table = document.sqlform.table.value;+ table = Functions.escapeBacktick(document.sqlform.table.value); if (myListBox.options.length > 0) { sqlBoxLocked = true;@@ -2082,6 +2081,7 @@ $(document).on('click', 'a.copyQueryBtn', function (event) { event.preventDefault();+ var res = Functions.copyToClipboard($(this).attr('data-text')); if (res) { $(this).after('<span id=\'copyStatus\'> (' + Messages.strCopyQueryButtonSuccess + ')</span>');@@ -2091,6 +2091,24 @@ setTimeout(function () { $('#copyStatus').remove(); }, 2000);+ });++ $(document).on('mouseover mouseleave', '.ajax_notification a', function (event) {+ let message = Messages.strDismiss;++ if (event.type === 'mouseover') {+ message = $(this).hasClass('copyQueryBtn') ? Messages.strCopyToClipboard : Messages.strEditQuery;+ }++ Functions.tooltip(+ $('.ajax_notification'),+ 'span',+ message+ );+ });++ $(document).on('mouseup', '.ajax_notification a', function (event) {+ event.stopPropagation(); }); });@@ -3514,13 +3532,27 @@ Indexes.checkIndexType(); Functions.checkIndexName('index_frm'); var $indexColumns = $('#index_columns');- $indexColumns.find('td').each(function () {- $(this).css('width', $(this).width() + 'px');- }); $indexColumns.find('tbody').sortable({ axis: 'y', containment: $indexColumns.find('tbody'),- tolerance: 'pointer'+ tolerance: 'pointer',+ forcePlaceholderSize: true,+ // Add custom dragged row+ helper: function (event, tr) {+ var $originalCells = tr.children();+ var $helper = tr.clone();+ $helper.children().each(function (index) {+ // Set cell width in dragged row+ $(this).width($originalCells.eq(index).outerWidth());+ var $childrenSelect = $originalCells.eq(index).children('select');+ if ($childrenSelect.length) {+ var selectedIndex = $childrenSelect.prop('selectedIndex');+ // Set correct select value in dragged row+ $(this).children('select').prop('selectedIndex', selectedIndex);+ }+ });+ return $helper;+ } }); Functions.showHints($outer); // Add a slider for selecting how many columns to add to the index@@ -3788,14 +3820,22 @@ // Sync favorite tables from localStorage to pmadb. if ($('#sync_favorite_tables').length) {+ var favoriteTables = '';+ if (isStorageSupported('localStorage')+ && typeof window.localStorage.favoriteTables !== 'undefined'+ && window.localStorage.favoriteTables !== 'undefined') {+ favoriteTables = window.localStorage.favoriteTables;+ if (favoriteTables === 'undefined') {+ // Do not send an invalid value+ return;+ }+ } $.ajax({ url: $('#sync_favorite_tables').attr('href'), cache: false, type: 'POST', data: {- 'favoriteTables': (isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined')- ? window.localStorage.favoriteTables- : '',+ 'favoriteTables': favoriteTables, 'server': CommonParams.get('server'), 'no_debug': true },@@ -4148,9 +4188,14 @@ /** * Scrolls the page to the top if clicking the server-breadcrumb bar+ * If the user holds the Ctrl (or Meta on macOS) key, it prevents the scroll+ * so they can open the link in a new tab. */ $(function () { $(document).on('click', '#server-breadcrumb, #goto_pagetop', function (event) {+ if (event.ctrlKey || event.metaKey) {+ return;+ } event.preventDefault(); $('html, body').animate({ scrollTop: 0 }, 'fast'); });@@ -4396,21 +4441,24 @@ * @param $inputField */ Functions.toggleDatepickerIfInvalid = function ($td, $inputField) {- // Regex allowed by the Datetimepicker UI- var dtexpDate = new RegExp(['^([0-9]{4})',- '-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',- '-((0[1-9])|([1-2][0-9])|30)))$'].join(''));- var dtexpTime = new RegExp(['^(([0-1][0-9])|(2[0-3]))',- ':((0[0-9])|([1-5][0-9]))',- ':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'].join(''));-- // If key-ed in Time or Date values are unsupported by the UI, close it- if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {- $inputField.datepicker('hide');- } else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {- $inputField.datepicker('hide');- } else {- $inputField.datepicker('show');+ // If the Datetimepicker UI is not present, return+ if ($inputField.hasClass('hasDatepicker')) {+ // Regex allowed by the Datetimepicker UI+ var dtexpDate = new RegExp(['^([0-9]{4})',+ '-(((01|03|05|07|08|10|12)-((0[1-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)',+ '-((0[1-9])|([1-2][0-9])|30)))$'].join(''));+ var dtexpTime = new RegExp(['^(([0-1][0-9])|(2[0-3]))',+ ':((0[0-9])|([1-5][0-9]))',+ ':((0[0-9])|([1-5][0-9]))(.[0-9]{1,6}){0,1}$'].join(''));++ // If key-ed in Time or Date values are unsupported by the UI, close it+ if ($td.attr('data-type') === 'date' && ! dtexpDate.test($inputField.val())) {+ $inputField.datepicker('hide');+ } else if ($td.attr('data-type') === 'time' && ! dtexpTime.test($inputField.val())) {+ $inputField.datepicker('hide');+ } else {+ $inputField.datepicker('show');+ } } };
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: yes SQL Injection [File] js/src/functions.js [Lines] 1215 [Old Code] table = document.sqlform.table.value; [Fixed Code] table = Functions.escapeBacktick(document.sqlform.table.value); 2. Vulnerability Existed: yes Cross-Site Scripting (XSS) [File] js/src/functions.js [Lines] 430, 438 [Old Code] return s.replace('`', '``'); return s.replace('\\', '\\\\').replace('\'', '\\\''); [Fixed Code] return s.replaceAll('`', '``'); return s.replaceAll('\\', '\\\\').replaceAll('\'', '\\\''); 3. Vulnerability Existed: not sure Potential Information Disclosure [File] js/src/functions.js [Lines] 3788-3820 [Old Code] 'favoriteTables': (isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined') ? window.localStorage.favoriteTables : '', [Fixed Code] var favoriteTables = ''; if (isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined' && window.localStorage.favoriteTables !== 'undefined') { favoriteTables = window.localStorage.favoriteTables; if (favoriteTables === 'undefined') { // Do not send an invalid value return; } } ... 'favoriteTables': favoriteTables, 4. Vulnerability Existed: not sure Potential Clickjacking [File] js/src/functions.js [Lines] 2091-2100 [Old Code] (No equivalent code) [Fixed Code] $(document).on('mouseup', '.ajax_notification a', function (event) { event.stopPropagation(); }); 5. Vulnerability Existed: not sure Potential Regular Expression Denial of Service (ReDoS) [File] js/src/functions.js [Lines] 1131-1140 [Old Code] var updateRegExp = new RegExp('^\\s*UPDATE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+SET\\s', 'i'); var deleteRegExp = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i'); [Fixed Code] var updateRegExp = /^\s*UPDATE\b\s*(((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*\bSET\b/i; var deleteRegExp = /^\s*DELETE\b\s*((((`([^`]|``)+`)|([a-z0-9_$]+))\s*\.\s*)?((`([^`]|``)+`)|([a-z0-9_$]+))\s*)?\bFROM\b/i; 6. Vulnerability Existed: not sure Potential Weak Password Check [File] js/src/functions.js [Lines] 584 [Old Code] Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel); [Fixed Code] var username = ''; if (passwordForm.elements.username) { username = passwordForm.elements.username.value; } Functions.checkPasswordStrength(passwd.value, meterObj, meterObjLabel, username); Note: For vulnerabilities marked as "not sure", further investigation would be needed to confirm if they represent actual security issues or just defensive programming improvements. The SQL injection and XSS fixes are clearly security-related, while the others might be either security improvements or general code quality enhancements.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/Table/RelationController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Table/RelationController.php@@ -134,12 +134,12 @@ $column_hash_array = []; $column_array[''] = ''; foreach ($columns as $column) {+ $column_hash_array[$column['Field']] = md5($column['Field']); if (strtoupper($storageEngine) !== 'INNODB' && empty($column['Key'])) { continue; } $column_array[$column['Field']] = $column['Field'];- $column_hash_array[$column['Field']] = md5($column['Field']); } if ($GLOBALS['cfg']['NaturalOrder']) {
Analysis of the provided code diff: 1. Vulnerability Existed: not sure [Potential Timing Attack Vulnerability] [libraries/classes/Controllers/Table/RelationController.php] [Lines 134-142] Old Code: ```php foreach ($columns as $column) { if (strtoupper($storageEngine) !== 'INNODB' && empty($column['Key'])) { continue; } $column_array[$column['Field']] = $column['Field']; $column_hash_array[$column['Field']] = md5($column['Field']); } ``` Fixed Code: ```php foreach ($columns as $column) { $column_hash_array[$column['Field']] = md5($column['Field']); if (strtoupper($storageEngine) !== 'INNODB' && empty($column['Key'])) { continue; } $column_array[$column['Field']] = $column['Field']; } ``` Additional Details: The change moves the MD5 hash calculation outside the conditional block. While this doesn't directly fix a known vulnerability, it could potentially affect timing characteristics if the MD5 operation was previously skipped for some columns. However, without more context about how these hashes are used, we can't be certain if this was a security fix or just a code reorganization. The use of MD5 for security purposes is generally discouraged, but this appears to be used for indexing rather than cryptographic purposes.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php@@ -35,10 +35,7 @@ public function testGetItemType(): void {- $this->assertEquals(- 'subgroup',- $this->object->getItemType()- );+ self::assertSame('subgroup', $this->object->getItemType()); } /**@@ -50,9 +47,6 @@ { $this->object->setSubgroupHeader('subGroupHeader123');- $this->assertEquals(- 'subGroupHeader123',- $this->object->getSubgroupHeader()- );+ self::assertSame('subGroupHeader123', $this->object->getSubgroupHeader()); } }
After analyzing the provided code diff, I don't see any security-related changes. The changes appear to be test code improvements, switching from `assertEquals` to `assertSame` for more strict comparisons. Here's the analysis: 1. Vulnerability Existed: no No security vulnerability found File: test/classes/Properties/Options/Groups/OptionsPropertySubgroupTest.php Old Code: assertEquals() calls in test methods Fixed Code: assertSame() calls in test methods The changes are purely related to test assertions and don't affect security. The modifications: 1. Changed `assertEquals` to `assertSame` in `testGetItemType()` 2. Changed `assertEquals` to `assertSame` in `testGetSubgroupHeader()` 3. Removed some unnecessary line breaks in the test assertions These are test quality improvements rather than security fixes.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the check tables feature. A crafted table or database name could be used for XSS.
An issue was discovered in phpMyAdmin 5.x before 5.2.2. An XSS vulnerability has been discovered for the Insert tab.