Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MITM detection during session establishment: #4395

Closed
wants to merge 2 commits into from
Closed

Improve MITM detection during session establishment: #4395

wants to merge 2 commits into from

Commits on Mar 3, 2023

  1. Harden MITM detection during session establishment:

    Even with TLS encrypted connections, it is possible for a determined
    attacker to mount certain types of relatively easy man-in-the-middle
    attacks which, if successful, could allow an attacker to tamper with
    messages exchanged between endpoints.
    
    The risk can be mitigated if each side has a certificate issued by a
    CA that the other side trusts. In the context of a decentralized and
    permissionless network, this is neither reasonable nor desirable.
    
    To prevent this problem all we need is to allow the two endpoints, A
    and B, to be able to independently verify that they are connected to
    each other over a single end-to-end TLS session, instead of separate
    TLS sessions with the attacker bridges.
    
    The protocol level handshake implements this security check by using
    digital signatures: each endpoint derives a fingerprint from the TLS
    session, which it signs with the private key associated with its own
    node identity. This strongly binds the TLS session to the identities
    of the two endpoints of the session.
    
    This commit introduces a new fingerprint derivation that uses modern
    and standardized TLS exporter functionality, instead of the existing
    derivation whch uses OpenSSL APIs that are non-standard, and derives
    different "incoming" and "outgoing" security cookies.
    
    Lastly, this commit refines the "self-connection" check to allow for
    the detection of accidental instances of node identity sharing. This
    check was first introduced with #4195 but was partially reverted due
    to a bug with #4438. By using distinct security cookies for incoming
    and outgoing connections, an attacker is no longer able to claim the
    identity of its peer by echoing its security cookie.
    
    The change is backwards compatible and servers with this commit will
    still generate and verify old-style fingerprints, in addition to the
    new style fingerprints.
    
    For a fuller discussion on this topic, please see:
        openssl/openssl#5509
        #2413
    
    This commit was previously introduced as #3929, which was closed. If
    merged, it also fixes #2413 (which had been closed as a 'WONTFIX').
    nbougalis committed Mar 3, 2023
    Configuration menu
    Copy the full SHA
    d21d12c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9e6b7be View commit details
    Browse the repository at this point in the history