Skip to content

Commit 21ddecd

Browse files
MoonEibennetch
authored andcommitted
Fix quadratic complexity of certain queries, thanks to work by
Maximilian Krög <maxi_kroeg@web.de>. This is phpMyAdmin security issue #359. Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
1 parent 439b54d commit 21ddecd

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixed
66

77
- Add "RECURSIVE" on build() for "WITH RECURSIVE" on the WithStatement class (#605)
8+
- Fix for quadratic complexity in certain queries, which could have caused long execution times. Thanks to Maximilian Krög (GitHub user MoonE) for this security-related fix.
89

910
## [5.10.2] - 2024-12-05
1011

src/Lexer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,7 @@ public function parseNumber()
892892
) {
893893
// A number can't be directly followed by a letter
894894
$state = -$state;
895+
break;
895896
} elseif ($this->str[$this->last] < '0' || $this->str[$this->last] > '9') {
896897
// Just digits and `.`, `e` and `E` are valid characters.
897898
break;
@@ -906,6 +907,7 @@ public function parseNumber()
906907
) {
907908
// A number can't be directly followed by a letter
908909
$state = -$state;
910+
break;
909911
} elseif ($this->str[$this->last] < '0' || $this->str[$this->last] > '9') {
910912
// Just digits, `e` and `E` are valid characters.
911913
break;
@@ -923,6 +925,7 @@ public function parseNumber()
923925
) {
924926
// A number can't be directly followed by a letter
925927
$state = -$state;
928+
break;
926929
} else {
927930
break;
928931
}

0 commit comments

Comments
 (0)