Headline
CVE-2023-0311: fix: check captcha length correctly and fix type error · thorsten/phpMyFAQ@fe6e9f0
Improper Authentication in GitHub repository thorsten/phpmyfaq prior to 3.1.10.
@@ -434,7 +434,7 @@ private function drawText()
$codeLength = Strings::strlen($this->code);
$numFonts = count($this->fonts);
$w1 = 15;
$w2 = $this->width / ($codeLength + 1);
$w2 = floor($this->width / ($codeLength + 1));
for ($p = 0; $p < $codeLength; ++$p) {
$letter = $this->code[$p];
@@ -515,7 +515,7 @@ public function checkCaptchaCode(string $code): bool
public function validateCaptchaCode(string $captchaCode): bool
{
// Sanity check
if (0 === Strings::strlen($captchaCode)) {
if (Strings::strlen($captchaCode) !== $this->captchaLength) {
return false;
}
Related news
GHSA-g92r-9rxw-cmgx: phpMyFAQ Improper Authentication vulnerability
Improper Authentication in GitHub repository thorsten/phpmyfaq prior to 3.1.10.