The vulnerability is an out-of-bounds read in the PEM password callback mechanism of the rust-openssl library. The root cause lies in the openssl::util::invoke_passwd_cb function, which acts as a trampoline for handling password callbacks from the user. This function would take the length value returned by a user-provided callback and pass it directly to the native OpenSSL library without first validating that the length was within the bounds of the buffer that was provided to the callback.
The patch rectifies this by adding a check in invoke_passwd_cb. If the callback returns a length len that is greater than the buffer size size, the function now returns 0 to OpenSSL, indicating an error, thus preventing the out-of-bounds read.
The vulnerability is exposed through public API functions that use this password callback mechanism, named with the pattern *_from_pem_callback. The patch includes a test case that uses openssl::ec::EcKey::private_key_from_pem_callback to demonstrate the vulnerability and its fix. Therefore, any runtime profile during exploitation would show this function, or other similar *_from_pem_callback functions, in the call stack leading to the vulnerable invoke_passwd_cb.