standardnotes / forum

Support from other community members. For 1-on-1 help, please contact help@standardnotes.com.
https://forum.standardnotes.org
196 stars 9 forks source link

Crypto: Not using authenticated encryption #2156

Closed terrorbyte closed 7 years ago

terrorbyte commented 7 years ago

Issue

The web interfaces is using AES-CBC and is not using standard AE (Authenticated Encryption) algorithms, which makes it vulnerable to specific cryptographic attacks.

See:

Resolution

Use AES-GCM or comparable algorithms for future proofing.

Location

moughxyz commented 7 years ago

Hey, thanks for taking a look. Actually those are just wrapper functions. The actual authentication takes place here:

https://github.com/standardnotes/web/blob/master/app/assets/javascripts/app/services/apiController.js#L521

Let me know if this is what you were looking for.

terrorbyte commented 7 years ago

I'm specifically discussing the usage of AES-CBC on both of the linked lines. Specifically the invocation of CryptoJS.mode.CBC

moughxyz commented 7 years ago

Does using AES-GCM offer any advantages (besides easier implementation) over manual encryption + auth with AES-CBC + HMAC?

terrorbyte commented 7 years ago

Ah, I see what you were saying in the above comment, I didn't see the HMAC. You are doing EtM in that so it seems to be solid. Sorry to waste your time!

moughxyz commented 7 years ago

No worries, scared me for a sec ;)