From 1e76226177f482d447fb3e786fc6aa1e1db7cb65 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 9 Feb 2022 03:14:26 +0000 Subject: [PATCH] Connection: the issue at hand is more complicated than it first appears, as usual --- src/lib/transport/Connection.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/transport/Connection.mjs b/src/lib/transport/Connection.mjs index 6bc389b..d59a130 100644 --- a/src/lib/transport/Connection.mjs +++ b/src/lib/transport/Connection.mjs @@ -178,7 +178,7 @@ class Connection extends EventEmitter { // TODO: Consider anonymous TLS, with jpake for mututal authentication // TODO: Consider https://devdocs.io/node/crypto#crypto.createCipheriv() - which lets us use any openssl ciphers we like - e.g. ChaCha20-Poly1305 - // TODO: We're currently vulnerable to a replay attack. We need to mitigate this somehow. + // TODO: We're currently vulnerable to a replay attack. We need to mitigate this somehow - probably by maintaining a sequence number. Instead of sending the sequence number though we should instead compute a MAC that also includes the message length and a bunch of other things etc. Of course, we will also need to make sure we don't fall afoul of mac-then-encrypt, encrypt-then-mac, etc issues... let payload = JSON.stringify({ event, message }); payload = encrypt_bytes(