Skip to content

require scram server nonce to extend the client nonce - #896

Open
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:scram-server-nonce-extend
Open

dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:scram-server-nonce-extend

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

When the SCRAM-SHA-256 client processes the server-first message it only checks that the server nonce begins with the client nonce, so a server (or a man in the middle) can echo the client nonce unchanged and the client carries on as though the handshake were sound. RFC 5802 section 5.1 requires the server to append its own nonce to the client's, and accepting an unchanged value drops the server's contribution to the combined nonce and the freshness that comes with it. This tightens the check in ScramScheme to also require the server nonce to be strictly longer than the client nonce, with a regression test; conformant servers always extend the nonce, so interoperability is unaffected.

@ok2c
ok2c requested a review from arturobernalg October 11, 2026 08:54
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