Check connection is ready in all connection required handlers #3095
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is for https://github.com/hyperledger/aries-cloudagent-python/security/advisories/GHSA-cxwq-rwgr-qp5m.
I'm pretty sure this fixes the main issues reported with basic_messages and handshake_reuse protocols. I also applied the connection ready check to all other protocols that were missing and that I think need an established connection.
I didn't apply it to any problem report protocols because I don't think a connection is required in the cases. I'm not entirely sure if the problem report protocols could still be exploited in this way. Maybe an nefarious actor could send problem reports before the connection was established and cause issues?
The details of all these protocols isn't a strong point for me. I did my best to remediate the problem but I good review by someone more knowledgeable would be appreciated.