Skip to content

fix:reject non-STATUS messages on discovery channels#133

Open
xxo1shine wants to merge 1 commit into
tronprotocol:release-v2.2.8from
xxo1shine:fix/discovery-mode-reject-non-status
Open

fix:reject non-STATUS messages on discovery channels#133
xxo1shine wants to merge 1 commit into
tronprotocol:release-v2.2.8from
xxo1shine:fix/discovery-mode-reject-non-status

Conversation

@xxo1shine
Copy link
Copy Markdown
Contributor

What does this PR do?

A peer can reply with a HelloMessage on a discovery probe channel to trick the node into running the full handshake path: the channel ends up in ChannelManager.channels, onConnect fires, and finishHandshake is set, polluting the connection table and consuming a maxConnections slot. Guard processMessage so a channel in discoveryMode only accepts STATUS and is closed otherwise.

Why are these changes required?

This PR has been tested by:

  • Unit Tests

Extra details

A peer can reply with a HelloMessage on a discovery probe channel to
trick the node into running the full handshake path: the channel ends
up in ChannelManager.channels, onConnect fires, and finishHandshake is
set, polluting the connection table and consuming a maxConnections slot.
Guard processMessage so a channel in discoveryMode only accepts STATUS
and is closed otherwise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant