mqttjs / mqtt-packet

Parse and generate MQTT packets like a breeze in JS
Other
206 stars 93 forks source link

Buffer out of bounds when v5 connection request sent to v4 server #99

Closed bkp7 closed 3 years ago

bkp7 commented 3 years ago

Caused by trying to decode a V4 connack using code expecting a V5 connack (because V5 has been set in options).

Underlying issue traced to _parseVarByteNum function in parser.js which doesn't check buffer length before reading additional UInt8.