TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Three lessons from Threema: Analysis of a secure messenger

145 点作者 thijser超过 2 年前

8 条评论

some_furry超过 2 年前
One of the key takeaways here that I think might be under-emphasized (although Kenny Paterson did say as much):<p>Even if you use good cryptographic building blocks, and good libraries that implement the building blocks, you can still make horrible mistakes with protocol design.<p>The best mechanism we have for preventing weak cryptographic protocols is to use formal methods (proofs, checked by a computer).<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;kennyog&#x2F;status&#x2F;1612337097247002624" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;kennyog&#x2F;status&#x2F;1612337097247002624</a>
tptacek超过 2 年前
The attacks in this paper are much less damaging than the attacks in the Nebuchadnezzar paper were against Matrix. But somehow, Threema comes out looking even worse:<p>* Threema&#x27;s end-to-end inner protocol, the one used to exchange messages between actual humans, is based on a single X25519 key, used bidirectionally. It has no forward secrecy. Worse, to prevent otherwise-trivial replay attacks made possible by the simplistic structure of the protocol, both sides have to cache every nonce they&#x27;ve seen used to encrypt a message. This breaks down when users change devices, which, due to the structure of the protocol, is trivially detectable.<p>* The Threema E2E protocol includes enough metadata to ostensibly enforce message ordering, <i>but they don&#x27;t authenticate it</i>, so attackers can (1) strip the metadata off and (2) hold back and&#x2F;or reorder messages at their luxury.<p>* Threema has the hello-world of E2E protocols, but for reasons not made clear has chosen to build their own transport protocol for client-server transactions (ie, login), rather than using TLS or NoiseIK. The C2S handshake has the raw material to do an authenticated DH key exchange, ala 3DH (both sides have long-term and ephemeral secrets), but they freelanced it instead and come up with a proof-of-identity round trip that is trivially replayable, and which destroys the forward secrecy of the C2S protocol.<p>* One form of Threema backup uses encrypted ZIPs, which reveal the names of files, which files apparently (according to the paper) reveal the identity of counterparties you&#x27;ve been talking to. Also: the ZIP library the client uses didn&#x27;t verify MACs, and while Threema fixed that, the maintainer of the ZIP library Threema chose hasn&#x27;t responded, which is :grimace-emoji:.<p>* You can &quot;lock&quot; your Threema app, but it does so much background processing that attackers can extract your private key if they have access to the device (or, maybe, all its traffic?) --- to wit, Threema does automated backups, the backups are compressed-then-encrypted, Threema processes messages in the background even when locked, one of those messages runs an automatic contact discovery protocol, and attackers can inject contact-discovery messages to do a byte-by-byte CRIME-style recovery of the private key, which is embedded in the same JSON document(!) as contact information in the backup system.<p>There is a very funny bit in the middle of the paper where they reconstitute the C2S proof-of-identity replay attack, this time minting a new identity proof rather than replaying it. To pull this off, they bounce the C2S protocol off of the E2E protocol: because, and I cannot believe I am saying this, Threema uses PKCS7 padding (ie, &quot;I&#x27;m 3 bytes short of my block size, so I&#x27;ll pad with 03h 03h 03h&quot;), you can trick a Threema client into sending a message which, once encrypted, will have the 01h-delimited format of the identity proof (because 1&#x2F;254 validly padded messages will happen to end in 01h). I didn&#x27;t read closely enough to figure out if there was any reason you would go to the trouble of executing this attack variant, and it is entirely possible that they are just showing off. But: that&#x27;s why you read these kinds of papers! For the stunt cryptography!<p>A bit of advice: read these papers for the cryptographic design and pitfall ideas, not for verdicts on which messaging systems to use. Maybe there are very good reasons to use Threema besides its flimsy protocol design; the point is: we know how to design better protocols that don&#x27;t have these problems, and so (1) here are some more examples for the textbooks on why you should domain-separate your keys (for instance, to make it impossible to bounce the C2S protocol off the E2E protocol in the first place), and (2) Threema could drastically improve their system simply by adopting a known-good protocol rather than freelancing their own.<p>Great stuff.<p>[1] <a href="https:&#x2F;&#x2F;nebuchadnezzar-megolm.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nebuchadnezzar-megolm.github.io&#x2F;</a>
评论 #34318555 未加载
评论 #34321629 未加载
spacebeer超过 2 年前
I haven&#x27;t read all, but Attack no. 6 requires access to unlocked phone. IMO, if that is the case, I wouldn&#x27;t consider this as an attack, at least not as something that would stop me using the service
评论 #34315884 未加载
upofadown超过 2 年前
Threema has responded:<p><a href="https:&#x2F;&#x2F;threema.ch&#x2F;en&#x2F;blog&#x2F;posts&#x2F;news-alleged-weaknesses-statement" rel="nofollow">https:&#x2F;&#x2F;threema.ch&#x2F;en&#x2F;blog&#x2F;posts&#x2F;news-alleged-weaknesses-sta...</a> New Paper on Old Threema Protocol
评论 #34317979 未加载
评论 #34315511 未加载
评论 #34318194 未加载
mattwilsonn888超过 2 年前
I would be very interested to know what overlap any of these attack surfaces may have with Signal, or other prominent applications.<p>What issues are fixable, which are more endemic to the classical architectures?
评论 #34316913 未加载
karlkloss超过 2 年前
The problem with messengers: The more secure and privacy centered they are, the less likely it is that any of your friends and relatives use them.
评论 #34332457 未加载
marosgrego超过 2 年前
Threema messages of Marian Kočner, a contorversial Slovak businessman who allegedly ordered a murder of a local journalist, were somehow obtained with the help of Europol. [0] The part of his trial where a security expert explained how the police got the messages was purposely not made public.<p>[0] <a href="https:&#x2F;&#x2F;spectator.sme.sk&#x2F;c&#x2F;22216551&#x2F;threema-saga-kocner-reportedly-referred-to-fico-as-the-boss.html" rel="nofollow">https:&#x2F;&#x2F;spectator.sme.sk&#x2F;c&#x2F;22216551&#x2F;threema-saga-kocner-repo...</a>
评论 #34316750 未加载
评论 #34318183 未加载
dewey超过 2 年前
Not directly related to the topic but how is it that Threema is the only popular secure messenger where you have a random ID to give to people to communicate with and not a phone number (Signal) or have your name show up across all your contacts &#x2F; groups (Telegram)?
评论 #34316871 未加载
评论 #34318553 未加载
评论 #34317643 未加载
评论 #34315820 未加载
评论 #34316152 未加载
评论 #34316201 未加载
评论 #34317877 未加载
评论 #34318217 未加载
评论 #34316659 未加载