xeals / signal-back

Decrypt Signal encrypted backups outside the app
Apache License 2.0
704 stars 67 forks source link

runtime error: slice bounds out of range #23

Open quizilkend opened 6 years ago

quizilkend commented 6 years ago

If I run signal-back on my backup (kind of large ~3.5GB) it stops with the following error message: signal-back v0.1.6-alpha.1:

./signal-back_linux_amd64 extract -o output signal-2018-07-11-02-19-01.backup 
Password: XXXX
Panicked: runtime error: slice bounds out of range
[frame: starting at 3864515, size 0]

signal-back v0.1.5:

./signal-back_linux_amd64 extract -o output signal-2018-07-11-02-19-01.backup 
Password: XXXX
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
github.com/xeals/signal-back/types.(*BackupFile).Frame(0xc4200f20e0, 0xc4c7293090, 0x0, 0x0)
        /home/travis/gopath/src/github.com/xeals/signal-back/types/backup.go:97 +0x4d1
github.com/xeals/signal-back/cmd.ExtractAttachments(0xc4200f20e0, 0x6, 0x0)
        /home/travis/gopath/src/github.com/xeals/signal-back/cmd/extract.go:56 +0xcc
github.com/xeals/signal-back/cmd.glob..func2(0xc4200a0420, 0x0, 0xc4200a0420)
        /home/travis/gopath/src/github.com/xeals/signal-back/cmd/extract.go:43 +0x8c
github.com/xeals/signal-back/vendor/github.com/urfave/cli.HandleAction(0x5939a0, 0x5dacf0, 0xc4200a0420, 0xc42009a100, 0x0)
        /home/travis/gopath/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/app.go:490 +0xc8
github.com/xeals/signal-back/vendor/github.com/urfave/cli.Command.Run(0x5cf178, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5d66e7, 0x24, 0x5d6b6a, ...)
        /home/travis/gopath/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/command.go:210 +0xa36
github.com/xeals/signal-back/vendor/github.com/urfave/cli.(*App).Run(0xc42009c1a0, 0xc4200900f0, 0x5, 0x5, 0x0, 0x0)
        /home/travis/gopath/src/github.com/xeals/signal-back/vendor/github.com/urfave/cli/app.go:255 +0x6a0
main.main()
        /home/travis/gopath/src/github.com/xeals/signal-back/main.go:51 +0x2e1

I'm not sure, but it could be related to https://github.com/xeals/signal-back/issues/19

If I can help with any additional information just let me know.

ytjohn commented 6 years ago

I'm having this issue as well, both with extracting and with formatting to import for XML.

./signal-back_darwin_amd64 -v signal-back v0.1.6-alpha.1-dirty proto commit: d6610f0

Will post a separate comment for the format output.

jh1:signal ytjohn$ ./signal-back_darwin_amd64 extract -v -o output signal-2018-07-24-14-38-09.backup
Password: 57708 00033 44821 48541 17385 64128
2018/07/24 14:50:23 found attachment binary 1491943414805
2018/07/24 14:50:23 file `1491943414805` has no associated SQL entry; going to have to guess at its encoding

<SNIP>

2018/07/24 14:50:24 found file type: {image jpeg image/jpeg}
2018/07/24 14:50:24 found attachment binary 1526822963335
2018/07/24 14:50:24 file `1526822963335` has no associated SQL entry; going to have to guess at its encoding
2018/07/24 14:50:24 found file type: {image jpeg image/jpeg}
Panicked: runtime error: slice bounds out of range
[frame: starting at 75636533, size 0]
ytjohn commented 6 years ago

Format out:

jh1:signal ytjohn$ ./signal-back_darwin_amd64 format -v -f XML signal-2018-07-24-14-38-09.backup
Password: 57708 00033 44821 48541 17385 64128
2018/07/24 14:52:50 MMS export not yet supported
2018/07/24 14:52:50 MMS export not yet supported
<SNIP>
2018/07/24 14:52:50 MMS export not yet supported
2018/07/24 14:52:50 MMS export not yet supported
Panicked: runtime error: slice bounds out of range
[frame: starting at 75636533, size 0]
ytjohn commented 6 years ago

After comparing them, it seems like I bomb out 75MB into the 111MB file. I suppose that could be a bad/corrupted message that far in. I made a fresh backup for this. I can get signal to ask for the passcode and start the restore (as long as I do everything on phone internal memory), but the app crashes, possibly on this same record.

xeals commented 6 years ago

@ytjohn Do the same issues occur on the stable build? Your backup might be large enough that it doesn't encounter the memory issues larger ones do, but is hitting the same wall large backups are hitting on the alpha build, so it's a good spot for me.

RE: app crashing, it may be worth trying to get a log for Signal via logcat over adb or something to see what the issue is.

ytjohn commented 6 years ago

Sorry for the delay. I ran it again with your latest release and a build from master.

https://gist.github.com/ytjohn/b952803a5d8705681c5c45c7ea95df74

quizilkend commented 6 years ago

@xeals I tried it again with the latest stable version and the problem persists.

ghost commented 4 years ago

Sometimes the same command works on the Mac but gets this error on Ubuntu (precompiled binaries for both).