Ejabberd: [SCRAM] SCRAM-SHA-1-PLUS + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supports

Created on 30 Dec 2018  路  21Comments  路  Source: processone/ejabberd

To have compatibility with XMPP Servers and after:

  • SCRAM-SHA-1

Can you add supports of :

  • SCRAM-SHA-1-PLUS
  • SCRAM-SHA-224
  • SCRAM-SHA-224-PLUS
  • SCRAM-SHA-256
  • SCRAM-SHA-256-PLUS
  • SCRAM-SHA-384
  • SCRAM-SHA-384-PLUS
  • SCRAM-SHA-512
  • SCRAM-SHA-512-PLUS
  • SCRAM-SHA3-512
  • SCRAM-SHA3-512-PLUS

"When using the SASL SCRAM mechanism, the SCRAM-SHA-256-PLUS variant SHOULD be preferred over the SCRAM-SHA-256 variant, and SHA-256 variants [RFC7677] SHOULD be preferred over SHA-1 variants [RFC5802]".

https://xmpp.org/extensions/inbox/hash-recommendations.html

-PLUS variants:

LDAP:

  • RFC5803: Lightweight Directory Access Protocol (LDAP) Schema for Storing Salted: Challenge Response Authentication Mechanism (SCRAM) Secrets: https://tools.ietf.org/html/rfc5803

HTTP:

2FA:

IANA:

Note, after SCRAM-SHA-1(-PLUS):

Linked to:

All 21 comments

On and on this goes. They invent new SCRAM every year (without clear migration path) and we should implement this every time? Why?

So, let's say I created a password with SCRAM-SHA-512, but my another client only supports SCRAM-SHA-1, then what to do?

XMPP client devs must to update the software... ^^
The user will do the best choice :)

Yeah, sure.

Can you reopen the ticket?
There are a lot of informations now ^^

What information?
You still don't answer my main question about migration path.

More details for Tigase 8.0.0+:

  • For a new install in 8.0.0, and by default, a password is saved to SCRAM-SHA-1 and SCRAM-SHA-256.
    There is an option if we want to use PLAIN -> PLAIN/SHA-1/SHA-256.
  • For a migration to 8.0.0, there is an option to keep PLAIN, if enabled, there will be PLAIN/SHA-1/SHA-256.

In more for Tigase 8.0.1+:

  • With 8.0.1 and 8.1.0, there will be in more PLAIN (if enabled), SCRAM-SHA-1 and SCRAM-SHA-256, an option to enable SCRAM-SHA-512.

Of course, -PLUS variant work without any problems for all.

If the password was in SCRAM-SHA-1 before a migration and if we want to have SCRAM-SHA-256 (and other), a reset all passwords is needed.
Of course, it is possible to disable SCRAM-SHA-1 and/or SCRAM-SHA-256 too.

@Neustradamus how is information about Tigase relevant in this bug tracker?

It is the solution for launch improvements of the missing part in ejabberd :)

Any news on it?

The new RFC has been published by @stpeter: https://tools.ietf.org/html/rfc8600 since 2019-06-21: https://mailarchive.ietf.org/arch/msg/ietf-announce/suJMmeMhuAOmGn_PJYgX5Vm8lNA.

Goog news, there is a best article to convert old unsecured MD5 passwords to SCRAM-SHA-256 with PostgreSQL:

@Neustradamus I think the problem upstream has with this is that it requires a reset of all user passwords to make use of it, as the Tigase and PostgreSQL articles also mention (the instructions for neither of them would port over to ejabberd, given that it basically comes down to "reset all passwords").

Also, what happens if a user password is stored in SCRAM-SHA256 format, but their client only supports SCRAM-SHA1? The server is unable to verify the user.
The Tigase solution seems to be to store both a SHA1 and SHA256 based version of the password, and they say they can automatically port if you have the PLAIN auth enabled. (Which, if you use it, sorta defeats the entire purpose of SCRAM I'd say?)
I think that if ejabberd wants to support SCRAM-SHA256, they should/would probably also support multiple stored passwords, to retain compatibility with clients that don't have SCRAM-SHA256, but I'm not knowledgeable of the code to a sufficient enough degree to know what that'd entail.

Basically, it's a new password storage mechanism without migration path from SCRAM-SHA1 that makes implementing this hard.

@puiterwijk: Thanks for your comment on this VERY IMPORTANT not-closed ticket but currently closed.

First, it is important to support different SCRAM possibilities.

Second part, is the migration from actual SCRAM-SHA-1 but the first part is very important!

How it is possible to have this in other XMPP servers in more than XMPP clients and not in ejabberd?

@Neustradamus as always, patches are welcome (as well as respect).

Thanks to @prefiks for SCRAM-SHA-1-PLUS + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS):

@badlop: Not completely finished but @prefiks works on it.
All people can say a very, very, big thanks about this improvement in ejabberd!

@Neustradamus could you like...stop beating this horse?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pacija picture pacija  路  4Comments

ThomasLeister picture ThomasLeister  路  4Comments

licaon-kter picture licaon-kter  路  4Comments

ForGuru picture ForGuru  路  4Comments

cromain picture cromain  路  3Comments