Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

This one weird trick, the devs don't want you to know, crashes recipients' TS

Open 2-4601 opened this issue 11 years ago • 11 comments

(Couldn't resist with the title :( ·)

There seems to be no size checking on group name.

  1. Update a group's name with A Modest Proposal by Jonathan Swift (Try the Plain Text UTF-8 option from Project Gutenberg. Direct links don't work.)
  2. After tapping the checkmark to broadcast the update the other group members' TS will crash

If you strip the Gutenberg metadata (introduction, license etc.) and just paste the actual text it won't crash. So the sweet spot is somewhere between 20-40KB.

In any case it's still a big wall of text that shouldn't be. a modest proposal-jonathan swift

  • TS 2.17.0
    • Nexus 4, stock Android 5.1.1
    • Huawei U8800, Android 4.0.4

Debug log: https://gist.github.com/152ae1566c6c3d245ab0

E/AndroidRuntime( 4560): FATAL EXCEPTION: Thread-530
E/AndroidRuntime( 4560): Process: org.thoughtcrime.securesms, PID: 4560
E/AndroidRuntime( 4560): java.lang.IllegalArgumentException: byteCount < 0: -26331
E/AndroidRuntime( 4560):    at okio.RealBufferedSource.read(RealBufferedSource.java:46)
E/AndroidRuntime( 4560):    at com.squareup.okhttp.internal.ws.WebSocketReader$FramedMessageSource.read(WebSocketReader.java:249)
E/AndroidRuntime( 4560):    at okio.Buffer.writeAll(Buffer.java:705)
E/AndroidRuntime( 4560):    at okio.RealBufferedSource.readByteArray(RealBufferedSource.java:92)
E/AndroidRuntime( 4560):    at org.whispersystems.textsecure.internal.websocket.OkHttpClientWrapper.onMessage(OkHttpClientWrapper.java:102)
E/AndroidRuntime( 4560):    at com.squareup.okhttp.internal.ws.WebSocketReader.readMessage(WebSocketReader.java:110)
E/AndroidRuntime( 4560):    at com.squareup.okhttp.internal.ws.WebSocket$ReaderRunnable.execute(WebSocket.java:355)
E/AndroidRuntime( 4560):    at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
E/AndroidRuntime( 4560):    at java.lang.Thread.run(Thread.java:818)

2-4601 avatar Jun 10 '15 18:06 2-4601

abridged version: effective. Power لُلُصّبُلُلصّبُررً ॣ ॣh ॣ ॣ 冗

mcginty avatar Jun 10 '15 18:06 mcginty

@mcginty I wonder how many people had github notifications for this thread crashing their iPhones for that note! :)

jeremymasters avatar Jun 10 '15 19:06 jeremymasters

Rough estimate: >9000 people

2-4601 avatar Jun 10 '15 23:06 2-4601

I'm curious. Has anyone tried this with Signal contacts? I don't have any iOS devices to test with or Signal friends that I hate :)

2-4601 avatar Jun 12 '15 23:06 2-4601

@FredericJacobs might wan't to try this :question:

McLoo avatar Jun 13 '15 22:06 McLoo

This looks similar to https://github.com/square/okhttp/issues/1071 which was fixed in their 2.4.0 release.

cascheberg avatar Dec 05 '15 10:12 cascheberg

guess this can be closed, as ~~fixed~~ worked around with 038f24f

McLoo avatar Dec 11 '15 11:12 McLoo

Or wait for a complete fix? rhodey wrote:

... we'll have to take note of this in #3388 and make sure to keep it open until the 2nd half is also complete.

2-4601 avatar Dec 11 '15 14:12 2-4601

038f24f / #3438 only shows effect when you use the system emojis.

The android:maxLength attribute sets an InputFilter for the EditText object. This filter is overwritten in EmojiEditText when you use Signal's built-in emojis.

You can easily verify this by trying to reproduce this issue with the steps provided in the initial post. Do it one time with system emojis and another time with the built-in emojis.

FeuRenard avatar Aug 30 '16 22:08 FeuRenard

Current state:

  • What is done: we prevent Signal users from setting too large group names.
  • Has to be done (according to @rhodey): Prevent Signal from crashing when it receives a too large group name.

FeuRenard avatar Oct 21 '16 15:10 FeuRenard

GitHub Issue Cleanup: See #7598 for more information.

automated-signal avatar Apr 02 '18 21:04 automated-signal