The vulnerability lies in the Engine.IO server's handling of transport upgrades. The BaseServer.verify function, which is called when a client tries to re-establish a connection or upgrade the transport, failed to check if the protocol version (EIO parameter) of the new request matched the protocol version of the existing session. An attacker could establish a session with one protocol version (e.g., v4) and then send an upgrade request with a different or omitted protocol version (which defaults to v3). This would cause the server to use an inconsistent parser and heartbeat behavior for the upgraded transport, leading to an uncaught exception and a process crash when a crafted heartbeat packet is received. The patch fixes this by adding an explicit protocol version check in the BaseServer.verify function. The BaseServer.handshake function is also relevant as it's the entry point for establishing the initial session and protocol version that is later exploited.