On 6 June 2016 at 16:07, Robert Escriva <
rob...@rescrv.net> wrote:
> This is why I've always suggested the approach of extra round trips to
> the server instead of using public keys. It avoids the bloat.
Yes, this is definitely an option in some cases, but I wouldn't want to
incur a network round trip (and a database store) for every third party
caveat, with additional questions about storage lifetime, and the
fact that it requires the target service must be able to contact the
third party directly which isn't currently required.
> Off the top of my head, I would raise a concern about performance:
>
> In the current libmacaroons, the verifier does not short circuit on
> third-party macaroon traversal, in order to mitigate potential timing
> attacks stemming from presenting macaroons in a particular order with
> many fake macaroons. If you add the SHA256 calculation, it would double
> the time taken for each verification, or else open up potential timing
> attack that I took care to avoid.
I'm interested to hear more about this potential timing attack.
If it's a security hole to reveal which first party caveat fails, then
I can see why you wouldn't short-circuit the caveats when checking
a macaroon. But I'm not sure I see any issue with avoiding checking
the caveats on a discharge macaroon that's not referred to, or
in avoiding calculating extra hashes, because AFAICS the extra hash checking
will be a deterministic function of the public information in the
macaroons provided,
so the attacker wouldn't be able to learn any new information
however accurately they manage to time the request processing.
cheers,
rog.
PS If it's a security hole to reveal which first party caveat fails, I suspect
that avoiding short-circuiting when checking caveats is not sufficient,
as many caveat checkers will have different timings on success or failure
(for example, a checker that involves a database lookup might
take significantly different time if the lookup succeeds or fails).
We actually make the reason for failure available directly as an
error message, which makes it much easier to debug things when
they're going wrong. We haven't yet found a situation where
we want to conceal information about which caveat has failed.