Browse Source

allow null bytes in bearer tokens

(Haven't decided what to do at the spec level yet)
tags/v2.14.0-rc1
Shivaram Lingamneni 1 month ago
parent
commit
794b4a2483
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      irc/handlers.go

+ 1
- 1
irc/handlers.go View File

@@ -311,7 +311,7 @@ func authIRCv3BearerHandler(server *Server, client *Client, session *Session, va
311 311
 	defer session.sasl.Clear()
312 312
 
313 313
 	// <authzid> \x00 <type> \x00 <token>
314
-	splitValue := bytes.Split(value, []byte{'\000'})
314
+	splitValue := bytes.SplitN(value, []byte{'\000'}, 3)
315 315
 	if len(splitValue) != 3 {
316 316
 		rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), client.t("SASL authentication failed: Invalid auth blob"))
317 317
 		return false

Loading…
Cancel
Save