From 794b4a2483053c09229d51cf074b877631a4fe52 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 29 May 2024 01:54:12 -0400 Subject: [PATCH] allow null bytes in bearer tokens (Haven't decided what to do at the spec level yet) --- irc/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/handlers.go b/irc/handlers.go index 7aaad37c..8b4cd9a1 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -311,7 +311,7 @@ func authIRCv3BearerHandler(server *Server, client *Client, session *Session, va defer session.sasl.Clear() // \x00 \x00 - splitValue := bytes.Split(value, []byte{'\000'}) + splitValue := bytes.SplitN(value, []byte{'\000'}, 3) if len(splitValue) != 3 { rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), client.t("SASL authentication failed: Invalid auth blob")) return false