HTTP Digest Authentication with MD5-sess algorithm is recalculated with new cnonce for every request
Categories
(Core :: Networking, defect, P5)
Tracking
()
People
(Reporter: scott, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: helpwanted, Whiteboard: [necko-would-take])
Comment 1•21 years ago
|
||
| Reporter | ||
Comment 2•21 years ago
|
||
Comment 3•21 years ago
|
||
Comment 4•21 years ago
|
||
| Reporter | ||
Comment 5•21 years ago
|
||
Updated•21 years ago
|
Comment 6•20 years ago
|
||
Comment 7•20 years ago
|
||
Comment 8•20 years ago
|
||
Updated•20 years ago
|
Comment 9•19 years ago
|
||
Comment 10•19 years ago
|
||
Updated•9 years ago
|
Comment 11•8 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•4 years ago
|
||
The code around this area was updated in bug 1705659, bug 472823, and bug 669675. Is this issue still reproducible?
Comment 14•4 years ago
|
||
(In reply to Mathew Hodson from comment #13)
The code around this area was updated in bug 1705659, bug 472823, and bug 669675. Is this issue still reproducible?
I haven't tried it, but from a brief look into current code of nsHttpDigestAuth, there is no reason to think of it being resolved. The solution would contain storing (and reusing) result of CalculateHA1 into sessionState in a similar manner as nonce_count, but there is currently no such code.
Comment 15•3 years ago
|
||
18 years later...
The bug is still actual and needs to be fixed.
Here you can find recorded communication between Firefox and IIS: https://github.com/curl/curl/pull/9074#issuecomment-1177963896
Obviously the Firefox's implementation for MD5-sess does not work correctly and requires fixing.
Currently Firefox (like Chrome) succeed with the first request with fresh server nonce, but always fail with the second request in the same session when using IIS with Digest Auth.
Currently cnonce is always regenerated for each request (which is correct), but A1 (and H(A1)) is regenerated as well with the new cnonce value (which is wrong for MD5-sess).
https://github.com/mozilla/gecko-dev/blob/54571ce8b0e25ad9be9feb6587a775454616c8ac/netwerk/protocol/http/nsHttpDigestAuth.cpp#L323-L336
The calculated H(A1) value is used only for one-time calculations for the response and not stored anywhere.
https://github.com/mozilla/gecko-dev/blob/54571ce8b0e25ad9be9feb6587a775454616c8ac/netwerk/protocol/http/nsHttpDigestAuth.cpp#L492-L534
As it was mentioned in previous comment, the code must remember H(A1) value in the same way, as it is implemented for nonce-count.
The similar bug for Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1344488
Updated•3 years ago
|
Updated•2 years ago
|
Description
•