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/Plugins/Export/ExportPdfTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Plugins/Export/ExportPdfTest.php@@ -61,96 +61,61 @@ $attrProperties->setAccessible(true); $properties = $attrProperties->getValue($this->object);- $this->assertInstanceOf(ExportPluginProperties::class, $properties);-- $this->assertEquals(- 'PDF',- $properties->getText()- );-- $this->assertEquals(- 'pdf',- $properties->getExtension()- );-- $this->assertEquals(- 'application/pdf',- $properties->getMimeType()- );-- $this->assertEquals(- 'Options',- $properties->getOptionsText()- );-- $this->assertTrue(- $properties->getForceFile()- );+ self::assertInstanceOf(ExportPluginProperties::class, $properties);++ self::assertSame('PDF', $properties->getText());++ self::assertSame('pdf', $properties->getExtension());++ self::assertSame('application/pdf', $properties->getMimeType());++ self::assertSame('Options', $properties->getOptionsText());++ self::assertTrue($properties->getForceFile()); $options = $properties->getOptions();- $this->assertInstanceOf(OptionsPropertyRootGroup::class, $options);-- $this->assertEquals(- 'Format Specific Options',- $options->getName()- );+ self::assertInstanceOf(OptionsPropertyRootGroup::class, $options);++ self::assertSame('Format Specific Options', $options->getName()); $generalOptionsArray = $options->getProperties(); $generalOptions = array_shift($generalOptionsArray);- $this->assertInstanceOf(OptionsPropertyMainGroup::class, $generalOptions);-- $this->assertEquals(- 'general_opts',- $generalOptions->getName()- );+ self::assertInstanceOf(OptionsPropertyMainGroup::class, $generalOptions);++ self::assertSame('general_opts', $generalOptions->getName()); $generalProperties = $generalOptions->getProperties(); $property = array_shift($generalProperties);- $this->assertInstanceOf(TextPropertyItem::class, $property);-- $this->assertEquals(- 'report_title',- $property->getName()- );+ self::assertInstanceOf(TextPropertyItem::class, $property);++ self::assertSame('report_title', $property->getName()); $generalOptions = array_shift($generalOptionsArray);- $this->assertInstanceOf(OptionsPropertyMainGroup::class, $generalOptions);-- $this->assertEquals(- 'dump_what',- $generalOptions->getName()- );-- $this->assertEquals(- 'Dump table',- $generalOptions->getText()- );+ self::assertInstanceOf(OptionsPropertyMainGroup::class, $generalOptions);++ self::assertSame('dump_what', $generalOptions->getName());++ self::assertSame('Dump table', $generalOptions->getText()); $generalProperties = $generalOptions->getProperties(); $property = array_shift($generalProperties);- $this->assertInstanceOf(RadioPropertyItem::class, $property);-- $this->assertEquals(- 'structure_or_data',- $property->getName()- );-- $this->assertEquals(- [- 'structure' => __('structure'),- 'data' => __('data'),- 'structure_and_data' => __('structure and data'),- ],- $property->getValues()- );+ self::assertInstanceOf(RadioPropertyItem::class, $property);++ self::assertSame('structure_or_data', $property->getName());++ self::assertSame([+ 'structure' => __('structure'),+ 'data' => __('data'),+ 'structure_and_data' => __('structure and data'),+ ], $property->getValues()); } public function testExportHeader(): void@@ -169,9 +134,7 @@ $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf);- $this->assertTrue(- $this->object->exportHeader()- );+ self::assertTrue($this->object->exportHeader()); } public function testExportFooter(): void@@ -187,30 +150,22 @@ $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf);- $this->assertTrue(- $this->object->exportFooter()- );+ self::assertTrue($this->object->exportFooter()); } public function testExportDBHeader(): void {- $this->assertTrue(- $this->object->exportDBHeader('testDB')- );+ self::assertTrue($this->object->exportDBHeader('testDB')); } public function testExportDBFooter(): void {- $this->assertTrue(- $this->object->exportDBFooter('testDB')- );+ self::assertTrue($this->object->exportDBFooter('testDB')); } public function testExportDBCreate(): void {- $this->assertTrue(- $this->object->exportDBCreate('testDB', 'database')- );+ self::assertTrue($this->object->exportDBCreate('testDB', 'database')); } public function testExportData(): void@@ -227,15 +182,13 @@ $attrPdf->setAccessible(true); $attrPdf->setValue($this->object, $pdf);- $this->assertTrue(- $this->object->exportData(- 'db',- 'table',- "\n",- 'phpmyadmin.net/err',- 'SELECT'- )- );+ self::assertTrue($this->object->exportData(+ 'db',+ 'table',+ "\n",+ 'phpmyadmin.net/err',+ 'SELECT'+ )); } /**@@ -251,9 +204,6 @@ $getter = new ReflectionMethod(ExportPdf::class, 'getPdf'); $getter->setAccessible(true);- $this->assertInstanceOf(- Pdf::class,- $getter->invoke($this->object)- );+ self::assertInstanceOf(Pdf::class, $getter->invoke($this->object)); } }
After analyzing the provided code diff, I can conclude that this appears to be a test file modification with no security-related changes. The changes are primarily stylistic, converting `assertEquals()` to `assertSame()` and reformatting some assertions for consistency. Here's the analysis following your requested format: Vulnerability Existed: no No security vulnerability found [File] test/classes/Plugins/Export/ExportPdfTest.php [Lines] 61-204 [Old Code] Various assertions using assertEquals() and multi-line formats [Fixed Code] Converted to assertSame() and more compact assertion formats The changes are purely related to test assertions and code style improvements, with no security implications. The functionality remains identical, just expressed differently in the test cases. No other vulnerabilities were found in the diff. The changes are focused on test code 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.
--- /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_1/phpmyadmin-RELEASE_5_2_1/libraries/classes/Controllers/LintController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/LintController.php@@ -10,6 +10,8 @@ use PhpMyAdmin\Core; use PhpMyAdmin\Linter;+use function is_array;+use function is_string; use function json_encode; /**@@ -17,45 +19,48 @@ */ class LintController extends AbstractController {+ public const EDITOR_SQL_PREFIX = [+ 'event' => "DELIMITER $$ CREATE EVENT `a` ON SCHEDULE EVERY MINUTE DO\n",+ 'routine' => "DELIMITER $$ CREATE PROCEDURE `a`()\n",+ 'trigger' => "DELIMITER $$ CREATE TRIGGER `a` AFTER INSERT ON `b` FOR EACH ROW\n",+ ];+ public function __invoke(): void {- $params = [- 'sql_query' => $_POST['sql_query'] ?? null,- 'options' => $_POST['options'] ?? null,- ];+ $sqlQueryParam = $_POST['sql_query'] ?? null;+ $options = $_POST['options'] ?? null; /** * The SQL query to be analyzed. *- * This does not need to be checked again XSS or MySQL injections because it is+ * This does not need to be checked against XSS or MySQL injections because it is * never executed, just parsed. * * The client, which will receive the JSON response will decode the message and * and any HTML fragments that are displayed to the user will be encoded anyway.- *- * @var string */- $sqlQuery = ! empty($params['sql_query']) ? $params['sql_query'] : '';+ $sqlQuery = is_string($sqlQueryParam) ? $sqlQueryParam : '';- $this->response->setAjax(true);+ $editorType = is_array($options) ? ($options['editorType'] ?? null) : null;+ $prefix = is_string($editorType) ? self::EDITOR_SQL_PREFIX[$editorType] ?? '' : '';- // Disabling standard response.- $this->response->disable();+ $lints = Linter::lint($prefix . $sqlQuery);+ if ($prefix !== '') {+ // Adjust positions to account for prefix+ foreach ($lints as $i => $lint) {+ if ($lint['fromLine'] === 0) {+ continue;+ }- Core::headerJSON();-- if (! empty($params['options'])) {- $options = $params['options'];-- if (! empty($options['routineEditor'])) {- $sqlQuery = 'CREATE PROCEDURE `a`() ' . $sqlQuery;- } elseif (! empty($options['triggerEditor'])) {- $sqlQuery = 'CREATE TRIGGER `a` AFTER INSERT ON `b` FOR EACH ROW ' . $sqlQuery;- } elseif (! empty($options['eventEditor'])) {- $sqlQuery = 'CREATE EVENT `a` ON SCHEDULE EVERY MINUTE DO ' . $sqlQuery;+ $lints[$i]['fromLine'] -= 1;+ $lints[$i]['toLine'] -= 1; } }- echo json_encode(Linter::lint($sqlQuery));+ $this->response->setAjax(true);+ // Disabling standard response.+ $this->response->disable();+ Core::headerJSON();+ echo json_encode($lints); } }
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: yes Input Validation Vulnerability [File] libraries/classes/Controllers/LintController.php [Lines 17-45] [Old Code] ```php $params = [ 'sql_query' => $_POST['sql_query'] ?? null, 'options' => $_POST['options'] ?? null, ]; $sqlQuery = ! empty($params['sql_query']) ? $params['sql_query'] : ''; ``` [Fixed Code] ```php $sqlQueryParam = $_POST['sql_query'] ?? null; $options = $_POST['options'] ?? null; $sqlQuery = is_string($sqlQueryParam) ? $sqlQueryParam : ''; ``` Additional Details: The fixed code adds proper type checking for input parameters using is_string() and is_array(), which helps prevent potential type-related vulnerabilities. 2. Vulnerability Existed: yes Insecure Direct Object Reference (IDOR) Potential [File] libraries/classes/Controllers/LintController.php [Lines 17-45] [Old Code] ```php if (! empty($params['options'])) { $options = $params['options']; if (! empty($options['routineEditor'])) { $sqlQuery = 'CREATE PROCEDURE `a`() ' . $sqlQuery; } elseif (! empty($options['triggerEditor'])) { $sqlQuery = 'CREATE TRIGGER `a` AFTER INSERT ON `b` FOR EACH ROW ' . $sqlQuery; } elseif (! empty($options['eventEditor'])) { $sqlQuery = 'CREATE EVENT `a` ON SCHEDULE EVERY MINUTE DO ' . $sqlQuery; } } ``` [Fixed Code] ```php $editorType = is_array($options) ? ($options['editorType'] ?? null) : null; $prefix = is_string($editorType) ? self::EDITOR_SQL_PREFIX[$editorType] ?? '' : ''; ``` Additional Details: The new code uses a whitelist approach with predefined prefixes in EDITOR_SQL_PREFIX constant, which is more secure than directly using user-provided values to construct SQL statements. 3. Vulnerability Existed: not sure Potential JSON Injection [File] libraries/classes/Controllers/LintController.php [Lines 17-45] [Old Code] ```php echo json_encode(Linter::lint($sqlQuery)); ``` [Fixed Code] ```php echo json_encode($lints); ``` Additional Details: While both versions use json_encode(), the restructured code flow might provide better protection against JSON injection, though this isn't entirely clear from the diff alone. The comment about XSS protection suggests the output is properly handled.
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/MonitorControllerTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Controllers/Server/Status/MonitorControllerTest.php@@ -53,44 +53,29 @@ $this->assertAllSelectsConsumed(); $html = $response->getHTMLResult();- $this->assertStringContainsString('<div class="tabLinks row">', $html);- $this->assertStringContainsString(- __('Start Monitor'),- $html- );- $this->assertStringContainsString(- __('Settings'),- $html- );- $this->assertStringContainsString(- __('Done dragging (rearranging) charts'),- $html- );+ self::assertStringContainsString('<div class="tabLinks row">', $html);+ self::assertStringContainsString(__('Start Monitor'), $html);+ self::assertStringContainsString(__('Settings'), $html);+ self::assertStringContainsString(__('Done dragging (rearranging) charts'), $html);- $this->assertStringContainsString('<div class="popupContent settingsPopup">', $html);- $this->assertStringContainsString('<a href="#settingsPopup" class="popupLink">', $html);- $this->assertStringContainsString(- __('Enable charts dragging'),- $html- );- $this->assertStringContainsString('<option>3</option>', $html);+ self::assertStringContainsString('<div class="popupContent settingsPopup">', $html);+ self::assertStringContainsString('<a href="#settingsPopup" class="popupLink">', $html);+ self::assertStringContainsString(__('Enable charts dragging'), $html);+ self::assertStringContainsString('<option>3</option>', $html);- $this->assertStringContainsString(- __('Monitor Instructions'),- $html- );- $this->assertStringContainsString('monitorInstructionsDialog', $html);+ self::assertStringContainsString(__('Monitor Instructions'), $html);+ self::assertStringContainsString('monitorInstructionsDialog', $html);- $this->assertStringContainsString('<div class="modal fade" id="addChartModal"', $html);- $this->assertStringContainsString('<div id="chartVariableSettings">', $html);- $this->assertStringContainsString('<option>Processes</option>', $html);- $this->assertStringContainsString('<option>Connections</option>', $html);+ self::assertStringContainsString('<div class="modal fade" id="addChartModal"', $html);+ self::assertStringContainsString('<div id="chartVariableSettings">', $html);+ self::assertStringContainsString('<option>Processes</option>', $html);+ self::assertStringContainsString('<option>Connections</option>', $html);- $this->assertStringContainsString('<form id="js_data" class="hide">', $html);- $this->assertStringContainsString('<input type="hidden" name="server_time"', $html);+ self::assertStringContainsString('<form id="js_data" class="hide">', $html);+ self::assertStringContainsString('<input type="hidden" name="server_time"', $html); //validate 2: inputs- $this->assertStringContainsString('<input type="hidden" name="is_superuser"', $html);- $this->assertStringContainsString('<input type="hidden" name="server_db_isLocal"', $html);- $this->assertStringContainsString('<div id="explain_docu" class="hide">', $html);+ self::assertStringContainsString('<input type="hidden" name="is_superuser"', $html);+ self::assertStringContainsString('<input type="hidden" name="server_db_isLocal"', $html);+ self::assertStringContainsString('<div id="explain_docu" class="hide">', $html); } }
After analyzing the provided code diff, I don't find any security-related changes. The changes appear to be purely cosmetic, changing test assertions from `$this->assertStringContainsString()` to `self::assertStringContainsString()` and reformatting some lines for better readability. Here's the analysis following your requested format: Vulnerability Existed: no No security vulnerability found [test/classes/Controllers/Server/Status/MonitorControllerTest.php] [Lines 53-96] [Old code with $this->assert... calls] [New code with self::assert... calls] The changes are related to test code style and don't affect security. The modifications are: 1. Changing instance method calls ($this->assert...) to static method calls (self::assert...) 2. Reformatting some multi-line assertions into single lines 3. No changes to the actual functionality or security-related code
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/Preferences/TwoFactorController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Preferences/TwoFactorController.php@@ -13,6 +13,7 @@ use function __; use function count;+use function define; class TwoFactorController extends AbstractController {@@ -73,5 +74,11 @@ 'backends' => $twoFactor->getAllBackends(), 'missing' => $twoFactor->getMissingDeps(), ]);++ if ($this->response->isAjax()) {+ $this->response->addJSON('disableNaviSettings', true);+ } else {+ define('PMA_DISABLE_NAVI_SETTINGS', true);+ } } }
I'll analyze the code diff and provide the security findings following the specified format. Vulnerability Existed: not sure [Potential Cross-Site Request Forgery (CSRF) Protection Improvement] [libraries/classes/Controllers/Preferences/TwoFactorController.php] [Lines 13-74] [Old Code] (No explicit CSRF protection or navigation settings disablement) [Fixed Code] Added conditional handling for AJAX requests and setting of PMA_DISABLE_NAVI_SETTINGS Additional Details: The diff shows the addition of code that handles AJAX responses differently from regular requests by either adding a JSON response or defining a constant. While this doesn't directly show a security vulnerability being fixed, it appears to be related to security hardening by: 1. Explicitly disabling navigation settings during two-factor authentication handling 2. Differentiating between AJAX and regular requests 3. Potentially preventing UI state manipulation during sensitive operations The change suggests a security-conscious improvement, though without more context about the surrounding code, I can't definitively identify a specific vulnerability being fixed. The addition appears to be a preventative measure rather than fixing an existing vulnerability.
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/Gis/GisGeometryTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Gis/GisGeometryTest.php@@ -47,18 +47,15 @@ */ public function testSetMinMax(string $point_set, array $min_max, array $output): void {- $this->assertEquals(- $output,- $this->callFunction(- $this->object,- GisGeometry::class,- 'setMinMax',- [- $point_set,- $min_max,- ]- )- );+ self::assertEquals($output, $this->callFunction(+ $this->object,+ GisGeometry::class,+ 'setMinMax',+ [+ $point_set,+ $min_max,+ ]+ )); } /**@@ -66,12 +63,12 @@ * * @return array data for testSetMinMax */- public function providerForTestSetMinMax(): array+ public static function providerForTestSetMinMax(): array { return [ [ '12 35,48 75,69 23,25 45,14 53,35 78',- [],+ GisGeometry::EMPTY_EXTENT, [ 'minX' => 12, 'maxX' => 69,@@ -107,15 +104,12 @@ */ public function testGenerateParams(string $value, array $output): void {- $this->assertEquals(- $output,- $this->callFunction(- $this->object,- GisGeometry::class,- 'generateParams',- [$value]- )- );+ self::assertEquals($output, $this->callFunction(+ $this->object,+ GisGeometry::class,+ 'generateParams',+ [$value]+ )); } /**@@ -123,7 +117,7 @@ * * @return array data for testGenerateParams */- public function providerForTestGenerateParams(): array+ public static function providerForTestGenerateParams(): array { return [ [@@ -162,19 +156,16 @@ */ public function testExtractPoints(string $point_set, ?array $scale_data, bool $linear, array $output): void {- $this->assertEquals(- $output,- $this->callFunction(- $this->object,- GisGeometry::class,- 'extractPoints',- [- $point_set,- $scale_data,- $linear,- ]- )- );+ self::assertEquals($output, $this->callFunction(+ $this->object,+ GisGeometry::class,+ 'extractPoints',+ [+ $point_set,+ $scale_data,+ $linear,+ ]+ )); } /**@@ -182,7 +173,7 @@ * * @return array data for testExtractPoints */- public function providerForTestExtractPoints(): array+ public static function providerForTestExtractPoints(): array { return [ // with no scale data@@ -278,18 +269,15 @@ */ public function testGetBoundsForOl(int $srid, array $scale_data, string $output): void {- $this->assertEquals(- $output,- $this->callFunction(- $this->object,- GisGeometry::class,- 'getBoundsForOl',- [- $srid,- $scale_data,- ]- )- );+ self::assertSame($output, $this->callFunction(+ $this->object,+ GisGeometry::class,+ 'getBoundsForOl',+ [+ $srid,+ $scale_data,+ ]+ )); } /**@@ -297,7 +285,7 @@ * * @return array test data for the testGetBoundsForOl() test case */- public function providerForTestGetBoundsForOl(): array+ public static function providerForTestGetBoundsForOl(): array { return [ [@@ -330,18 +318,15 @@ */ public function testGetPolygonArrayForOpenLayers(array $polygons, int $srid, string $output): void {- $this->assertEquals(- $output,- $this->callFunction(- $this->object,- GisGeometry::class,- 'getPolygonArrayForOpenLayers',- [- $polygons,- $srid,- ]- )- );+ self::assertSame($output, $this->callFunction(+ $this->object,+ GisGeometry::class,+ 'getPolygonArrayForOpenLayers',+ [+ $polygons,+ $srid,+ ]+ )); } /**@@ -349,7 +334,7 @@ * * @return array test data for testGetPolygonArrayForOpenLayers() test case */- public function providerForTestGetPolygonArrayForOpenLayers(): array+ public static function providerForTestGetPolygonArrayForOpenLayers(): array { return [ [
After analyzing the provided code diff, I don't see any security-related fixes. The changes appear to be primarily code style improvements and test case enhancements. Here's the analysis: 1. Vulnerability Existed: no No specific vulnerability [test/classes/Gis/GisGeometryTest.php] [Various lines] The changes include: - Changing test assertions from $this->assertEquals() to self::assertEquals() - Changing test data provider methods from instance methods to static methods - Using GisGeometry::EMPTY_EXTENT constant instead of empty array - Changing some assertEquals() to assertSame() for stricter comparison 2. Vulnerability Existed: no No specific vulnerability [test/classes/Gis/GisGeometryTest.php] [Various lines] The changes in test data providers and test methods appear to be: - Code consistency improvements - Better test isolation by making data providers static - No security-related fixes identified The diff shows test code improvements but doesn't reveal any security vulnerabilities being fixed. The changes are focused on test quality and maintainability rather than addressing security issues.
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/Util.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Util.php@@ -37,7 +37,6 @@ use function floor; use function fread; use function function_exists;-use function html_entity_decode; use function htmlentities; use function htmlspecialchars; use function htmlspecialchars_decode;@@ -72,6 +71,7 @@ use function sort; use function sprintf; use function str_contains;+use function str_getcsv; use function str_pad; use function str_replace; use function strcasecmp;@@ -325,7 +325,9 @@ $tableGroups = [];- foreach ($tables as $tableName => $table) {+ foreach ($tables as $table) {+ /** @var string $tableName */+ $tableName = $table['TABLE_NAME']; $table['Rows'] = self::checkRowCount($db, $table); // in $group we save the reference to the place in $table_groups@@ -1264,6 +1266,7 @@ SessionCache::remove('is_createuser'); SessionCache::remove('is_grantuser'); SessionCache::remove('mysql_cur_user');+ SessionCache::remove('mysql_cur_role'); } /**@@ -1901,46 +1904,21 @@ */ public static function parseEnumSetValues($definition, $escapeHtml = true) {- $valuesString = htmlentities($definition, ENT_COMPAT, 'UTF-8'); // There is a JS port of the below parser in functions.js // If you are fixing something here, // you need to also update the JS port.++ // This should really be delegated to MySQL but since we also want to HTML encode it,+ // it is easier this way.+ // It future replace str_getcsv with $dbi->fetchSingleRow('SELECT '.$expressionInBrackets[1]);++ preg_match('/\((.*)\)/', $definition, $expressionInBrackets);+ $matches = str_getcsv($expressionInBrackets[1], ',', "'", '\\');+ $values = [];- $inString = false;- $buffer = '';-- for ($i = 0, $length = mb_strlen($valuesString); $i < $length; $i++) {- $curr = mb_substr($valuesString, $i, 1);- $next = $i == mb_strlen($valuesString) - 1- ? ''- : mb_substr($valuesString, $i + 1, 1);-- if (! $inString && $curr == "'") {- $inString = true;- } elseif (($inString && $curr === '\\') && $next === '\\') {- $buffer .= '\';- $i++;- } elseif (($inString && $next == "'") && ($curr == "'" || $curr === '\\')) {- $buffer .= ''';- $i++;- } elseif ($inString && $curr == "'") {- $inString = false;- $values[] = $buffer;- $buffer = '';- } elseif ($inString) {- $buffer .= $curr;- }- }-- if (strlen($buffer) > 0) {- // The leftovers in the buffer are the last value (if any)- $values[] = $buffer;- }-- if (! $escapeHtml) {- foreach ($values as $key => $value) {- $values[$key] = html_entity_decode($value, ENT_QUOTES, 'UTF-8');- }+ foreach ($matches as $value) {+ $value = strtr($value, ['\\\\' => '\\']); // str_getcsv doesn't unescape backslashes so we do it ourselves+ $values[] = $escapeHtml ? htmlspecialchars($value, ENT_QUOTES, 'UTF-8') : $value; } return $values;@@ -2024,7 +2002,7 @@ */ public static function addMicroseconds($value) {- if (empty($value) || $value === 'CURRENT_TIMESTAMP' || $value === 'current_timestamp()') {+ if ($value === '' || preg_match('/^current_timestamp(\([0-6]?\))?$/i', $value)) { return $value; }@@ -2288,18 +2266,15 @@ } }- $tables = array_merge(- $groupTable,- $dbi->getTablesFull(- $db,- $groupWithSeparator !== false ? $groupWithSeparator : '',- $groupWithSeparator !== false,- $limitOffset,- $limitCount,- $sort,- $sortOrder,- $tableType- )+ $tables = $groupTable + $dbi->getTablesFull(+ $db,+ $groupWithSeparator !== false ? $groupWithSeparator : $tables,+ $groupWithSeparator !== false,+ $limitOffset,+ $limitCount,+ $sort,+ $sortOrder,+ $tableType ); }@@ -2402,10 +2377,7 @@ } if (count($names) > 0) {- $tables = array_merge(- $tables,- $dbi->getTablesFull($db, $names)- );+ $tables += $dbi->getTablesFull($db, $names); } if ($GLOBALS['cfg']['NaturalOrder']) {@@ -2643,9 +2615,9 @@ $urlParams['tbl_group'] = $_REQUEST['tbl_group']; }- $url = Url::getFromRoute('/database/structure');-- return Generator::linkOrButton($url, $urlParams, $title . $orderImg, $orderLinkParams);+ $url = Url::getFromRoute('/database/structure', $urlParams, false);++ return Generator::linkOrButton($url, null, $title . $orderImg, $orderLinkParams); } /**
Here's the security analysis following your requested format: 1. Vulnerability Existed: yes Cross-Site Scripting (XSS) [libraries/classes/Util.php] [Lines 1901-1946] [Old Code] Manual parsing of ENUM/SET values with custom HTML entity handling [Fixed Code] Using str_getcsv() for proper parsing and htmlspecialchars() for consistent HTML escaping 2. Vulnerability Existed: yes Session Fixation [libraries/classes/Util.php] [Lines 1264-1267] [Old Code] Missing session cache cleanup for 'mysql_cur_role' [Fixed Code] Added SessionCache::remove('mysql_cur_role') to clear sensitive session data 3. Vulnerability Existed: not sure Potential SQL Injection [libraries/classes/Util.php] [Lines 1901-1946] [Old Code] Manual parsing of SQL values [Fixed Code] Using str_getcsv() with comment suggesting future MySQL delegation 4. Vulnerability Existed: not sure Information Disclosure [libraries/classes/Util.php] [Lines 325-328] [Old Code] Direct array access without type checking [Fixed Code] Added type hint comment and explicit array access 5. Vulnerability Existed: not sure URL Parameter Injection [libraries/classes/Util.php] [Lines 2643-2648] [Old Code] Passing URL parameters separately from route generation [Fixed Code] Consolidating parameters into route generation The most significant fix appears to be the ENUM/SET parsing change which addresses potential XSS vulnerabilities by replacing custom parsing logic with proper CSV parsing and consistent HTML escaping. The session cache cleanup is also an important security improvement. The other changes may have security implications but are less clearly security-focused.
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/selenium/ImportTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/selenium/ImportTest.php@@ -29,8 +29,8 @@ $this->dbQuery( 'SHOW DATABASES LIKE \'test_import%\'', function (): void {- $this->assertEquals('test_import1', $this->getCellByTableClass('table_results', 1, 1));- $this->assertEquals('test_import2', $this->getCellByTableClass('table_results', 2, 1));+ self::assertEquals('test_import1', $this->getCellByTableClass('table_results', 1, 1));+ self::assertEquals('test_import2', $this->getCellByTableClass('table_results', 2, 1)); } );@@ -54,8 +54,8 @@ 'USE `' . $this->databaseName . '`;' . 'SHOW TABLES FROM `' . $this->databaseName . '`', function (): void {- $this->assertTrue($this->isElementPresent('className', 'table_results'));- $this->assertEquals('test_table', $this->getCellByTableClass('table_results', 1, 1));+ self::assertTrue($this->isElementPresent('className', 'table_results'));+ self::assertEquals('test_table', $this->getCellByTableClass('table_results', 1, 1)); } ); }@@ -81,9 +81,9 @@ $this->dbQuery( 'SELECT * FROM `' . $this->databaseName . '`.test_table', function (): void {- $this->assertTrue($this->isElementPresent('className', 'table_results'));- $this->assertEquals('8', $this->getCellByTableClass('table_results', 1, 1));- $this->assertEquals('9', $this->getCellByTableClass('table_results', 2, 1));+ self::assertTrue($this->isElementPresent('className', 'table_results'));+ self::assertEquals('8', $this->getCellByTableClass('table_results', 1, 1));+ self::assertEquals('9', $this->getCellByTableClass('table_results', 2, 1)); } ); }
After analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be related to test assertions where `$this->assertEquals()` and similar methods were changed to `self::assertEquals()`. This is likely a code style/quality improvement rather than a security fix. Here's the structured response: Vulnerability Existed: no No security vulnerability found in the diff. The changes are test assertion style updates from instance method calls to static method calls. For completeness, here are the details of the changes: 1. Changed assertion style in ImportTest.php lines 29-30 Old Code: $this->assertEquals(...) Fixed Code: self::assertEquals(...) 2. Changed assertion style in ImportTest.php lines 54-55 Old Code: $this->assertTrue(...) and $this->assertEquals(...) Fixed Code: self::assertTrue(...) and self::assertEquals(...) 3. Changed assertion style in ImportTest.php lines 81-83 Old Code: $this->assertTrue(...) and $this->assertEquals(...) Fixed Code: self::assertTrue(...) and self::assertEquals(...) These changes don't represent security fixes but rather improvements in test code organization by using static method calls instead of instance method calls for 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/Properties/Plugins/ImportPluginPropertiesTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Properties/Plugins/ImportPluginPropertiesTest.php@@ -35,10 +35,7 @@ public function testGetItemType(): void {- $this->assertEquals(- 'import',- $this->object->getItemType()- );+ self::assertSame('import', $this->object->getItemType()); } /**@@ -50,10 +47,7 @@ { $this->object->setOptionsText('options123');- $this->assertEquals(- 'options123',- $this->object->getOptionsText()- );+ self::assertSame('options123', $this->object->getOptionsText()); } /**@@ -65,9 +59,6 @@ { $this->object->setMimeType('mime123');- $this->assertEquals(- 'mime123',- $this->object->getMimeType()- );+ self::assertSame('mime123', $this->object->getMimeType()); } }
After analyzing the provided code diff, I don't find any security vulnerabilities being fixed. The changes are purely related to test assertions being updated from `assertEquals` to `assertSame`, which is a testing best practice change rather than a security fix. Here's the analysis following your requested format: 1. Vulnerability Existed: no No security vulnerability found in test file File: test/classes/Properties/Plugins/ImportPluginPropertiesTest.php Lines: 35-37, 50-52, 65-67 Old Code: assertEquals() assertions Fixed Code: assertSame() assertions The changes are: - Changing test assertions from `assertEquals` to `assertSame` for more strict type checking - Removing unnecessary line breaks in test assertions - No security-related changes were made 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/libraries/classes/Query/Cache.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Query/Cache.php@@ -15,37 +15,27 @@ */ class Cache {- /** @var array Table data cache */+ /** @var array[] Table data cache */ private $tableCache = []; /** * Caches table data so Table does not require to issue * SHOW TABLE STATUS again *- * @param array $tables information for tables of some databases- * @param string|bool $table table name+ * @param mixed[][] $tables information for tables of some databases */- public function cacheTableData(array $tables, $table): void+ public function cacheTableData(string $database, array $tables): void {- // Note: I don't see why we would need array_merge_recursive() here,- // as it creates double entries for the same table (for example a double- // entry for Comment when changing the storage engine in Operations)- // Note 2: Instead of array_merge(), simply use the + operator because- // array_merge() renumbers numeric keys starting with 0, therefore- // we would lose a db name that consists only of numbers+ // Note: This function must not use array_merge because numerical indices must be preserved.+ // When an entry already exists for the database in cache, we merge the incoming data with existing data.+ // The union operator appends elements from right to left unless they exists on the left already.+ // Doing the union with incoming data on the left ensures that when we reread table status from DB,+ // we overwrite whatever was in cache with the new data.- foreach ($tables as $one_database => $_) {- if (isset($this->tableCache[$one_database])) {- // the + operator does not do the intended effect- // when the cache for one table already exists- if ($table && isset($this->tableCache[$one_database][$table])) {- unset($this->tableCache[$one_database][$table]);- }-- $this->tableCache[$one_database] += $tables[$one_database];- } else {- $this->tableCache[$one_database] = $tables[$one_database];- }+ if (isset($this->tableCache[$database])) {+ $this->tableCache[$database] = $tables + $this->tableCache[$database];+ } else {+ $this->tableCache[$database] = $tables; } }
I'll analyze the provided code diff for security fixes following the specified format. Vulnerability Existed: not sure [Cache Inconsistency/Data Integrity Issue] [libraries/classes/Query/Cache.php] [Lines 15-37] [Old Code] public function cacheTableData(array $tables, $table): void { foreach ($tables as $one_database => $_) { if (isset($this->tableCache[$one_database])) { if ($table && isset($this->tableCache[$one_database][$table])) { unset($this->tableCache[$one_database][$table]); } $this->tableCache[$one_database] += $tables[$one_database]; } else { $this->tableCache[$one_database] = $tables[$one_database]; } } } [Fixed Code] public function cacheTableData(string $database, array $tables): void { if (isset($this->tableCache[$database])) { $this->tableCache[$database] = $tables + $this->tableCache[$database]; } else { $this->tableCache[$database] = $tables; } } Additional Details: 1. The changes appear to be more about code quality and functionality rather than direct security fixes 2. The main differences are: - Simplified method signature (removed $table parameter) - More straightforward cache merging logic - Better handling of array merging with union operator 3. While not clearly a security vulnerability, the old code could potentially lead to cache inconsistencies which might have security implications in some contexts 4. The change ensures more reliable cache updates which could prevent race conditions or stale data issues
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/TableTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/TableTest.php@@ -197,6 +197,22 @@ ], ], ],+ [+ "SELECT TABLE_NAME FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'aa' AND TABLE_NAME = 'ad'",+ null,+ null,+ DatabaseInterface::CONNECT_USER,+ [+ ['ad'],+ ],+ ],+ [+ "SELECT TABLE_NAME FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'bb' AND TABLE_NAME = 'ad'",+ null,+ null,+ DatabaseInterface::CONNECT_USER,+ [],+ ], ]; $resultStub = $this->createMock(DummyResult::class);@@ -234,13 +250,6 @@ $dbi->expects($this->any())->method('getTablesFull') ->will($this->returnValue($databases));- $resultStub->expects($this->any())- ->method('numRows')- ->will($this->returnValue(20));-- $dbi->expects($this->any())->method('tryQuery')- ->will($this->returnValue($resultStub));- $triggers = [ [ 'name' => 'name1',@@ -287,7 +296,7 @@ public function testCreate(): void { $table = new Table('table1', 'pma_test');- $this->assertInstanceOf(Table::class, $table);+ self::assertInstanceOf(Table::class, $table); } /**@@ -296,22 +305,10 @@ public function testConstruct(): void { $table = new Table('PMA_BookMark', 'PMA');- $this->assertEquals(- 'PMA_BookMark',- $table->__toString()- );- $this->assertEquals(- 'PMA_BookMark',- $table->getName()- );- $this->assertEquals(- 'PMA',- $table->getDbName()- );- $this->assertEquals(- 'PMA.PMA_BookMark',- $table->getFullName()- );+ self::assertSame('PMA_BookMark', $table->__toString());+ self::assertSame('PMA_BookMark', $table->getName());+ self::assertSame('PMA', $table->getDbName());+ self::assertSame('PMA.PMA_BookMark', $table->getFullName()); } /**@@ -320,22 +317,10 @@ public function testGetName(): void { $table = new Table('table1', 'pma_test');- $this->assertEquals(- 'table1',- $table->getName()- );- $this->assertEquals(- '`table1`',- $table->getName(true)- );- $this->assertEquals(- 'pma_test',- $table->getDbName()- );- $this->assertEquals(- '`pma_test`',- $table->getDbName(true)- );+ self::assertSame('table1', $table->getName());+ self::assertSame('`table1`', $table->getName(true));+ self::assertSame('pma_test', $table->getDbName());+ self::assertSame('`pma_test`', $table->getDbName(true)); } /**@@ -352,14 +337,8 @@ $table->messages[] = 'messages2'; $table->messages[] = 'messages3';- $this->assertEquals(- 'error3',- $table->getLastError()- );- $this->assertEquals(- 'messages3',- $table->getLastMessage()- );+ self::assertSame('error3', $table->getLastError());+ self::assertSame('messages3', $table->getLastMessage()); } /**@@ -373,16 +352,13 @@ */ public function testValidateName(string $name, bool $result, bool $is_backquoted = false): void {- $this->assertEquals(- $result,- Table::isValidName($name, $is_backquoted)- );+ self::assertSame($result, Table::isValidName($name, $is_backquoted)); } /** * Data provider for name validation */- public function dataValidateName(): array+ public static function dataValidateName(): array { return [ [@@ -437,20 +413,14 @@ public function testIsView(): void { $table = new Table('', '');- $this->assertFalse(- $table->isView()- );+ self::assertFalse($table->isView()); //validate that it is the same as DBI fetchResult $table = new Table('PMA_BookMark', 'PMA');- $this->assertTrue(- $table->isView()- );+ self::assertTrue($table->isView()); $table = new Table('PMA_BookMark_2', 'PMA');- $this->assertFalse(- $table->isView()- );+ self::assertFalse($table->isView()); } /**@@ -488,7 +458,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` BIT(12) PMA_attribute NULL DEFAULT b\'10\' AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query );@@ -510,7 +480,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` DOUBLE(12) PMA_attribute NULL DEFAULT \'12\' AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query );@@ -532,7 +502,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT TRUE AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query );@@ -554,7 +524,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT NULL AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query );@@ -576,11 +546,8 @@ $expression, $move_to );- $this->assertEquals(- '`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP '- . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST",- $query- );+ self::assertSame('`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP '+ . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query); //$default_type is current_timestamp() $default_type = 'current_timestamp()';@@ -599,11 +566,8 @@ $expression, $move_to );- $this->assertEquals(- '`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT current_timestamp() '- . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST",- $query- );+ self::assertSame('`PMA_name` BOOLEAN PMA_attribute NULL DEFAULT current_timestamp() '+ . "AUTO_INCREMENT COMMENT 'PMA_comment' FIRST", $query); // $type is 'TIMESTAMP(3), $default_type is CURRENT_TIMESTAMP(3) $type = 'TIMESTAMP';@@ -625,7 +589,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` TIMESTAMP(3) PMA_attribute NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT \'PMA_comment\' FIRST', $query );@@ -650,7 +614,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` TIMESTAMP PMA_attribute NULL DEFAULT \'0000-00-00 00:00:00\' COMMENT \'PMA_comment\' FIRST', $query );@@ -675,7 +639,7 @@ $expression, $move_to );- $this->assertEquals(+ self::assertSame( '`PMA_name` TIMESTAMP PMA_attribute NULL DEFAULT \'0000-00-00 00:00:00.0\' COMMENT \'PMA_comment\' FIRST', $query );@@ -700,11 +664,8 @@ $expression, $move_to );- $this->assertEquals(- '`PMA_name` TIMESTAMP PMA_attribute NULL DEFAULT \'0000-00-00 00:00:00.000000\' '- . "COMMENT 'PMA_comment' FIRST",- $query- );+ self::assertSame('`PMA_name` TIMESTAMP PMA_attribute NULL DEFAULT \'0000-00-00 00:00:00.000000\' '+ . "COMMENT 'PMA_comment' FIRST", $query); //$default_type is UUID $type = 'UUID';@@ -725,10 +686,7 @@ $expression, $move_to );- $this->assertEquals(- '`PMA_name` UUID PMA_attribute NULL DEFAULT uuid()',- $query- );+ self::assertSame('`PMA_name` UUID PMA_attribute NULL DEFAULT uuid()', $query); //$default_type is uuid() $type = 'UUID';@@ -749,10 +707,7 @@ $expression, $move_to );- $this->assertEquals(- '`PMA_name` UUID PMA_attribute NULL DEFAULT uuid()',- $query- );+ self::assertSame('`PMA_name` UUID PMA_attribute NULL DEFAULT uuid()', $query); //$default_type is NONE $type = 'BOOLEAN';@@ -774,7 +729,7 @@ $expression, $move_to );- $this->assertEquals('`PMA_name` BOOLEAN PMA_attribute NULL INCREMENT COMMENT \'PMA_comment\' FIRST', $query);+ self::assertSame('`PMA_name` BOOLEAN PMA_attribute NULL INCREMENT COMMENT \'PMA_comment\' FIRST', $query); $default_type = 'NONE'; $move_to = '-first';@@ -795,7 +750,7 @@ ['id'], 'id' );- $this->assertEquals('`ids` INT(11) PMA_attribute NULL AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query);+ self::assertSame('`ids` INT(11) PMA_attribute NULL AUTO_INCREMENT COMMENT \'PMA_comment\' FIRST', $query); $default_type = 'NONE'; $move_to = '-first';@@ -817,11 +772,8 @@ 'id' ); // Add primary key for AUTO_INCREMENT if missing- $this->assertEquals(- '`ids` INT(11) PMA_attribute NULL AUTO_INCREMENT '- . "COMMENT 'PMA_comment' FIRST, add PRIMARY KEY (`ids`)",- $query- );+ self::assertSame('`ids` INT(11) PMA_attribute NULL AUTO_INCREMENT '+ . "COMMENT 'PMA_comment' FIRST, ADD PRIMARY KEY (`ids`)", $query); $default_type = 'NONE'; $move_to = '-first';@@ -843,7 +795,7 @@ 'id' ); // Do not add PK- $this->assertEquals('`id` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST', $query);+ self::assertSame('`id` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST', $query); $default_type = 'NONE'; $move_to = '-first';@@ -865,7 +817,7 @@ 'id' ); // Do not add PK- $this->assertEquals('`ids` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST', $query);+ self::assertSame('`ids` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST', $query); $default_type = 'NONE'; $move_to = '-first';@@ -887,8 +839,8 @@ 'id' ); // Add it beaucause it is missing- $this->assertEquals(- '`ids` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST, add PRIMARY KEY (`ids`)',+ self::assertSame(+ '`ids` INT(11) PMA_attribute NULL DEF COMMENT \'PMA_comment\' FIRST, ADD PRIMARY KEY (`ids`)', $query );@@ -912,7 +864,7 @@ 'id' ); // Do not add PK since it is not a AUTO_INCREMENT- $this->assertEquals(+ self::assertSame( '`ids` INT(11) PMA_attribute AS (1) VIRTUAL NULL USER_DEFINED COMMENT \'PMA_comment\' FIRST', $query );@@ -944,7 +896,7 @@ $_SESSION = ['relation' => [$GLOBALS['server'] => $relationParameters->toArray()]]; $ret = Table::duplicateInfo('relwork', 'relation', $get_fields, $where_fields, $new_fields);- $this->assertSame(-1, $ret);+ self::assertSame(-1, $ret); } /**@@ -953,20 +905,14 @@ public function testIsUpdatableView(): void { $table = new Table('', '');- $this->assertFalse(- $table->isUpdatableView()- );+ self::assertFalse($table->isUpdatableView()); //validate that it is the same as DBI fetchResult $table = new Table('PMA_BookMark', 'PMA');- $this->assertTrue(- $table->isUpdatableView()- );+ self::assertTrue($table->isUpdatableView()); $table = new Table('PMA_BookMark_2', 'PMA');- $this->assertFalse(- $table->isUpdatableView()- );+ self::assertFalse($table->isUpdatableView()); } /**@@ -975,15 +921,10 @@ public function testIsMergeCase1(): void { $tableObj = new Table('PMA_BookMark', 'PMA');- $this->assertEquals(- '',- $tableObj->isMerge()- );+ self::assertEquals('', $tableObj->isMerge()); $tableObj = new Table('PMA_BookMark', 'PMA');- $this->assertFalse(- $tableObj->isMerge()- );+ self::assertFalse($tableObj->isMerge()); } /**@@ -999,9 +940,7 @@ ); $tableObj = new Table('PMA_BookMark', 'PMA');- $this->assertTrue(- $tableObj->isMerge()- );+ self::assertTrue($tableObj->isMerge()); } /**@@ -1017,9 +956,7 @@ ); $tableObj = new Table('PMA_BookMark', 'PMA');- $this->assertTrue(- $tableObj->isMerge()- );+ self::assertTrue($tableObj->isMerge()); } /**@@ -1028,9 +965,7 @@ public function testIsMergeCase4(): void { $tableObj = new Table('PMA_BookMark', 'PMA');- $this->assertFalse(- $tableObj->isMerge()- );+ self::assertFalse($tableObj->isMerge()); } /**@@ -1075,7 +1010,7 @@ . "charset1 NULL DEFAULT 'VARCHAR' " . "AUTO_INCREMENT COMMENT 'PMA comment' AFTER `new_name`";- $this->assertEquals($expect, $result);+ self::assertSame($expect, $result); } /**@@ -1091,37 +1026,31 @@ //rename to same name $table_new = 'PMA_BookMark'; $result = $table->rename($table_new);- $this->assertTrue($result);+ self::assertTrue($result); //isValidName //space in table name $table_new = 'PMA_BookMark '; $result = $table->rename($table_new);- $this->assertFalse($result);+ self::assertFalse($result); //empty name $table_new = ''; $result = $table->rename($table_new);- $this->assertFalse($result);+ self::assertFalse($result); //dot in table name $table_new = 'PMA_.BookMark'; $result = $table->rename($table_new);- $this->assertTrue($result);+ self::assertTrue($result); //message- $this->assertEquals(- 'Table PMA_BookMark has been renamed to PMA_.BookMark.',- $table->getLastMessage()- );+ self::assertSame('Table PMA_BookMark has been renamed to PMA_.BookMark.', $table->getLastMessage()); $table_new = 'PMA_BookMark_new'; $db_new = 'PMA_new'; $result = $table->rename($table_new, $db_new);- $this->assertTrue($result);+ self::assertTrue($result); //message- $this->assertEquals(- 'Table PMA_.BookMark has been renamed to PMA_BookMark_new.',- $table->getLastMessage()- );+ self::assertSame('Table PMA_.BookMark has been renamed to PMA_BookMark_new.', $table->getLastMessage()); } /**@@ -1139,7 +1068,7 @@ '`PMA`.`PMA_BookMark`.`index3`', '`PMA`.`PMA_BookMark`.`index5`', ];- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); } /**@@ -1160,7 +1089,7 @@ '`PMA`.`PMA_BookMark`.`ADD`', '`PMA`.`PMA_BookMark`.`ALL`', ];- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); } /**@@ -1188,10 +1117,7 @@ $tableObj = new Table('table', 'db');- $this->assertEquals(- $tableObj->getColumnsMeta(),- ['aNonValidExampleToRefactor']- );+ self::assertSame($tableObj->getColumnsMeta(), ['aNonValidExampleToRefactor']); } /**@@ -1228,7 +1154,7 @@ $sql_excepted = 'ALTER TABLE `PMA_table` ADD ' . 'FOREIGN KEY (`PMA_field1`, `PMA_field2`) REFERENCES ' . '`foreignDb`.`foreignTable`(`foreignField1`, `foreignField2`);';- $this->assertEquals($sql_excepted, $sql);+ self::assertSame($sql_excepted, $sql); // Exclude db name when relations are made between table in the same db $sql = $this->callFunction(@@ -1246,7 +1172,7 @@ $sql_excepted = 'ALTER TABLE `PMA_table` ADD ' . 'FOREIGN KEY (`PMA_field1`, `PMA_field2`) REFERENCES ' . '`foreignTable`(`foreignField1`, `foreignField2`);';- $this->assertEquals($sql_excepted, $sql);+ self::assertSame($sql_excepted, $sql); } /**@@ -1264,7 +1190,7 @@ $table = new Table($table, $db); $sql = $table->getSqlQueryForIndexCreateOrEdit($index, $error);- $this->assertEquals('ALTER TABLE `pma_db`.`pma_table` DROP PRIMARY KEY, ADD UNIQUE ;', $sql);+ self::assertSame('ALTER TABLE `pma_db`.`pma_table` DROP PRIMARY KEY, ADD UNIQUE ;', $sql); } /**@@ -1282,7 +1208,7 @@ $table = new Table($table, $db); $sql = $table->getSqlQueryForIndexCreateOrEdit($index, $error);- $this->assertEquals('ALTER TABLE `pma_db`.`pma_table` DROP PRIMARY KEY, ADD UNIQUE ;', $sql);+ self::assertSame('ALTER TABLE `pma_db`.`pma_table` DROP PRIMARY KEY, ADD UNIQUE ;', $sql); } /**@@ -1303,7 +1229,7 @@ '`PMA`.`PMA_BookMark`.`ADD`', '`PMA`.`PMA_BookMark`.`ALL`', ];- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); $return = $table->getReservedColumnNames(); $expect = [@@ -1311,7 +1237,7 @@ 'ADD', 'ALL', ];- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); } /**@@ -1354,17 +1280,17 @@ // Case 1 : Check if table is non-empty $return = $tableObj->checkIfMinRecordsExist(); $expect = true;- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); // Case 2 : Check if table contains at least 100 $return = $tableObj->checkIfMinRecordsExist(100); $expect = false;- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); // Case 3 : Check if table contains at least 100 $return = $tableObj->checkIfMinRecordsExist(100); $expect = true;- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); $GLOBALS['dbi'] = $old_dbi; }@@ -1374,14 +1300,20 @@ */ public function testCountRecords(): void {+ $resultStub = $this->createMock(DummyResult::class);+ $resultStub->expects($this->any())+ ->method('numRows')+ ->will($this->returnValue(20));++ $dbi = clone $GLOBALS['dbi'];+ $dbi->expects($this->any())->method('tryQuery')+ ->will($this->returnValue($resultStub));+ $table = 'PMA_BookMark'; $db = 'PMA';- $tableObj = new Table($table, $db);-- $this->assertEquals(- 20,- $tableObj->countRecords(true)- );+ $tableObj = new Table($table, $db, $dbi);++ self::assertSame(20, $tableObj->countRecords(true)); } /**@@ -1400,16 +1332,16 @@ $table->setUiProp($property, $value, $table_create_time); //set UI prop successfully- $this->assertEquals($value, $table->uiprefs[$property]);+ self::assertSame($value, $table->uiprefs[$property]); //removeUiProp $table->removeUiProp($property); $is_define_property = isset($table->uiprefs[$property]);- $this->assertFalse($is_define_property);+ self::assertFalse($is_define_property); //getUiProp after removeUiProp $is_define_property = $table->getUiProp($property);- $this->assertFalse($is_define_property);+ self::assertFalse($is_define_property); } /**@@ -1425,32 +1357,86 @@ $move = true; $mode = 'one_table';+ unset($GLOBALS['sql_drop_table']);++ $getTableMap = [+ [+ $target_db,+ $target_table,+ new Table($target_table, $target_db),+ ],+ [+ 'aa',+ 'ad',+ new Table('ad', 'aa'),+ ],+ ];+ $GLOBALS['dbi']->expects($this->any())->method('getTable')- ->will($this->returnValue(new Table($target_table, $target_db)));+ ->will($this->returnValueMap($getTableMap)); $return = Table::moveCopy($source_db, $source_table, $target_db, $target_table, $what, $move, $mode, true); //successfully $expect = true;- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); $sql_query = 'INSERT INTO `PMA_new`.`PMA_BookMark_new`(`COLUMN_NAME1`)' . ' SELECT `COLUMN_NAME1` FROM ' . '`PMA`.`PMA_BookMark`';- $this->assertStringContainsString($sql_query, $GLOBALS['sql_query']);+ self::assertStringContainsString($sql_query, $GLOBALS['sql_query']); $sql_query = 'DROP VIEW `PMA`.`PMA_BookMark`';- $this->assertStringContainsString($sql_query, $GLOBALS['sql_query']);+ self::assertStringContainsString($sql_query, $GLOBALS['sql_query']); $return = Table::moveCopy($source_db, $source_table, $target_db, $target_table, $what, false, $mode, true); //successfully $expect = true;- $this->assertEquals($expect, $return);+ self::assertSame($expect, $return); $sql_query = 'INSERT INTO `PMA_new`.`PMA_BookMark_new`(`COLUMN_NAME1`)' . ' SELECT `COLUMN_NAME1` FROM ' . '`PMA`.`PMA_BookMark`';- $this->assertStringContainsString($sql_query, $GLOBALS['sql_query']);+ self::assertStringContainsString($sql_query, $GLOBALS['sql_query']); $sql_query = 'DROP VIEW `PMA`.`PMA_BookMark`';- $this->assertStringNotContainsString($sql_query, $GLOBALS['sql_query']);+ self::assertStringNotContainsString($sql_query, $GLOBALS['sql_query']);++ // Renaming DB with a view bug+ $resultStub = $this->createMock(DummyResult::class);+ $GLOBALS['dbi']->expects($this->any())->method('tryQuery')+ ->will($this->returnValueMap([+ [+ 'SHOW CREATE TABLE `aa`.`ad`',+ 256,+ DatabaseInterface::QUERY_BUFFERED,+ true,+ $resultStub,+ ],+ ]));+ $resultStub->expects($this->any())+ ->method('fetchRow')+ ->will($this->returnValue([+ 'ad',+ 'CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`' .+ ' SQL SECURITY DEFINER VIEW `ad` AS select `aa`.`bb`.`ac` AS `ac` from `bb`',+ 'utf8mb4',+ 'utf8mb4_unicode_ci',+ ]));++ $GLOBALS['sql_query'] = '';+ $return = Table::moveCopy(+ 'aa',+ 'ad',+ 'bb',+ 'ad',+ 'structure',+ true,+ 'db_copy',+ true+ );+ self::assertTrue($return);+ self::assertStringContainsString('DROP TABLE IF EXISTS `bb`.`ad`;', $GLOBALS['sql_query']);+ self::assertStringContainsString('CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost`' .+ ' SQL SECURITY DEFINER VIEW `bb`.`ad` AS SELECT `bb`.`ac` AS `ac` FROM `bb` ;', $GLOBALS['sql_query']);+ self::assertStringContainsString('DROP VIEW `aa`.`ad`;', $GLOBALS['sql_query']); } /**@@ -1462,11 +1448,11 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = 'DBIDUMMY'; $tbl_storage_engine = $dbi->getTable($target_db, $target_table)->getStorageEngine();- $this->assertEquals($expect, $tbl_storage_engine);+ self::assertSame($expect, $tbl_storage_engine); } /**@@ -1478,11 +1464,11 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = 'Test comment for "table1" in \'pma_test\''; $show_comment = $dbi->getTable($target_db, $target_table)->getComment();- $this->assertEquals($expect, $show_comment);+ self::assertSame($expect, $show_comment); } /**@@ -1494,11 +1480,11 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = 'utf8mb4_general_ci'; $tbl_collation = $dbi->getTable($target_db, $target_table)->getCollation();- $this->assertEquals($expect, $tbl_collation);+ self::assertSame($expect, $tbl_collation); } /**@@ -1510,11 +1496,11 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = 'Redundant'; $row_format = $dbi->getTable($target_db, $target_table)->getRowFormat();- $this->assertEquals($expect, $row_format);+ self::assertSame($expect, $row_format); } /**@@ -1526,11 +1512,11 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = '5'; $auto_increment = $dbi->getTable($target_db, $target_table)->getAutoIncrement();- $this->assertEquals($expect, $auto_increment);+ self::assertSame($expect, $auto_increment); } /**@@ -1542,13 +1528,13 @@ $target_db = 'pma_test'; $extension = new DbiDummy(); $dbi = new DatabaseInterface($extension);- $tbl_object = new Table($target_db, $target_table, $dbi);+ $tbl_object = new Table($target_table, $target_db, $dbi); $tbl_object->getStatusInfo(null, true); $expect = [ 'pack_keys' => 'DEFAULT', 'row_format' => 'REDUNDANT', ]; $create_options = $dbi->getTable($target_db, $target_table)->getCreateOptions();- $this->assertEquals($expect, $create_options);+ self::assertEquals($expect, $create_options); } }
After analyzing the provided code diff, I don't identify any clear security vulnerabilities being fixed. The changes appear to be primarily test case additions and modifications to improve test coverage and functionality. Here's my analysis: 1. Vulnerability Existed: no The changes mainly involve: - Adding new test cases for view handling - Removing some mock expectations - Changing assertion methods (assertEquals to assertSame) - Adding functionality for view renaming during database copy operations 2. Vulnerability Existed: no The changes include test improvements for: - Table renaming functionality - Foreign key creation - Index handling - View operations 3. Vulnerability Existed: no The modifications focus on: - Better test coverage for table operations - More precise assertions - Handling of edge cases in test scenarios The diff shows significant test improvements but no obvious security fixes. The changes are primarily focused on: 1. Adding test cases for view handling in different schemas 2. Improving test assertions to be more strict (using assertSame instead of assertEquals) 3. Enhancing the test coverage for table operations 4. Fixing test mock setups 5. Adding functionality for proper view handling during database copy operations If there were any security implications, they would be related to the improved test coverage potentially catching edge cases, but no direct security vulnerabilities are being patched 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/js/config/ol/webpack.config.js+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/js/config/ol/webpack.config.js@@ -16,4 +16,7 @@ libraryTarget: 'umd', libraryExport: 'default', },+ optimization: {+ minimize: false,+ }, };
Analyzing the provided code diff for security fixes: 1. Vulnerability Existed: not sure [Potential Build Process Vulnerability] [js/config/ol/webpack.config.js] [Lines 16-19] [Old Code: No optimization/minification configuration] [Fixed Code: Added optimization with minimize: false] Additional Details: - The change adds an optimization configuration that disables minification (minimize: false) - This doesn't appear to be fixing a specific known vulnerability, but rather changing build behavior - Disabling minification could be related to debugging or source map generation, but doesn't directly indicate a security fix - Without more context about why this change was made, we can't definitively say it's a security fix No clear security vulnerability is being fixed here, just a build configuration change. The change might be related to making debugging easier or preventing potential issues with minified code, but this isn't a direct security fix for a known vulnerability.
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/Database/MultiTableQuery/TablesControllerTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php@@ -36,18 +36,15 @@ /** @var TablesController $multiTableQueryController */ $multiTableQueryController = $containerBuilder->get(TablesController::class); $multiTableQueryController();- $this->assertSame(- [- 'foreignKeyConstrains' => [- [- 'TABLE_NAME' => 'table2',- 'COLUMN_NAME' => 'idtable2',- 'REFERENCED_TABLE_NAME' => 'table1',- 'REFERENCED_COLUMN_NAME' => 'idtable1',- ],+ self::assertSame([+ 'foreignKeyConstrains' => [+ [+ 'TABLE_NAME' => 'table2',+ 'COLUMN_NAME' => 'idtable2',+ 'REFERENCED_TABLE_NAME' => 'table1',+ 'REFERENCED_COLUMN_NAME' => 'idtable1', ], ],- $this->getResponseJsonResult()- );+ ], $this->getResponseJsonResult()); } }
After analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be purely cosmetic/formatting changes in a test file. Here's the analysis: Vulnerability Existed: no No vulnerability found [test/classes/Controllers/Database/MultiTableQuery/TablesControllerTest.php] [Lines 36-54] [Old Code] - The original assertion with different formatting [Fixed Code] - The same assertion with reformatted array and using self::assertSame instead of $this->assertSame The changes made are: 1. Changed $this->assertSame to self::assertSame (common practice in PHPUnit tests) 2. Reformatted the array structure for better readability 3. Changed the closing parenthesis placement 4. No functional changes or security-related modifications were made This appears to be a code style/readability improvement rather than a 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/Dbal/WarningTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Dbal/WarningTest.php@@ -20,17 +20,17 @@ public function testWarning(array $row, string $level, int $code, string $message, string $toString): void { $warning = Warning::fromArray($row);- $this->assertSame($level, $warning->level);- $this->assertSame($code, $warning->code);- $this->assertSame($message, $warning->message);- $this->assertSame($toString, (string) $warning);+ self::assertSame($level, $warning->level);+ self::assertSame($code, $warning->code);+ self::assertSame($message, $warning->message);+ self::assertSame($toString, (string) $warning); } /** * @return int[][]|string[][]|string[][][] * @psalm-return array{string[], string, int, string, string}[] */- public function providerForTestWarning(): array+ public static function providerForTestWarning(): array { return [ [
After analyzing the provided code diff, I don't see any security-related changes. The changes appear to be test-related improvements and don't indicate any security vulnerabilities being fixed. Here's the analysis: 1. Vulnerability Existed: no Test Method Assertion Change [File] [Lines 20-23] [Old Code] $this->assertSame($level, $warning->level); $this->assertSame($code, $warning->code); $this->assertSame($message, $warning->message); $this->assertSame($toString, (string) $warning); [Fixed Code] self::assertSame($level, $warning->level); self::assertSame($code, $warning->code); self::assertSame($message, $warning->message); self::assertSame($toString, (string) $warning); 2. Vulnerability Existed: no Test Provider Method Change [File] [Lines 31] [Old Code] public function providerForTestWarning(): array [Fixed Code] public static function providerForTestWarning(): array The changes are: 1. Changing test assertions from instance method calls ($this->assertSame) to static method calls (self::assertSame) 2. Making a test data provider method static Neither of these changes relates to security vulnerabilities - they appear to be test code 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/libraries/classes/Controllers/Database/Structure/EmptyTableController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/Database/Structure/EmptyTableController.php@@ -14,6 +14,7 @@ use PhpMyAdmin\Operations; use PhpMyAdmin\ResponseRenderer; use PhpMyAdmin\Sql;+use PhpMyAdmin\Table; use PhpMyAdmin\Template; use PhpMyAdmin\Transformations; use PhpMyAdmin\Util;@@ -21,6 +22,7 @@ use function __; use function count;+use function is_string; final class EmptyTableController extends AbstractController {@@ -82,6 +84,10 @@ $selectedCount = count($selected); for ($i = 0; $i < $selectedCount; $i++) {+ if (! is_string($selected[$i]) || Table::get($selected[$i], $GLOBALS['db'], $this->dbi)->isView()) {+ continue;+ }+ $aQuery = 'TRUNCATE '; $aQuery .= Util::backquote($selected[$i]);
Analyzing the provided code diff, here's the security assessment: Vulnerability Existed: yes SQL Injection via Unvalidated Table Name [File] libraries/classes/Controllers/Database/Structure/EmptyTableController.php [Lines] 82-87 [Old Code] ```php for ($i = 0; $i < $selectedCount; $i++) { $aQuery = 'TRUNCATE '; $aQuery .= Util::backquote($selected[$i]); ``` [Fixed Code] ```php for ($i = 0; $i < $selectedCount; $i++) { if (! is_string($selected[$i]) || Table::get($selected[$i], $GLOBALS['db'], $this->dbi)->isView()) { continue; } $aQuery = 'TRUNCATE '; $aQuery .= Util::backquote($selected[$i]); ``` The fix adds two important security checks: 1. Validates that the table name is a string (preventing potential array/object injection) 2. Verifies the table isn't a view before truncating (preventing potential view manipulation) 3. While Util::backquote() provides some SQL injection protection, the additional validation makes the code more robust The vulnerability could have allowed SQL injection if non-string values were passed or if views were manipulated in unexpected ways. The fix properly validates input before using it in SQL operations.
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/Dbal/DatabaseNameTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/classes/Dbal/DatabaseNameTest.php@@ -42,8 +42,8 @@ public function testValidName(): void { $name = DatabaseName::fromValue('name');- $this->assertEquals('name', $name->getName());- $this->assertEquals('name', (string) $name);+ self::assertSame('name', $name->getName());+ self::assertSame('name', (string) $name); } /**@@ -62,7 +62,7 @@ * @return mixed[][] * @psalm-return non-empty-list<array{mixed, string}> */- public function providerForTestInvalidMixedNames(): array+ public static function providerForTestInvalidMixedNames(): array { return [ [null, 'Expected a string. Got: NULL'],
Based on the provided code diff, I don't see any security-related fixes. The changes appear to be test-related improvements and code style updates. Here's the analysis: 1. Vulnerability Existed: no Test Assertion Update [test/classes/Dbal/DatabaseNameTest.php] [Lines 44-45] Old Code: $this->assertEquals('name', $name->getName()); $this->assertEquals('name', (string) $name); Fixed Code: self::assertSame('name', $name->getName()); self::assertSame('name', (string) $name); Additional Details: This is a test improvement changing assertEquals to assertSame for stricter type checking in tests. 2. Vulnerability Existed: no Method Visibility Change [test/classes/Dbal/DatabaseNameTest.php] [Lines 62-63] Old Code: public function providerForTestInvalidMixedNames(): array Fixed Code: public static function providerForTestInvalidMixedNames(): array Additional Details: This changes a test data provider method to be static, which is a common test pattern improvement but not security-related. No security vulnerabilities were identified in this diff. The changes are focused on 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/libraries/classes/Gis/GisLineString.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Gis/GisLineString.php@@ -52,13 +52,14 @@ * @param string $spatial spatial data of a row * * @return array an array containing the min, max values for x and y coordinates+ * @psalm-return array{minX:float,minY:float,maxX:float,maxY:float} */ public function scaleRow($spatial) { // Trim to remove leading 'LINESTRING(' and trailing ')' $linestring = mb_substr($spatial, 11, -1);- return $this->setMinMax($linestring, []);+ return $this->setMinMax($linestring, GisGeometry::EMPTY_EXTENT); } /**@@ -182,7 +183,7 @@ public function prepareRowAsSvg($spatial, $label, $line_color, array $scale_data) { $line_options = [- 'name' => $label,+ 'data-label' => $label, 'id' => $label . $this->getRandomId(), 'class' => 'linestring vector', 'fill' => 'none',
Analyzing the provided code diff, I can identify two potential security fixes: 1. First vulnerability fix: Vulnerability Existed: not sure [Potential Type Safety Improvement] [libraries/classes/Gis/GisLineString.php] [Lines 52-60] [Old Code] return $this->setMinMax($linestring, []); [Fixed Code] return $this->setMinMax($linestring, GisGeometry::EMPTY_EXTENT); Additional Details: The change replaces an empty array with a defined constant, which might prevent potential type-related issues or undefined behavior, though it's not clearly a security vulnerability. 2. Second vulnerability fix: Vulnerability Existed: yes [XSS (Cross-Site Scripting) Prevention] [libraries/classes/Gis/GisLineString.php] [Lines 182-186] [Old Code] 'name' => $label, [Fixed Code] 'data-label' => $label, Additional Details: The change from 'name' attribute to 'data-label' helps prevent potential XSS attacks by moving user-provided label data from a standard HTML attribute to a data attribute, which is less likely to be executed as script content. This is a common XSS mitigation technique.
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/JavaScriptMessagesController.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Controllers/JavaScriptMessagesController.php@@ -40,7 +40,7 @@ 'strDoYouReally' => __('Do you really want to execute "%s"?'), 'strDropDatabaseStrongWarning' => __('You are about to DESTROY a complete database!'), 'strDatabaseRenameToSameName' => __(- 'Cannot rename database to the same name. Change the name and try again'+ 'Cannot rename database to the same name. Change the name and try again.' ), 'strDropTableStrongWarning' => __('You are about to DESTROY a complete table!'), 'strTruncateTableStrongWarning' => __('You are about to TRUNCATE a complete table!'),@@ -118,7 +118,6 @@ /* For Simulate DML*/ 'strSimulateDML' => __('Simulate query'),- 'strMatchedRows' => __('Matched rows:'), 'strSQLQuery' => __('SQL query:'), /* Charts */@@ -386,6 +385,7 @@ 'strHideQueryBox' => __('Hide query box'), 'strShowQueryBox' => __('Show query box'), 'strEdit' => __('Edit'),+ 'strEditQuery' => __('Edit query'), 'strDelete' => __('Delete'), 'strNotValidRowNumber' => __('%d is not valid row number.'), 'strBrowseForeignValues' => __('Browse foreign values'),@@ -473,6 +473,7 @@ /* For table/change.js */ 'strIgnore' => __('Ignore'),+ 'strCopyToClipboard' => __('Copy to clipboard'), 'strCopy' => __('Copy'), 'strX' => __('X'), 'strY' => __('Y'),@@ -609,6 +610,7 @@ /* l10n: Latest available phpMyAdmin version */ 'strLatestAvailable' => __(', latest stable version:'), 'strUpToDate' => __('up to date'),+ 'errorLoadingGitInformation' => __('There was an error in loading the Git information.'), /* Error Reporting */ 'strErrorOccurred' => __('A fatal JavaScript error has occurred. Would you like to send an error report?'),
After analyzing the provided code diff, I don't see any clear security vulnerabilities being fixed. The changes appear to be primarily related to localization strings, message improvements, and feature additions rather than security patches. Here's the analysis: 1. Vulnerability Existed: no Localization string update [File] libraries/classes/Controllers/JavaScriptMessagesController.php [Lines] 40-43 [Old Code] 'Cannot rename database to the same name. Change the name and try again' [Fixed Code] 'Cannot rename database to the same name. Change the name and try again.' 2. Vulnerability Existed: no Localization string removal [File] libraries/classes/Controllers/JavaScriptMessagesController.php [Lines] 118-121 [Old Code] 'strMatchedRows' => __('Matched rows:'), [Fixed Code] (removed line) 3. Vulnerability Existed: no Localization string additions [File] libraries/classes/Controllers/JavaScriptMessagesController.php [Lines] 386-389 [Old Code] (no corresponding line) [Fixed Code] 'strEditQuery' => __('Edit query'), 4. Vulnerability Existed: no Localization string additions [File] libraries/classes/Controllers/JavaScriptMessagesController.php [Lines] 473-476 [Old Code] (no corresponding line) [Fixed Code] 'strCopyToClipboard' => __('Copy to clipboard'), 5. Vulnerability Existed: no Localization string additions [File] libraries/classes/Controllers/JavaScriptMessagesController.php [Lines] 609-612 [Old Code] (no corresponding line) [Fixed Code] 'errorLoadingGitInformation' => __('There was an error in loading the Git information.'), The changes are all related to: 1. Adding a missing period in a message string 2. Removing an unused localization string ('strMatchedRows') 3. Adding new localization strings for features ('strEditQuery', 'strCopyToClipboard', 'errorLoadingGitInformation') No security-related changes were identified in this diff. All modifications appear to be related to localization improvements and feature additions.
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/Operations.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Operations.php@@ -10,7 +10,6 @@ use PhpMyAdmin\Plugins\Export\ExportSql; use function __;-use function array_keys; use function array_merge; use function count; use function explode;@@ -124,23 +123,23 @@ /** * Get views as an array and create SQL view stand-in *- * @param array $tables_full array of all tables in given db or dbs+ * @param string[] $tables array of all tables in given db or dbs * @param ExportSql $export_sql_plugin export plugin instance * @param string $db database name * * @return array */ public function getViewsAndCreateSqlViewStandIn(- array $tables_full,+ array $tables, $export_sql_plugin, $db ) { $views = [];- foreach (array_keys($tables_full) as $each_table) {+ foreach ($tables as $table) { // to be able to rename a db containing views, // first all the views are collected and a stand-in is created // the real views are created after the tables- if (! $this->dbi->getTable($db, (string) $each_table)->isView()) {+ if (! $this->dbi->getTable($db, $table)->isView()) { continue; }@@ -148,15 +147,15 @@ if ($_POST['what'] !== 'nocopy' && isset($_POST['drop_if_exists']) && $_POST['drop_if_exists'] === 'true') { $drop_query = 'DROP VIEW IF EXISTS ' . Util::backquote($_POST['newname']) . '.'- . Util::backquote($each_table);+ . Util::backquote($table); $this->dbi->query($drop_query); $GLOBALS['sql_query'] .= "\n" . $drop_query . ';'; }- $views[] = $each_table;+ $views[] = $table; // Create stand-in definition to resolve view dependencies- $sql_view_standin = $export_sql_plugin->getTableDefStandIn($db, $each_table, "\n");+ $sql_view_standin = $export_sql_plugin->getTableDefStandIn($db, $table, "\n"); $this->dbi->selectDb($_POST['newname']); $this->dbi->query($sql_view_standin); $GLOBALS['sql_query'] .= "\n" . $sql_view_standin;@@ -168,18 +167,18 @@ /** * Get sql query for copy/rename table and boolean for whether copy/rename or not *- * @param array $tables_full array of all tables in given db or dbs- * @param bool $move whether database name is empty or not- * @param string $db database name+ * @param string[] $tables array of all tables in given db or dbs+ * @param bool $move whether database name is empty or not+ * @param string $db database name * * @return array SQL queries for the constraints */- public function copyTables(array $tables_full, $move, $db)+ public function copyTables(array $tables, $move, $db) { $sqlContraints = [];- foreach (array_keys($tables_full) as $each_table) {+ foreach ($tables as $table) { // skip the views; we have created stand-in definitions- if ($this->dbi->getTable($db, (string) $each_table)->isView()) {+ if ($this->dbi->getTable($db, $table)->isView()) { continue; }@@ -188,7 +187,7 @@ // do not copy the data from a Merge table // note: on the calling FORM, 'data' means 'structure and data'- if ($this->dbi->getTable($db, (string) $each_table)->isMerge()) {+ if ($this->dbi->getTable($db, $table)->isMerge()) { if ($this_what === 'data') { $this_what = 'structure'; }@@ -205,14 +204,14 @@ // keep the triggers from the original db+table // (third param is empty because delimiters are only intended // for importing via the mysql client or our Import feature)- $triggers = $this->dbi->getTriggers($db, (string) $each_table, '');+ $triggers = $this->dbi->getTriggers($db, $table, ''); if ( ! Table::moveCopy( $db,- $each_table,+ $table, $_POST['newname'],- $each_table,+ $table, ($this_what ?? 'data'), $move, 'db_copy',@@ -346,8 +345,7 @@ $this->dbi->query($query_proc_specific); // Finally FLUSH the new privileges- $flush_query = 'FLUSH PRIVILEGES;';- $this->dbi->query($flush_query);+ $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /**@@ -443,8 +441,7 @@ } // Finally FLUSH the new privileges- $flush_query = 'FLUSH PRIVILEGES;';- $this->dbi->query($flush_query);+ $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /**@@ -817,8 +814,7 @@ $this->dbi->query($query_col_specific); // Finally FLUSH the new privileges- $flush_query = 'FLUSH PRIVILEGES;';- $this->dbi->query($flush_query);+ $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /**@@ -872,8 +868,7 @@ } // Finally FLUSH the new privileges- $flush_query = 'FLUSH PRIVILEGES;';- $this->dbi->query($flush_query);+ $this->dbi->tryQuery('FLUSH PRIVILEGES;'); } /**
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: yes SQL Injection Vulnerability [libraries/classes/Operations.php] [Lines 124-167] [Old Code] ```php public function getViewsAndCreateSqlViewStandIn( array $tables_full, $export_sql_plugin, $db ) { $views = []; foreach (array_keys($tables_full) as $each_table) { if (! $this->dbi->getTable($db, (string) $each_table)->isView()) { continue; } ``` [Fixed Code] ```php public function getViewsAndCreateSqlViewStandIn( array $tables, $export_sql_plugin, $db ) { $views = []; foreach ($tables as $table) { if (! $this->dbi->getTable($db, $table)->isView()) { continue; } ``` 2. Vulnerability Existed: yes SQL Injection Vulnerability [libraries/classes/Operations.php] [Lines 168-230] [Old Code] ```php public function copyTables(array $tables_full, $move, $db) { $sqlContraints = []; foreach (array_keys($tables_full) as $each_table) { if ($this->dbi->getTable($db, (string) $each_table)->isView()) { continue; } ``` [Fixed Code] ```php public function copyTables(array $tables, $move, $db) { $sqlContraints = []; foreach ($tables as $table) { if ($this->dbi->getTable($db, $table)->isView()) { continue; } ``` 3. Vulnerability Existed: yes Error Handling Improvement [libraries/classes/Operations.php] [Lines 346, 441, 814, 868] [Old Code] ```php $flush_query = 'FLUSH PRIVILEGES;'; $this->dbi->query($flush_query); ``` [Fixed Code] ```php $this->dbi->tryQuery('FLUSH PRIVILEGES;'); ``` Analysis: 1. The first two vulnerabilities involve potential SQL injection risks where table names were being cast to strings without proper sanitization. The fix changes the parameter handling to use the array values directly rather than array keys with string casting. 2. The third change improves error handling by replacing direct query execution with tryQuery() for FLUSH PRIVILEGES operations, which is more robust against potential failures. The changes appear to address potential security issues related to SQL injection and improve error handling in privilege management operations.
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/Export.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/libraries/classes/Export.php@@ -749,6 +749,13 @@ } $views = [];++ if ($tables !== []) {+ // Prefetch table information to improve performance.+ // Table status will get saved in Query Cache,+ // and all instantiations of Table below should be much faster.+ $this->dbi->getTablesFull($db, $tables);+ } foreach ($tables as $table) { $tableObject = new Table($table, $db);
Based on the provided code diff, here's the analysis: Vulnerability Existed: no [Performance Improvement] [libraries/classes/Export.php] [Lines 749-756] [Old Code] $views = []; [Fixed Code] $views = []; if ($tables !== []) { // Prefetch table information to improve performance. // Table status will get saved in Query Cache, // and all instantiations of Table below should be much faster. $this->dbi->getTablesFull($db, $tables); } Additional Details: - This appears to be a performance optimization rather than a security fix - The change adds prefetching of table information when tables are present - No obvious security vulnerability is being addressed in this change - The modification is focused on improving efficiency by caching table information - The comment explicitly mentions this is for performance 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/selenium/Database/StructureTest.php+++ /root/PatchLeaks-main/products/phpmyadmin_downloads/RELEASE_5_2_2/phpmyadmin-RELEASE_5_2_2/test/selenium/Database/StructureTest.php@@ -51,19 +51,17 @@ $this->waitForElement('cssSelector', 'button.submitOK')->click();- $this->assertNotNull(- $this->waitForElement(- 'xpath',- '//div[@class=\'alert alert-success\' and contains(., \'MySQL returned an empty result\')]'- )- );+ self::assertNotNull($this->waitForElement(+ 'xpath',+ '//div[@class=\'alert alert-success\' and contains(., \'MySQL returned an empty result\')]'+ )); $this->dbQuery( 'SELECT CONCAT("Count: ", COUNT(*)) as c FROM `' . $this->databaseName . '`.`test_table`', function (): void {- $this->assertTrue($this->isElementPresent('className', 'table_results'));+ self::assertTrue($this->isElementPresent('className', 'table_results')); // [ ] | Edit | Copy | Delete | 1 | 5- $this->assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1));+ self::assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); } ); }@@ -90,7 +88,8 @@ $this->dbQuery( 'SHOW TABLES FROM `' . $this->databaseName . '`;', function (): void {- $this->assertFalse($this->isElementPresent('className', 'table_results'));+ self::assertTrue($this->isElementPresent('className', 'table_results'));+ self::assertFalse($this->isElementPresent('cssSelector', '.table_results tbody tr')); } ); }
Analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be test code improvements and assertions updates rather than security fixes. Here's the analysis: 1. Vulnerability Existed: no Test Assertion Improvements [test/selenium/Database/StructureTest.php] [Lines 51-88] [Old Code] $this->assertNotNull( $this->waitForElement( 'xpath', '//div[@class=\'alert alert-success\' and contains(., \'MySQL returned an empty result\')]' ) ); $this->assertTrue($this->isElementPresent('className', 'table_results')); $this->assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); $this->assertFalse($this->isElementPresent('className', 'table_results')); [Fixed Code] self::assertNotNull($this->waitForElement( 'xpath', '//div[@class=\'alert alert-success\' and contains(., \'MySQL returned an empty result\')]' )); self::assertTrue($this->isElementPresent('className', 'table_results')); self::assertEquals('Count: 0', $this->getCellByTableClass('table_results', 1, 1)); self::assertTrue($this->isElementPresent('className', 'table_results')); self::assertFalse($this->isElementPresent('cssSelector', '.table_results tbody tr')); The changes consist of: 1. Changing test assertions from instance method calls ($this->assert...) to static method calls (self::assert...) 2. Adding an additional assertion in the empty tables test case 3. No security-related changes are apparent 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.