Skip to content

fix: accept a SCRAM server signature sent in a challenge - #897

Open
jcbrand wants to merge 1 commit into
scram-abortfrom
scram-final-challenge
Open

jcbrand wants to merge 1 commit into
scram-abortfrom
scram-final-challenge

Conversation

@jcbrand

@jcbrand jcbrand commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Stacked on #895.

RFC 6120 § 6.3.10 requires clients to support the less efficient SASL mode, in which a server doesn't send additional data with <success>. For SCRAM that data is the server-final message (v=<signature>), which such a server sends as a second <challenge>. The client answers with an empty <response/> and the server then sends an empty <success/>.

Strophe parsed that second challenge as a server-first message and aborted with SCRAM_BAD_CHALLENGE.

Now:

  • A challenge that follows the answered one is checked as the server-final message. If its signature is right, Strophe sends an empty <response/>. If it's wrong, missing or an e= server error, Strophe aborts with SCRAM_BAD_SERVER_SIGNATURE.
  • An empty <success/> is accepted once the signature was verified that way. A <success> that carries data must still carry the right signature.
  • Any further challenge aborts with SCRAM_BAD_CHALLENGE, as does a v= challenge before the first one was answered.

Prosody and ejabberd send v= in <success>, so they weren't affected.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant