-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Verify peer's public key earlier: #4437
Conversation
Fix an issue introduced by XRPLF#4195 / 5a15229 (part of 1.10.0-b1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean and simple. 👍 from me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, veto. This change is actually insufficient: the shared secret which is signed is identical, so an an attacker can just duplicate the Session-Signature
field.
Under normal circumstances, this makes no sense: you'd just cause the connection to drop. But with the "accidental misconfiguration detector" code introduced with commit 5a15229 there's now an incentive: by switching the direction of the attack, it would just cause servers that connect to the attacker to shut down.
I am going to stack a [FOLD]
commit on top of this; feel free to squash it. It will disable the duplicate detector, eliminating this attack vector and I will enhance PR #4395 to properly handle this case.
Partially revert the functionality introduced with 5a15229.
I think the original fix is sufficient. For an attacker to duplicate the I haven't tried this experimentally. |
Hey @ximinez! Hope all is well. Thanks for the comment. Unfortunately, the original fix is NOT sufficient. Some backgroundThe underlying problem here is two-fold: (1) the By way of background, for those who aren't familiar with the details:
Now for the good stuff...Consider two peers, Alice, a normal, well-behaved honest peer, and Mallory, a malicious peer. The original fix prevents Mallory from initiating a connection to Alice and causing her to shutdown because, per the protocol, Mallory needs to send an HTTP Upgrade request with a valid But that's NOT the only scenario. What if Alice attempts to make an outgoing connection to Mallory? Now, per the protocol, Alice sends an HTTP Upgrade request, which includes her And now Mallory now has all the information needed to trick Alice into thinking her node identity is shared: the When Alice processes Mallory's response what she will see a valid signature and an The solution (which I will implement and submit as a fix for #4395) is to mix the Wait, isn't this scheme already broken?"It sounds like the existing |
Hi @nbougalis! That all makes perfect sense, including the future fix. I had completely forgotten how the handshake works. That said, instead of rolling the original fix back entirely, what if we just remove the call to stop the server, but keep logging that different message? That can at least alert operators who check their logs that they have a potential problem. Then once we have a stronger handshake protocol, we can start doing the automatic shutdown... |
High Level Overview of Change
Fix an issue introduced in 1.10.0-b1.
No stable versions of rippled (including 1.9.4) are affected.
Context of Change
An issue was introduced in #4195 / 5a15229 (part of 1.10.0-b1) and is fixed here.
Type of Change