[Jitsi-Meet] JWT Forgery due to Using a Public Key as a Shared Secret

We discussed this vulnerability as part of our weekly podcast on 30 November 2021

It was possible to forge JWT tokens due to an unchecked constraint when processing the JWT before verifying. In one function the token would be “processed” as in it would pull out the relative information, passing it into Util:verify_token(token, secret, acceptedIssuers)

During processing the public key would be pulled out of the token and passed in as the secret to the verifying function. The problem is that it did not ensure the tokens algorithm actually used a public key as opposed to a shared secret. As such an attacker could change the alg in the JWT to a symmetric algorithm, having it used the trusted public key as a shared secret enabling forgery.

Patch - https://github.com/jitsi/jitsi-meet/pull/9319/commits/c6b0ff79a3727608130b6e54516f3e188ef32c56

The patch just checks that the algorithm is one of the expected algorithms.