The vulnerability lies in the webtransport-go library's handling of WT_CLOSE_SESSION capsules. According to the WebTransport over HTTP/3 specification, the application error message within this capsule should not exceed 1024 bytes. However, the library failed to enforce this limit.
The analysis of the patch that fixes this vulnerability, commit 89a80614cd565f6bbac6ed58b2c7207a72a10602, clearly shows the vulnerable code and the fix. The function Session.parseNextCapsule in session.go is responsible for parsing incoming capsules.
Before the patch, the code used io.ReadAll(r) to read the error message from the capsule's reader r. This reads until an EOF is encountered, meaning a remote peer could send an arbitrarily large payload, which would be buffered entirely in memory.
The fix replaces this unbounded read with io.ReadAll(io.LimitReader(r, maxCloseCapsuleErrorMsgLen)), where maxCloseCapsuleErrorMsgLen is set to 1024. This ensures that at most 1024 bytes are read for the error message, mitigating the memory exhaustion vulnerability.
Therefore, during an exploit, the Session.parseNextCapsule function would be present in the runtime profile as it processes the malicious, oversized WT_CLOSE_SESSION capsule.