The vulnerability, identified as GHSA-2r8v-p65x-3663, is a critical flaw in the erlang_quic library where the QUIC client fails to authenticate the server during the TLS 1.3 handshake. This allows a man-in-the-middle attacker to impersonate any server by presenting an arbitrary certificate. The analysis of the patch that fixes this vulnerability reveals the exact functions where this lapse occurred.
The primary functions involved are quic_connection:init_client_state/7 and quic_connection:process_tls_message/4. The init_client_state function in the vulnerable versions had certificate verification (verify) disabled by default. Even when manually enabled, the process_tls_message function, which handles the TLS handshake messages, lacked the code to perform the actual validation of the certificate chain and hostname. The patch rectifies this by enabling verification by default, and adding the necessary validation logic within process_tls_message by introducing new functions like verify_server_authentication/4 and quic_cert:validate_server/4.
Therefore, the identified vulnerable functions are the ones that should have performed the certificate validation but did not. During a runtime exploitation scenario, these functions would be on the execution stack as the client processes the malicious server's TLS handshake, making them the key indicators of this vulnerability being triggered.