I also wonder about the wisdom of referencing Dave Kristol's extension mechanism (sounds like what used to be called at PARC "error 33" -- making one risky project dependent on another).
Given the above, here's an off-the-top-of-my-head attempt at addressing these vulnerabilities, while retaining as much spirit of the design as possible. It is an admittedly bad practice I am indulging in here -- this is not a thought-out design, it's only meant to illustrate fixes.
host-id is the principal's DNS name or the "realm", I don't care. tod is seconds since Unix epoch in hex. discrim is a hex integer so that multiple nonces generated in a given second monotonically increase. I don't care what sep1 and sep2 are (slashes?). This is so the principals can check for replay with finite memory. Clients have nonces too.
Authorization: Digest
algorithm=MD5,
username="<username>",
realm="<realm>",
snonce="<server-nonce>",
cnonce="<client-nonce>", -- must be fresh
uri="<requested-uri>",
request="<client-digest>",
message="<message-digest>",
opaque="<opaque>" -- required if provided by server
where:
<client-digest> := H( H(A1) + CN + SN + BI + H(H(A1) + A2) )
<message-digest> := H( H(A1) + <client-digest> + H(H(A1) + CB) )
and:
A1 := 'MD5' + U + R + P
A2 := <Method> + <requested-uri>
BI := "cbody" | "no cbody" -- depending
OP := "opaque" + <opaque> | "no opaque" -- depending
CB := "cbody" + <message-body> | "no cbody" -- depending
with:
SN, CN -- server and client nonce values
U -- username
R -- realm
P -- password
<Method> -- entire request header line 0
<requested-uri> -- uri sans proxy/routing
HTTP/1.1 200 OK
Authorization-Response: Digest
algorithm=MD5,
username="<username>",
realm="<realm>",
snonce="<server-nonce>",
cnonce="<client-nonce>",
response="<server-digest>"
where:
<server-digest> := H( H(A1) + CD + SB + H(H(A1) + <Response>))
and with:
A1 as above
CD := <client-digest> -- from above
SB := "sbody" + <message-body> | "no sbody" -- depending
<Response> -- entire response header line 0
As a firewall developer I see the Digest Access Authentication mechanism a useful construct. I would like to see some additional but compatible functionality added to the proposal to do with proxy-authentication. I would like to see an explicit definition as how it may be used with proxy-authenticate. Proxy authenticate currently does not handle nestsed firewalls very well since the first proxy should strip out the proxy-auth stuff (:-< With the addition of an authentication point parameter, a proxy could then strip only the proxy-auth lines that are applicable to it. This would allow nested authentication. One drawback of nested authentication is the shuttling of requests back and forward between client and proxies. This is best seen if you consider what happens if the proxies don't allow re-use. client -> proxy proxy says 407 proxy-auth... client ->proxy->server proxy happy, but server wants auth as well. client ->proxy proxy says 407 again since previous auth is nolonger valid. client-proxy->server client finally gets data. A simple scheme to get around this is to allow servers and proxies to piggyback the next challenge to the current response.. This is purely an optimisation but makes the whole process work.