Can you clarify? I’ve read that paper many times but I’ve never seen anything quite like what I described. Holder of key proofs are only discussed in terms of third party caveats (using public key crypto), and the authorizing Macaroon is repeatedly described as a bearer token in that paper, so I don’t think it’s the same thing.
To clarify my suggestion. If I have a Macaroon issued from
https://apples.example that lets me buy apples (perhaps just at certain times of day), and I want to send a request that orders 10 apples, I could just do a POST to
https://apples.example/buy with the Macaroon in the Authorization header (for sake of example). That authorizing Macaroon is a bearer token, so if it gets intercepted for any reason (malicious or accidental) then it can be reused by anyone, so long as they satisfy the caveats. In OAuth and other protocols this can be “solved” by permanently binding the token to a public key and requiring that every usage of the token proves possession of the corresponding private key (typically by signing the request or using it to authenticate the TLS channel).
My observation is that this can be done with Macaroons by just appending a unique per-request caveat, and no additional key is required. To work the example:
Original macaroon = M0, with HMAC tag T0
Request payload = {"prod":"apples”,”quant":10}
Form an unambiguous encoding of the request URI, payload and selected headers - e.g., as per
https://tools.ietf.org/html/rfc5849#section-3.4.1.1
request-hash = SHA-256(encoding)
Then form per-request macaroon M1 by appending a new caveat to M0 creating new HMAC tag T1 using T0 as the key, including request-hash and a timestamp/nonce or other anti-replay feature. You then send M1 in the Authorization header rather than M0:
POST /buy HTTP/1.1
Host: apples.example
Authorization: Macaroon M1
Content-Type: application/json
{"prod":"apples”,”quant":10}
An attacker that intercepts the request then only learns M1, which is cryptographically tied to that specific request and resists replay - so is useless to them. The original authorised party still has macaroon M0 and so can still generate new requests. They can also give M0 to other people and pass it around as a normal bearer token (appending other caveats on usage in the normal way). Tag T0 is effectively the key in a holder-of-key proof.
Maybe I’m missing this in the original paper, or this is an obvious consequence of the examples in that paper, but I like to have things spelled out explicitly. I suppose all I am really saying is that a contextual caveat can confine the context to one specific request and that in this limit a macaroon becomes a holder-of-key token.
— Neil