Soft token MAC verification not constant time
Categories
(NSS :: Libraries, defect, P2)
Tracking
(firefox-esr6870+ fixed, firefox67 wontfix, firefox68 wontfix, firefox69 wontfix, firefox70+ fixed, firefox71+ fixed)
People
(Reporter: deian, Assigned: deian)
References
Details
(Keywords: csectype-other, sec-audit, Whiteboard: [adv-main70-][adv-esr68.2-][post-critsmash-triage])
Attachments
(1 file)
2.34 KB,
patch
|
kjacobs
:
review+
|
Details | Diff | Splinter Review |
A bunch of the MAC verification functions use PORT_Memcmp (=memcmp). It's not clear if this is actually a problem, but worth creating a bug:
Comment 1•4 years ago
|
||
The risk here is that an attacker can attempt to progressively find a MAC value (or other verifier) for a known input by observing the timing side channel. It does not endanger inputs in any way.
Our TLS stack is not affected (TLS 1.3, TLS <=1.2), and nor is WebCrypto. But this is still serious.
When fixing this, we should try to be more rigorous and find all uses of memcmp and friends. Inconsistent use of the PORT_Memcmp variant means that we'll have to look for all the different variants, maybe by using #define memcmp(_, _) PR_STATIC_ASSERT(false)
. I don't know if we'd have much success with dudect or similar, but we might even try that.
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Assignee | ||
Comment 3•4 years ago
|
||
@Martin: Yeah that sounds reasonable. Though memcmp is used in some cases safely in, say, the pkcs11c.c file.
RE dudect: This sounds great. Though if we know what's secret
(we'd need this for dudect anyway), we can also throw Fraser's checkers at this (shes working on some CT checkers), and a new constant-time verification tool (faster and simpler than ct-verif) we've been building.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Comment on attachment 9094007 [details] [diff] [review] 0001-Bug-1582343-Use-NSS_SecureMemcmp-instead-of-PORT_Mem.patch This looks good to me. I don't see any other interesting uses of `memcmp` in softoken.
Comment 5•4 years ago
|
||
As we are coming up on the 3.47 release, we can land this any time.
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 8•4 years ago
|
||
No advisory, given we don't know if this is triggerable. ni if disagree
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Description
•