Skip to content

Add timestamp validation and deduplication to hello handshake messages #6675

@zeusoo001

Description

@zeusoo001

Summary

When TRON nodes process handshake (Hello) messages, although the messages include a timestamp signature, the receiver currently does not validate the timestamp, nor is there a mechanism for message uniqueness or deduplication. Historical messages could be intercepted and reused to establish connections. Adding timestamp validation and a simple deduplication mechanism can more effectively filter out expired or repeated messages, improving handshake stability and node connection reliability.

Root Cause

Hello messages include a timestamp signature, but the receiver does not validate its freshness, and there is no unique identifier or deduplication. Historical messages could be intercepted and replayed to establish connections, which slightly affects node connection stability.

Reproduction

  • Construct a Hello message containing a historical timestamp or previously sent content.
  • Send this message from different peers to the target node.
  • The target node processes each Hello message from each peer normally, without verifying timestamp validity or message uniqueness.

Impact

  • A malicious node that intercepts and replays historical messages could successfully establish connections with the target node.
  • This may cause unnecessary connection attempts and additional resource consumption on the target node.

Suggested Fix

Add lightweight validation in the existing handshake process:

  • Implement timestamp validation to ensure it falls within a reasonable time window (e.g., 30s).
  • Introduce a simple unique identifier (e.g., based on timestamp) and perform short-term deduplication using a cache.

By using the above methods, handshake message processing can be more standardized and stable without affecting the existing signature mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions