XF 2.2 base and exponent overflow

ehd

Well-known member
HI,

as of today I get a lot of errors:

What could that cause?

Thanks!

#0 src/vendor/web-token/jwt-util-ecc/Math.php(53): gmp_pow(Object(GMP), 2)
#1 src/vendor/web-token/jwt-util-ecc/Curve.php(110): Jose\Component\Core\Util\Ecc\Math::pow(Object(GMP), 2)
#2 src/vendor/web-token/jwt-util-ecc/Curve.php(81): Jose\Component\Core\Util\Ecc\Curve->contains(Object(GMP), Object(GMP))
#3 src/vendor/web-token/jwt-util-ecc/Curve.php(101): Jose\Component\Core\Util\Ecc\Curve->getPoint(Object(GMP), Object(GMP))
#4 src/vendor/minishlink/web-push/src/Encryption.php(96): Jose\Component\Core\Util\Ecc\Curve->getPublicKeyFrom(Object(GMP), Object(GMP))
#5 src/vendor/minishlink/web-push/src/Encryption.php(59): Minishlink\WebPush\Encryption::deterministicEncrypt('{"title":"Neuer...', [invalid], [invalid], 'aes128gcm', Array, [invalid])
#6 src/vendor/minishlink/web-push/src/WebPush.php(220): Minishlink\WebPush\Encryption::encrypt('{"title":"Neuer...', 'BLq2b6mHEU3gqwC...', 'mEsfchTMVhS896n...', 'aes128gcm')
#7 src/vendor/minishlink/web-push/src/WebPush.php(168): Minishlink\WebPush\WebPush->prepare(Array)
#8 src/XF/Service/PushNotification.php(209): Minishlink\WebPush\WebPush->flush()
#9 src/XF/Service/PushNotification.php(179): XF\Service\PushNotification->handleResults(Object(Generator))
#10 src/XF/Service/PusherTrait.php(194): XF\Service\PushNotification->sendNotifications()
#11 src/XF/Repository/UserAlert.php(165): XF\Service\Alert\Pusher->push()
#12 src/XF/Repository/UserAlert.php(103): XF\Repository\UserAlert->insertAlert(78370, 37665, '...', 'post', 6137333, 'reaction', Array, Array)
#13 src/addons/Truonglv/IgnoreContent/XF/Repository/UserAlert.php(81): XF\Repository\UserAlert->alertFromUser(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 'post', 6137333, 'reaction', Array, Array)
#14 src/XF/Reaction/AbstractHandler.php(187): Truonglv\IgnoreContent\XF\Repository\UserAlert->alertFromUser(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 'post', 6137333, 'reaction', Array)
#15 src/XF/Repository/Reaction.php(203): XF\Reaction\AbstractHandler->sendReactionAlert(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 6137333, Object(SV\ElasticSearchEssentials\XF\Entity\Post), 1)
#16 src/XF/Repository/Reaction.php(143): XF\Repository\Reaction->insertReaction(1, 'post', 6137333, Object(SV\DailyStatistics\XF\Entity\User), true, false)
#17 src/XF/ControllerPlugin/Reaction.php(62): XF\Repository\Reaction->reactToContent(1, 'post', 6137333, Object(SV\DailyStatistics\XF\Entity\User), true)
#18 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(SV\ElasticSearchEssentials\XF\Entity\Post), 'posts/reactions', 'posts')
#19 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(SV\ElasticSearchEssentials\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#20 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(SV\ElasticSearchEssentials\XF\Entity\Post), 'posts')
#21 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#22 src/XF/Mvc/Dispatcher.php(258): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Post), NULL)
#23 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Post), NULL)
#24 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#25 src/XF/App.php(2485): XF\Mvc\Dispatcher->run()
#26 src/XF.php(524): XF\App->run()
#27 index.php(20): XF::runApp('XF\\Pub\\App')
#28 {main}
Status der Anfrage
array(4) {
["url"] => string(40) "/forum/posts/6137333/react?reaction_id=1"
["referrer"] => string(91) "...page-10780"
["_GET"] => array(1) {
["reaction_id"] => string(1) "1"
}
["_POST"] => array(4) {
["_xfRequestUri"] => string(60) "/forum/.../page-10780"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
["_xfResponseType"] => string(4) "json"
}
}
 
Totally understand. I noticed this error was also causing double posts due to refreshing and posting after receiving the math error so went ahead and upgraded to the stable version of XF. No issues.
 
Last edited:
I did two things to solve this issue:
1. I disabled all caches via config.php including CSS cache and redis cache (also the regular XF based cache or any other caches your have under config.php)

2. I've edited the Math.PHP file under src -> vendor -> web-token->jwt-util-ecc
backup what you have now and replace line 53
from:
Code:
return \gmp_pow($base, $exponent);

to:
Code:
return $base ** $exponent;

clear cloudflare cache as well after all of that and see if it helped...
 
Totally understand. I noticed this error was also causing double posts due to refreshing and posting after receiving the math error so went ahead and upgraded to the stable version odf XF. No issues.
2.2.16 is the last stable and as PHP 8.2 compatible market in the XF 2.2 series. But since certain days, it isnt any more for now.

I did two things to solve this issue:
1. I disabled all caches via config.php including CSS cache and redis cache (also the regular XF based cache or any other caches your have under config.php)

2. I've edited the Math.PHP file under src -> vendor -> web-token->jwt-util-ecc
backup what you have now and replace line 53
from:
return \gmp_pow($base, $exponent);
to:
return $base ** $exponent;
clear cloudflare cache as well after all of that and see if it helped...
I will give it a try and tell you if it works for me. Thanks a lot. :-)
 
I did two things to solve this issue:
1. I disabled all caches via config.php including CSS cache and redis cache (also the regular XF based cache or any other caches your have under config.php)

2. I've edited the Math.PHP file under src -> vendor -> web-token->jwt-util-ecc
backup what you have now and replace line 53
from:
Code:
return \gmp_pow($base, $exponent);

to:
Code:
return $base ** $exponent;

clear cloudflare cache as well after all of that and see if it helped...

It would be interesting to see an official response. Submitted a support ticket.
 
Same Problem here. XF 2.2.15 and since over a year PHP 8.2. Now suddenly double postings and the mentioned errors.

I changed to PHP 8.3, but still get the error

ValueError: base and exponent overflow in src/vendor/web-token/jwt-util-ecc/Math.php at line 53
 
Back
Top Bottom