Skip to content

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

Closed

Description

@Neustradamus

Dear @kisli team,

For more security, can you add supports of:

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

You can add too:

  • SCRAM-SHA-224
  • SCRAM-SHA-224-PLUS
  • SCRAM-SHA-384
  • SCRAM-SHA-384-PLUS

A "big" list has been done in last link of this ticket.


SCRAM-SHA-1(-PLUS):

SCRAM-SHA-256(-PLUS):

SCRAM-SHA-512(-PLUS):

SCRAM-SHA3-512(-PLUS):

-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:

JMAP:

2FA:

IANA:

Linked to:

Activity

  1. Neustradamus commented on Jun 23, 2026

    @Neustradamus
    Author

    @vincent-richard: Can you check this ticket?

    Linked to:

  2. vincent-richard commented on Oct 2, 2026

    @vincent-richard
    Member

    Hi @Neustradamus,

    VMime doesn't implement SASL mechanisms itself: it relies on GNU SASL. Here's where things stand for each variant you listed:

    • SCRAM-SHA-1 and SCRAM-SHA-256 are already supported. I tested both successfully over IMAP and POP3 against Dovecot 2.3.21, using VMime master (34574aa) and GNU SASL 2.2.1. Transcripts are below.
    • SCRAM-SHA-1-PLUS and SCRAM-SHA-256-PLUS are not supported yet. GNU SASL implements them, but VMime doesn't provide the TLS channel binding data yet (tls-unique / tls-exporter). This needs some work in the TLS socket layer for both GnuTLS and OpenSSL. In the meantime, I'll make sure VMime doesn't select a -PLUS variant when the server advertises one, since it would currently fail.
    • SCRAM-SHA-512, SCRAM-SHA3-512 (and SHA-224/384) won't be added. They are only IETF drafts, and GNU SASL doesn't implement them. If GNU SASL adds them one day, VMime should get them almost for free.

    I'll keep this issue open to track -PLUS (channel binding) support.

    Test transcripts (VMime tracer, user/pass test account)

    VMime's tracer hides the client's SASL payloads ({...SASL exchange...}).

    IMAP, SCRAM-SHA-256

    C: Connecting to 127.0.0.1, port 1143
    S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=SCRAM-SHA-1 AUTH=SCRAM-SHA-256] Dovecot ready.
    C: a001 AUTHENTICATE SCRAM-SHA-256
    S: + 
    C: {...SASL exchange: 48 bytes of data...}
    S: + cj1sbzlZekdGRUFtTFJVbWV0RlF0d3MweHI/JVZcVCpEbz5jR1RTaGx9bV9oQlclYjk7TngoU0MuP3FVQTs6cDItYyI3Uy1fdEtWdzhVJGlYLURXXlJmZCpaLHM9M3daTFV1cVNzVmhBRWtzWnRObDMrUT09LGk9NDA5Ng==
    C: {...SASL exchange: 192 bytes of data...}
    S: + dj16TFVMeDhjMnkxSnltb2ZPeE1ZRWpRVnFZblRiMk90eXhGM1NpMWlyWDlNPQ==
    C: {...SASL exchange: 0 bytes of data...}
    S: a001 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY] Logged in
    C: a002 LIST "" ""
    S: * LIST (\Noselect) "." ""
    S: a002 OK List completed (0.001 + 0.041 + 0.040 secs).
    C: a003 LOGOUT
    C: Disconnecting
    

    IMAP, SCRAM-SHA-1

    C: Connecting to 127.0.0.1, port 1143
    S: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=SCRAM-SHA-1 AUTH=SCRAM-SHA-256] Dovecot ready.
    C: a001 AUTHENTICATE SCRAM-SHA-1
    S: + 
    C: {...SASL exchange: 48 bytes of data...}
    S: + cj1kUFZxZXkvdXhWVldsL2dLeW9zV2tiVEZ4KDwyZiV2K0ZqMlU4KTRoWSMvQidfTUBPJCNJYHw7bDowQ3otO1VrTkFddXFOTktHZWY8SU5NMyI6Kyg9U0cjLHM9SUlKNTF3VFhtZ1V4RVBqSWMzaTIwdz09LGk9NDA5Ng==
    C: {...SASL exchange: 172 bytes of data...}
    S: + dj1RRVAvbVFCaHpnVHpKdDdNMlFPMTQvUWJWVVk9
    C: {...SASL exchange: 0 bytes of data...}
    S: a001 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY] Logged in
    C: a002 LIST "" ""
    S: * LIST (\Noselect) "." ""
    S: a002 OK List completed (0.001 + 0.041 + 0.040 secs).
    C: a003 LOGOUT
    C: Disconnecting
    

    POP3, SCRAM-SHA-256

    C: Connecting to 127.0.0.1, port 1110
    S: +OK Dovecot ready.
    C: CAPA
    S: +OK
    S: CAPA
    S: TOP
    S: UIDL
    S: RESP-CODES
    S: PIPELINING
    S: AUTH-RESP-CODE
    S: USER
    S: SASL PLAIN LOGIN CRAM-MD5 DIGEST-MD5 SCRAM-SHA-1 SCRAM-SHA-256
    S: .
    C: AUTH SCRAM-SHA-256
    S: + 
    C: {...SASL exchange: 48 bytes of data...}
    S: + cj1VejMrU1ZFR3V4aTZ1aHQrSU9EQXdPSXA0NmZCO0pkc0NCJF1CVDJ3IWZ+Y2U6PHt7W1pWQjBqXW07KzBWSid+IyRaOHlQJipIIUVjejVGRz5UJndZOUs/LHM9c1lkS3hvZjBsMzZLVW9hKy9iUi8vQT09LGk9NDA5Ng==
    C: {...SASL exchange: 192 bytes of data...}
    S: + dj1OM2hKTG55VmVXMmhseDBRekthdUFmQkZmM1pDQXl5a3BSSEVmT2FGZ0pjPQ==
    C: {...SASL exchange: 0 bytes of data...}
    S: +OK Logged in.
    C: QUIT
    S: +OK Logging out.
    C: Disconnecting
    

    POP3, SCRAM-SHA-1

    C: Connecting to 127.0.0.1, port 1110
    S: +OK Dovecot ready.
    C: CAPA
    S: +OK
    S: CAPA
    S: TOP
    S: UIDL
    S: RESP-CODES
    S: PIPELINING
    S: AUTH-RESP-CODE
    S: USER
    S: SASL PLAIN LOGIN CRAM-MD5 DIGEST-MD5 SCRAM-SHA-1 SCRAM-SHA-256
    S: .
    C: AUTH SCRAM-SHA-1
    S: + 
    C: {...SASL exchange: 48 bytes of data...}
    S: + cj1EMU9vQlI4Rys4NW8rN3k1T0hSVmxXREQ5LytxXj5LLTEqKWBXIzwzYzViYlQqYiNwKE9lQFtVUzNNYmUoZj9VaGU3TlM9I3tuQlBqJHc2Sm82RiMtOipYLHM9Rm5DR3Y1TUEzd1pFN08yNE1OQkVCUT09LGk9NDA5Ng==
    C: {...SASL exchange: 172 bytes of data...}
    S: + dj1VT0NNek5PWUx4K045L0xyOVZVZlVhSjVBRms9
    C: {...SASL exchange: 0 bytes of data...}
    S: +OK Logged in.
    C: QUIT
    S: +OK Logging out.
    C: Disconnecting
    
  3. Neustradamus commented on Oct 2, 2026

    @Neustradamus
    Author

    @vincent-richard: Thanks for your answer and your tests.

    It is possible to add in source that SCRAM-SHA-1 and SCRAM-SHA-256 are currently supported with GNU SASL?

    It is possible to check for TLS Channel Binding part?

  4. vincent-richard commented on Oct 2, 2026

    @vincent-richard
    Member

    @Neustradamus: Channel binding is now implemented, and it turned out to be a smaller change than expected: about 300 lines, mostly in the TLS layer. VMime now supports SCRAM-SHA-1-PLUS and SCRAM-SHA-256-PLUS over TLS, with both GnuTLS and OpenSSL, for IMAP, POP3 and SMTP:

    • tls-unique is used for TLS 1.2, and tls-exporter for TLS 1.3 (RFC 9266);
    • VMime selects SCRAM-SHA-256-PLUS by default when the server advertises it. Plain SCRAM works as before.

    As said before, SCRAM-SHA-512 and SCRAM-SHA3-512 can't be supported until GNU SASL implements them.

    Tested against:

    • Dovecot 2.4.5 with STARTTLS: all combinations of GnuTLS/OpenSSL, TLS 1.2/1.3 and IMAP/POP3/SMTP pass.
    • Dovecot 2.3.21 without TLS: no regression for SCRAM-SHA-1 and SCRAM-SHA-256.

    Could you test the 279-scram-sha-1-plus-scram-sha-256-plus-scram-sha-512-plus-scram-sha3-512-plus-supports branch on your side?

  5. Neustradamus commented on Oct 5, 2026

    @Neustradamus
    Author

    @vincent-richard: Thanks for your work :)

    Can you look for "tls-server-end-point" too?

    Badly, I can not test it directly :/

  6. vincent-richard commented on Oct 6, 2026

    @vincent-richard
    Member

    @Neustradamus: Unfortunately, tls-server-end-point isn't possible for now: GNU SASL only supports tls-unique and tls-exporter for SCRAM channel binding (there is no property for tls-server-end-point, even in its current master branch). On the TLS side it would be easy to compute (GnuTLS already provides it), so I'll add it if GNU SASL supports it one day.

    If you'd like to see it supported, the best place to ask is GNU SASL's mailing list: help-gsasl@gnu.org (see https://www.gnu.org/software/gsasl/).

  7. Neustradamus commented on Oct 13, 2026

    @Neustradamus
    Author

    @vincent-richard: I know badly about GNU SASL :/

    Please comment here:

    The goal is to have a perfect compatibility with all systems and all projects.

    At the same time, to be compatible with Microsoft products, "tls-server-end-point" must be supported too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions