-
Notifications
You must be signed in to change notification settings - Fork 97
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
client: stop accepting sigs on the truncated messages (sig fix stage 4) #1526
Conversation
aa12258
to
a22052f
Compare
Split the first 3 commits into a separate branch, that way we can test server updated but not client as is in the plan. |
a22052f
to
2bbafbd
Compare
2bbafbd
to
82b67a3
Compare
Plan sounds right. Looking forward to the purge. |
82b67a3
to
79ef58e
Compare
Updated the plan a bit to be more explicit about the stages and which commits are in each. Also added the final commits for both sides to stop accepting the truncated msg sigs. |
79ef58e
to
ebf4aec
Compare
ebf4aec
to
70ec51b
Compare
Rebased on #1530. This PR is just the one final commit 70ec51b
This is stage 4 of the signature message truncation fix plan outlined below.
In these commits, client stops accepting sigs on the truncated messages. All servers must be sending the correct sigs i.e. have deployed the stage 3 of the fix.
Full signature fix plan
In some places we were signing and verifying unhashed messages, resulting in truncation of the data we intend to sign and verify. Because the truncation was performed on both sides, we didn't have errors, but the full payloads were not part of the verified message. This included the signatures created and verified in the main comms (i.e. between
Core
andAuthManager
), as well as in DCR and BTC's backends where coin signatures are used to verify ownership of the coins.Note that in the asset coin sign/verify bits, it is always the client signing coins with their wallet keys, and the server verifying. In other comms, both client and server are generating and verifying signatures.
Also note that all comms are end-to-end encrypted with TLS, and most truncated payloads included unique data anyway. The message payloads and client signatures are also not publicly available data, so it is not straightforward to exploit this bug.
This change includes all the commits that will occur in several stages:
Note that stage 2 also fixes
client/core.(*Core).Register
failing to re-set their own pubkey in themsgjson.RegisterResponse
from the server, where it is omitted from the JSON serialization but included in the binary serialization when the payload is signed.In summary, the server commits should land in 0.4.2 (like today), while the client commits should land in master and later in 0.4.3+.
Lastly, a future commit for 0.5 and the "
V0PURGE
" should be drafted that makes server sign outgoing hashed messages to the clients and stop verifying signatures on truncated data from the client, breaking compatibility with older clients.This approach is proposed to minimize disruption to older clients, delaying the breaking changes to 0.5/1.0 and the great v0 API purge.
Discuss. 👵
WARNING: I've not tested this interactively yet.