signal-golang / textsecure

TextSecure(signal) client package for Go
GNU General Public License v3.0
57 stars 26 forks source link

Triggering SIGSEGV by revoking Group Invite #44

Open Hetti opened 3 years ago

Hetti commented 3 years ago

I found a reproducible Crash in the textsecure Client

So running textsecure in Combination with a Desktop Client ist still bugging for me. For example Group Invites not working (like https://github.com/signal-golang/textsecure/issues/43) and I can't read the messages on the Desktop Client as it only states all the time "Unterhaltungssitzung aktualisiert" on the Desktop Client.

So for the SIGSEGV Crash; How to reproduce:

1) Make Group 2) Invite Textsecure Client Number 3) Client will be invited but does not automatically accepts invitations, therefore there is an open invitation for that client 4) Revoke invitation for the invited textsecure client 5) SIGSEGV

INFO[2021/07/23 13:51:52] [textsecure] Incoming WhisperMessage try legacy decrypting 
DEBU[2021/07/23 13:51:52] [textsecure] handleDataMessage xxxxxxxxxxxxxx xxxxxxxxxxxxxx XXXXXX 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] signature verification succesful 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] handle group action  <ID> 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] SourceUuid <ID> <nil> 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] Revision 9            
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] AddPendingMembers     
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] pendingMember <MEMBERID> 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] update group from server 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] queryGroupChangeFromServer 
DEBU[2021/07/23 13:51:52] [textsecure][groupsv2] get groupCredentials /v1/certificate/group/XXXXX/XXXXX 
DEBU[2021/07/23 13:51:52] [textsecure] GET /v1/certificate/group/XXXXX/XXXXX 200 
DEBU[2021/07/23 13:51:53] [textsecure] GET with auth /v1/groups/ 200   
DEBU[2021/07/23 13:51:53] [textsecure][groupsv2] queryGroupChangeFromServer group 
DEBU[2021/07/23 13:51:53] [textsecure][groupsv2] decrypt group         
DEBU[2021/07/23 13:51:53] [textsecure] save groupv2 .storage/groupsv2/<GROUPID> 
DEBU[2021/07/23 13:51:53] [textsecure][groupsv2] update group from server 
DEBU[2021/07/23 13:51:53] [textsecure] Websocket sending message       

INFO[2021/07/23 13:52:08] [textsecure] Incoming WhisperMessage try legacy decrypting 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x929083]

goroutine 1 [running]:
github.com/signal-golang/textsecure.handleDataMessage(0xDUMMY, 0xd, 0xDUMMY, 0x24, 0xDUMMY, 0xDUMMY, 0x0, 0xDUMMY)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.3.7/textsecure.go:491 +0x123
github.com/signal-golang/textsecure.handleMessage(0xDUMMY, 0xd, 0xDUMMY, 0x24, 0xDUMMY, 0xDUMMY, 0xfe, 0x150, 0x1d0, 0x400)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.3.7/textsecure.go:437 +0x50f
github.com/signal-golang/textsecure.handleReceivedMessage(0xDUMMY, 0x1e3, 0x200, 0xb0bc90, 0xDUMMY)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.3.7/textsecure.go:677 +0x914
github.com/signal-golang/textsecure.StartListening(0x0, 0x0)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.3.7/websocket.go:186 +0x31e
main.main()
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.3.7/cmd/textsecure/main.go:649 +0x68b

I replaced some of the values with 0xDUMMY. If needed, I can share in private the full logs.

Hetti commented 2 years ago

This is not anymore the case in the newest build.

Still having problems with https://github.com/signal-golang/textsecure/issues/43 and writing messages to numbers, but this is another problem.

Hetti commented 2 years ago

ah it's still an issue, if I revoke from phone messenger

nanu-c commented 2 years ago

Can you try with latest v1.7.0 and if it happens again, please paste the error again here. Thanks

Hetti commented 2 years ago

I just tested it. Now the Bot autojoins in Groups after invite :heart: Still, if you kick the Textsecure Client from the Group it Segfaults with SIGSEGV (but it seems, that the account is properly removed from the group)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x934f63]

goroutine 1 [running]:
github.com/signal-golang/textsecure.handleDataMessage(0xDUMMY0, 0xd, 0xDUMMY1, 0x24, 0xDUMMY2, 0xDUMMY3, 0x0, 0x38)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.7.1/handler.go:86 +0x123
github.com/signal-golang/textsecure.handleMessage(0xDUMMY0, 0xd, 0xDUMMY1, 0x24, 0xDUMMY2, 0xDUMMY4, 0xfe, 0x150, 0x209, 0x240)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.7.1/handler.go:22 +0x606
github.com/signal-golang/textsecure.handleReceivedMessage(0xDUMMY5, 0x209, 0x240)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.7.1/textsecure.go:591 +0x7a5
github.com/signal-golang/textsecure.StartListening(0x0, 0x0)
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.7.1/websocket.go:194 +0x713
main.main()
    /go/pkg/mod/github.com/signal-golang/textsecure@v1.7.1/cmd/textsecure/main.go:669 +0x6cb