PadMessageHandler: prohibit reading of message.data.padId

This commit is contained in:
webzwo0i 2022-02-24 00:11:08 +01:00
parent 32c82917e3
commit 1d395bf70b

View file

@ -250,6 +250,12 @@ exports.handleMessage = async (socket, message) => {
throw new Error('message.padId must not be accessed (for security reasons)');
}});
if (message.data) {
Object.defineProperty(message.data, 'padId', {get: () => {
throw new Error('message.data.padId must not be accessed (for security reasons)');
}});
}
const auth = thisSession.auth;
if (!auth) {
const ip = settings.disableIPlogging ? 'ANONYMOUS' : (socket.request.ip || '<unknown>');