Subject: Re: [kitten] Fwd: I-D Action: draft-melnikov-scram-2fa-00.txt

From: Alexey Melnikov <[email-masked]>
Date: Sat, 2 May 2020 14:12:15 +0100

Hi Simon,

On 03/04/2020 17:29, Simon Josefsson wrote:
> Thanks for working on this.  What we discovered with the OpenID/SAML
> SASL mechanisms was that a major challenge was to resolve how to resume
> sessions in a SASLy way.  To be more specific, the challenge is that a
> lot of client applications (IMAP in particlar) expect to be able to open
> several sessions to the server.  Having a user perform manual steps per
> session won't work, and from a quick look at your document, it looks
> like this problem isn't resolve here either.  What is needed is some way
> to perform the 2FA authentication once, and then be able to refer to
> that authentication in a new SASL authentication step.  With re-newed
> energy and interest in this, I beliece we can do better now though.
> Some ideas:
>
> 1) Specify how TLS resumption of a SASL authenticated session should
> assume the same SASL authentication/authorization identity.
I don't think this will fly, as TLS resumption is usually unaware of
SASL state. At least this is how it is commonly implemented in Email
clients or servers.
> 2) Specify how EXTERNAL (or some new mechanism) is to be used to
> "resume" an earlier 2FA authenticated SASL session.
I don't think SASL EXTERNAL is a good fit here. I think David Cridland's
CLIENTKEY
<https://tools.ietf.org/id/draft-cridland-kitten-clientkey-00.txt> is
what you describe and I agree that we should pursue standardizing it.
> 3) Describe how OAUTH could be used to achieve this.
Right, on my to do list. If somebody would like to volunteer to co-edit
with me, that would speed things up.
> 4) Extend your proposal to generate a magic cookie after successful
> authentication that can be provided instead of the 2FA code next time.
Sure, I can add this.
> The problem is not exactly how to do it: it is to describe one
> well-agreed on method that all application implementers can follow, to
> get interoperability.
>
> I believe it is a bad idea to implement a generic 2FA mechanism on top
> of SCRAM, it will be too flexible with bad interop as a result.
> Instead, implement specific 2FA methods so things become easily
> implementable.  Your document could be a SCRAM-OATH-TOTP rather than
> SCRAM-2FA.  OATH-HOTP/TOTP, U2F, FIDO2, etc each have different
> behaviours that make it difficult to support in a generic protocol.

With addition of SCRAM-SHA-256, SCRAM-SHA-512 and possibly SCRAM-SHA-3,
I am worried about combinatorial explosion of names of SCRAM variants,
that need to accommodate both new hash algorithms and 2FA methods. Maybe
we should just settle on a small (or just 1) 2FA for now, but make it
swappable for  something better in the future?

Best Regards,

Alexey