fix: correct destructuring of user object to enhance security in SEA

This commit is contained in:
x 2025-02-26 11:49:01 +07:00
parent af2fbf7ccd
commit 8f344d03b0

View File

@ -140,7 +140,7 @@
// Localize some opt props, and delete the original refs to prevent possible attacks
const opt = (msg._.msg || {}).opt || {}
const authenticator = opt.authenticator || (user._).sea;
const authenticator = opt.authenticator || (user._ || {}).sea;
const upub = opt.authenticator ? (opt.pub || (user.is || {}).pub || pub) : (user.is || {}).pub;
const cert = opt.cert;
delete opt.authenticator; delete opt.pub;