Re:Another flaw in Signal desktop app leaks chats in plaintext
by pauldino on Friday May 18, 2018 @02:58AM
(#17099248)
It looks like those are 3 separate third-party libraries (Mocha, Mustache, and Backbone), so each doing HTML escaping a bit differently shouldn't be too surprising.
Re:Another flaw in Signal desktop app leaks chats in plaintext
by hawkice on Friday May 18, 2018 @02:15AM
(#17099097)
The first one doesn't escape single quotes or slash, but I have no idea how to get any HTML parser to treat just those as anything but text. Underscore's implementation will be correct, I'm sure.
Re:Another flaw in Signal desktop app leaks chats in plaintext
by codedokode on Friday May 18, 2018 @05:20AM
(#17099907)
Slash doesn't need to be encoded. Only 5 characters that have special meaning have to be encoded (&, <, >, " and ').
Re:Another flaw in Signal desktop app leaks chats in plaintext
by hawkice on Friday May 18, 2018 @05:39AM
(#17100006)
Which raises the best question: how would you exploit someone not escaping single quotes? I do not know. Perhaps it isn't possible.
Re:Another flaw in Signal desktop app leaks chats in plaintext
by jscissr on Friday May 18, 2018 @06:27AM
(#17100257)
I think escaping quotes only matters for attributes (which can use ' or ").
Example:
<img src="$url">
Exploit: foo.jpg" onload="alert('pwned')
Re:Another flaw in Signal desktop app leaks chats in plaintext
by kuroguro on Friday May 18, 2018 @09:05AM
(#17101100)
Heh, found the exact bug on a live bbcode parser some 5 years ago.
Re:Another flaw in Signal desktop app leaks chats in plaintext
by codedokode on Friday May 18, 2018 @05:45PM
(#17105205)
It was probably written using regexps? One should make full syntax analysis instead of writing regexp hacks.
https://github.com/signalapp/Signal-Desktop/blob/d1f7f5ee8c1...
Then here it's a different function:
https://github.com/signalapp/Signal-Desktop/blob/d1f7f5ee8c1...
Then sometimes they use the underscore library to do it:
https://github.com/signalapp/Signal-Desktop/blob/d1f7f5ee8c1...
Which their implementation seems to be using regular expressions as well.