News for hackers. Stuff that matters.
Re:Another flaw in Signal desktop app leaks chats in plaintext by symlinkk on Thursday May 17, 2018 @06:30PM (#17096681)
None of this is caused because of them using a dynamic language. It's caused because the developers used a function literally called "dangerouslySetInnerHTML" that doesn't escape HTML. That's it. It's just lazy programming.
Re:Another flaw in Signal desktop app leaks chats in plaintext by vjeux on Thursday May 17, 2018 @10:33PM (#17098226)
We called it that way in React in order to call out attention to the fact that it was actually dangerous. React also properly escapes everything else it prints.

The app isn't using React but jQuery, which doesn't have those protections.

Re:Another flaw in Signal desktop app leaks chats in plaintext by archgoon on Thursday May 17, 2018 @11:21PM (#17098432)
This doesn't seem to be true, here's the v1.10.0 code:

https://github.com/signalapp/Signal-Desktop/blob/f6eb745632c...

They do seem to be using react, and using dangerouslySetInnerHTML. Now that said, I haven't confirmed that this is the code that caused the issue, but it is in the Quotes component, which is referenced in the article.

They seem to have fixed this specific issue a few days ago (v.11.0):

https://github.com/signalapp/Signal-Desktop/blob/0d00fbfb7a2...

They do seem to be using jQuery elsewhere in the code base, but I'm not familiar enough to determine how it all fits together.

Re:Another flaw in Signal desktop app leaks chats in plaintext by vjeux on Friday May 18, 2018 @12:43AM (#17098761)
Oh sorry you are right! I was reading the comment ( https://news.ycombinator.com/item?id=17097501 ) which said that the issue was caused with $.html
Re:Another flaw in Signal desktop app leaks chats in plaintext by ddtaylor on Thursday May 17, 2018 @11:28PM (#17098461)
They are using many frameworks mixed together like jQuery, React, and underscore.
Re:Another flaw in Signal desktop app leaks chats in plaintext by mtgx on Friday May 18, 2018 @12:14AM (#17098646)
I may be wrong, but I think the Signal desktop app was written by like interns or new developers working for Signal.

The Android app was written by Moxie, and I think it's the one about which Matthew Green said:

After reading the code, I literally discovered a line of drool running down my face. It’s really nice.

https://signal.org/

Re:Another flaw in Signal desktop app leaks chats in plaintext by fjsolwmv on Friday May 18, 2018 @12:35AM (#17098726)
I hope Moxie learned that programming his people/team is as programming his software. This tarnishes Signal, regardless of how good the Android app is.
Re:Another flaw in Signal desktop app leaks chats in plaintext by kbwt on Friday May 18, 2018 @07:14AM (#17100458)
The native code (RedPhone remnants?) did not inspire confidence last I looked at it.
Re:Another flaw in Signal desktop app leaks chats in plaintext by lnrdgmz on Friday May 18, 2018 @12:02AM (#17098598)
Naive question: Are there functions analogous to `dangerouslySetInnerHTML` in non-JS GUI libraries (e.g. Qt) that will allow a similar attack?
Re:Another flaw in Signal desktop app leaks chats in plaintext by jrockway on Friday May 18, 2018 @07:23AM (#17100504)
I mean, in C++ "=" could be called "dangerouslySetAribtraryMemoryLocation" and it would be just as accurate. In native code, even trivial operations like concatenating two strings or setting a variable can cause arbitrary code to execute.
Re:Another flaw in Signal desktop app leaks chats in plaintext by jhasse on Friday May 18, 2018 @08:41AM (#17100939)
Care to give an example?
Re:Another flaw in Signal desktop app leaks chats in plaintext by moefh on Friday May 18, 2018 @01:22PM (#17103198)
Assuming OP was talking about overloading the '=' operator:

  struct A {
    int *p = nullptr;
  
    A& operator=(int i) {
      *p = i;
      return *this;
    }
  };

  int main(void)
  {
    A a;
    a = 1;  /* boom! */
    return 0;
  }
Re:Another flaw in Signal desktop app leaks chats in plaintext by camgunz on Friday May 18, 2018 @01:21PM (#17103191)
strcat (or, honestly, anything in string.h). strcat assumes its first argument has enough allocated space for the contents of the 2nd argument, and that the 2nd argument is NULL terminated. If either of those assumptions is wrong, strcat will overwrite memory, corrupting either your heap or your stack, both of which can lead to arbitrary code execution. It's laughably easy to do, so easy that even typing the letters `strcat` into your program is forbidden in basically every C/C++ shop.
Re:Another flaw in Signal desktop app leaks chats in plaintext by jhasse on Saturday May 19, 2018 @01:37PM (#17108841)
strcat is C and not C++ though.
Re:Another flaw in Signal desktop app leaks chats in plaintext by camgunz on Sunday May 20, 2018 @11:13AM (#17113062)
Nah it's both. C++ was deliberately designed to be a superset of C. It's diverged a little bit, but it's mostly still the case. Or, call it `std::strcat` if you like.