| Summary: | Security issue - HTTP DigestAuthenticator does not verify nonce count is incremented | ||
|---|---|---|---|
| Product: | [RT] Jetty | Reporter: | art <zarbear> |
| Component: | server | Assignee: | Greg Wilkins <gregw> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | jesse.mcconnell, jetty-inbox |
| Version: | unspecified | ||
| Target Milestone: | 7.2.x | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
art
How should the server remember the nonce count? It can't put it in the session, as an attacker could just leave out the session ID. It can't associate it with the connection, as multiple clients might get multiplexed onto a connection by an intermediary. How is this typically done? One option would be to add a unique client id encoded in the nonce sent to the client (similar to what's done with the timestamp at the moment to check for maxage). Make an LRU map of the client ids and the latest nonce count, and return 401 with new nonce if it's not there or not greater than previous count. This has been resolved by have a non zero max age on nonces and keeping a concurrent queue of recently created nonces plus a map of noce to count to check the nc value is increasing. fix will be in 7.5.2 Ok, sounds good. I take it by lru map of nonces you maintain a nonce generated per client? Checked out the latest source, there seems to be a bug in that there's no comma before the "stale" parameter returned in
response.setHeader(HttpHeaders.WWW_AUTHENTICATE, "Digest realm=\"" + _loginService.getName()
+ "\", domain=\""
+ domain
+ "\", nonce=\""
+ newNonce((Request)request)
+ "\", algorithm=MD5, qop=\"auth\""
+ " stale=" + stale);
Fixed, thanks for catching that! |