Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCRAM-SHA-1-PLUS + SCRAM-SHA-256-PLUS + SCRAM-SHA-512-PLUS + SCRAM-SHA3-512(-PLUS) supports #1

Open
Neustradamus opened this issue Jan 6, 2022 · 11 comments
Labels
backend/xmpp Issues dealing with the XMPP implementation

Comments

@Neustradamus
Copy link

Neustradamus commented Jan 6, 2022

To have compatibility with XMPP Servers and after:

  • SCRAM-SHA-1
  • SCRAM-SHA-256
  • SCRAM-SHA-512

Can you add supports of :

  • SCRAM-SHA-1-PLUS
  • SCRAM-SHA-224
  • SCRAM-SHA-224-PLUS
  • SCRAM-SHA-256-PLUS
  • SCRAM-SHA-384
  • SCRAM-SHA-384-PLUS
  • 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:

IMAP:

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:

Linked to:

@PapaTutuWawa
Copy link
Owner

Currently, I have SCRAM-SHA-1, SCRAM-SHA256 and SCRAM-SHA-512 implemented. The 224 and 384 variants could be implemented rather easily. SHA3-512 would require another library that I am not sure I would like to pull in just for SCRAM. The PLUS variants cannot be implemented since the TLS implementation of Dart doesn't give me access to features like channel binding.

@mwild1
Copy link

mwild1 commented Jan 14, 2022

I would ignore -PLUS for now. The channel binding method is not well specified with TLS 1.3. Just so you know the original reporter of this issue reports this against every XMPP project, but in reality it's totally unnecessary to support all these variants which are not used in the real world :)


Not very related, but... it's nice to see a fresh XMPP client! In case you find them useful, here are a few resources:

  • The chats and mailing lists hosted by the XSF, especially the jdev chat is a good place to reach fellow XMPP developers (both new and experienced).
  • docs.modernxmpp.org - a documentation project covering all things "modern XMPP", especially things that are not covered by XEPs (e.g. user interface guidelines). It also has an overview of what XEPs are currently recommended for modern XMPP clients and how they fit together. It's by no means complete, but hopefully a useful resource and if you have any learnings to contribute to it, that's welcome too! (see also the chat room linked on the front page)

@PapaTutuWawa
Copy link
Owner

@mwild1 I know, I have seen these issues around. I am aware that SHA-1 is still sufficiently secure but I thought that it didn't hurt since you get SCRAM-SHA-{256,512} basically for free if you implement it using SHA-1. I have to admit that I was influenced by the XMPP wiki page about SCRAM. Removing it now probably makes no sense since it is already there but not being able to test it against an actual implementation makes me a bit uncomfortable. The fact about the deployment of other SCRAM variants is also the reason why I am reluctant about pulling in another crypto library just for SCRAM-SHA3-512 and so on (until I have to be compliant with XEP-0414).

But thank you for the additional information, though I do already know of them. I've had the idea of a new XMPP client not just since yesterday 😄

@Neustradamus
Copy link
Author

Neustradamus commented Jan 15, 2022

Note that a lot of people have TLS 1.2, add -PLUS variants have been integrated in libs/softwares/products.

Example: PostegreSQL supports with and without -PLUS.

Note that GnuTLS supports already TLS Binding with TLS 1.3.

You can see libs/softwares which use different SCRAM protocols, here: scram-sasl/info#1

Note that some XMPP projects do not want to add other SCRAM that SCRAM-SHA-1.

In few weeks, Prosody 0.12.x will have SCRAM-SHA-256.
Other XMPP server already support and other SCRAM too:

  • DJabberd
  • ejabberd
  • Metronome IM
  • Mongoose IM
  • M-Link
  • Tigase XMPP Server

Edit: SCRAM BIS: https://tools.ietf.org/html/draft-melnikov-scram-bis speaks about SCRAM-SHA-(1-256-512)(-PLUS) and SCRAM-SHA3-(512)(-PLUS) and TLS 1.2 and TLS 1.3.

@Neustradamus
Copy link
Author

@PapaTutuWawa: Please note that to have only SCRAM-SHA-1 support does not permit to all users to connect on XMPP Servers ;)

@PapaTutuWawa
Copy link
Owner

@Neustradamus I understand that, but at the moment I view just having SCRAM-SHA-{1,256,512} as enough, judging by the stats of the XMPP observatory. This doesn't mean I refuse to implement the "missing" ones, but at the moment my code has issues with much higher priority. If anyone tries to use my client on a server that does not offer one of the already mentioned SCRAM methods, then I will gladly implement them, as long as it's not *-MD5 or any of the *-PLUS variants.

@PapaTutuWawa PapaTutuWawa added the backend/xmpp Issues dealing with the XMPP implementation label Jan 15, 2022
@Neustradamus
Copy link
Author

@PapaTutuWawa: Thanks for your reply, you can test here:

@Neustradamus
Copy link
Author

@PapaTutuWawa: It is official for TLS 1.3 Binding!

Details:

  • tls-unique for TLS =< 1.2
  • tls-exporter for TLS = 1.3

Linked to:

@PapaTutuWawa
Copy link
Owner

@Neustradamus I have now implemented (and fixed) the SHA-256 and SHA-512 variants. Channel binding is not implemented since I still cannot access the TLS data required to do so.

@Neustradamus
Copy link
Author

Thanks for your improvements!

Hard to add SHA3-512?

Yes, you need to wait for -PLUS variants...

@PapaTutuWawa
Copy link
Owner

PapaTutuWawa commented Jan 8, 2023

Hard to add SHA3-512?

No, but I don't want to pull in another library (my current crypto library does not implement SHA3) just for SCRAM-SHA3.

@Neustradamus Neustradamus changed the title SCRAM-SHA-1-PLUS + SCRAM-SHA-256(-PLUS) + SCRAM-SHA-512(-PLUS) supports SCRAM-SHA-1-PLUS + SCRAM-SHA-256-PLUS + SCRAM-SHA-512-PLUS + SCRAM-SHA3-512(-PLUS) supports Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/xmpp Issues dealing with the XMPP implementation
Projects
None yet
Development

No branches or pull requests

3 participants