matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Insanely long fake Client Access Token crashes Dendrite #1817

Closed bobrtc closed 3 years ago

bobrtc commented 3 years ago

Background information

Description

Send a long garbage token from a Mautrix client, Dendrite crashes in about 3 minutes.

Steps to reproduce


client, err := mautrix.NewClient(homeserver, "@oops:bobrtc.tel", "aslihgfbaolfvugasidufgaosidvbfoiafboiasFIUefiuehfieufhiefuhwkfljhaslkgjhqalowiguhqawiughalsdijfhlasdfhiolauwhfaloiweuhflawsujehflasdujfhiqa7uwhfoliauwhfiloauhfaisdujfhawiufholuwhfiolawuehfqiunfoliuqhioqutqiuytoiqwufhoqiwufhqowiefhqwoiefhiqouwehoiquwehfqoiuwfhoqiwfqiwefhqwfuybfoauyfvoiuavoblaiufboiudyfioauyobiaudsyfboiuayfoiauyo9aq876to8b74w6tbo87arwvtbo87wa6tbfavo87o46ob8q7a6btovaovbat48v6ab84ao86tbvc8ao476wtvbob64t")

if err != nil {
     panic(err)
}

Then try to use this client to chat in a room at a regular interval. Eventually, no messages will send.

bobrtc commented 3 years ago

This appears to be caused by file handles not being closed. Running out of sockets b/c dendrite is not closing IPv6 connections.