Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
change cjson to cjson.safe and cath error from decode function
Wuriyanto1b8e5d0244d0
diff --git a/resources/prosody-plugins/token/util.lib.lua b/resources/prosody-plugins/token/util.lib.luaindex c18bdd4872..72af078dbe 100644--- a/resources/prosody-plugins/token/util.lib.lua+++ b/resources/prosody-plugins/token/util.lib.lua@@ -7,7 +7,7 @@ local hex = require "util.hex";local jwt = require "luajwtjitsi";local http = require "net.http";local jid = require "util.jid";-local json = require "cjson";+local json_safe = require "cjson.safe";local path = require "util.paths";local sha256 = require "util.hashes".sha256;local timer = require "util.timer";@@ -255,7 +255,10 @@ function Util:process_and_verify_token(session)if self.asapKeyServer and session.auth_token ~= nil thenlocal dotFirst = session.auth_token:find("%.");if not dotFirst then return nil, "Invalid token" end- local header = json.decode(basexx.from_url64(session.auth_token:sub(1,dotFirst-1)));+ local header, err = json_safe.decode(basexx.from_url64(session.auth_token:sub(1,dotFirst-1)));+ if err then+ return false, "not-allowed", "bad token format";+ endlocal kid = header["kid"];if kid == nil thenreturn false, "not-allowed", "'kid' claim is missing";@@ -398,4 +401,4 @@ function Util:verify_room(session, room_address)endend-return Util;+return Util;\ No newline at end of file