5 ms·
I think it's worth knowing that the cryptography in Nostr appears to be a wreck. Here's a paper from EuroS&P this year, also presented at Black Hat on the crypt
by tptacek 1y ago
I think it's worth knowing that the cryptography in Nostr appears to be a wreck. Here's a paper from EuroS&P this year, also presented at Black Hat on the crypto track:
https://eprint.iacr.org/2025/1459.pdf https://eprint.iacr.org/2025/1459.pdf
The vulnerabilities here are pretty :yikes:
* The event protocol that drives the system doesn't authenticate public keys, so asymmetric signatures are performative: attackers that can intercept messages (Nostr servers, the presumed adversary of an E2EE messaging system) can just swap out keys and re-sign.
* Two major clients, the mobile phone Damus app and the web Iris app, don't even verify signatures to begin with.
* DMs in this system are unauthenticated CBC, so attackers can simply bitflip messages and events to say what they want.
* The apps do automatic link-preview, so they've managed to reconstitute the EFAIL attack: attackers can locate links within messages (they'll be revealed by SNI and DNS anyways) and then bitflip them to point to attacker-controlled servers, exposing both the URLs (which will often contain tokens) and, with a bit of extra work, the message itself (by tacking `?foo=` onto a URL).
* There's no key separation in the system, so you can trick users into running a subprotocol other than the messaging system, then establishing a session key, which will then be used for messaging.
These are really basic errors; this is mid-aughts-level cryptographic engineering. There are probably a variety of other reasons to use Nostr, but end-to-end security does not appear to be one of them.
- Imustaskforhelp 1y agowhy is this the first time that I came across these issues. Someone should talk about these issues asap. What federated platform might be the more secure tho protocol wise, bluesky (at protocol) or fediverse
- nout 1y agoThe paper seems to be referencing issues in client apps during early development of those apps that have since been fixed. So that's likely why it's not being talked about now.
- ursuscamp 1y agoSo, I was part of the Nostr community for quite a while and was the author of a popular Nostr extension for Safari, before eventually giving up on Nostr for various reasons. I haven't read that entire paper. Mainly, I skipped to the section you mention here: > The event protocol that drives the system doesn't authenticate public keys, so asymmetric signatures are performative: attackers that can intercept messages (Nostr servers, the presumed adversary of an E2EE messaging system) can just swap out keys and re-sign. I think you and the authors perhaps misunderstand the Nostr protocol. Nostr is, effectively, an identity system tied to a public key. The cryptography is sound. Your identity is your public key. When you request a user's profile, or their events, you request it specifically by their public key. That is unforgeable (assuming no bugs in the implementation, like what the authors found in Damus). This does present UX issues that can manifest as security issues, such as "how can you verify that a user with a certain public is who they say they are instead of an impostor". That is a separate issue from whether the cryptography itself is sound.
- sealeck 1y ago> how can you verify that a user with a certain public is who they say they are instead of an impostor This sounds awfully much like a cryptography problem to me!
- tptacek 1y agoIf you read the entire paper you'll see that the paper presents a formalized set of security goals that acknowledge Nostr uses public keys as identities. They haven't misunderstood the system. Meanwhile: the cryptography is obviously unsound: it relies on unauthenticated CBC, and signatures that aren't verified, and provides attackers with the ability to coerce users into following links.
- jonstaab 1y agoThe cryptography was thrown together in the very early days as a proof of concept, that reached some level of adoption because of how nostr suddenly grew at the end of 2022. The community has since largely switched to a new standard (NIP 44) which has been independently audited, although there are some popular clients that haven't yet transitioned.
- fiatjaf 1y agoUnfortunately this paper doesn't live up to its goal of being a cheap attack on Nostr. The fact is that clients do verify signatures from events received from servers, that is in the protocol specification and should be obvious to anyone mildly honest. The entire assumption of the paper is that clients don't do that and it is void. Yes, they did find a couple of clients 2 years ago that didn't verify signatures -- so much for a vulnerability in the protocol. I guess they wanted Nostr to have a code police arresting client developers who didn't finish their implementation? Aside from that the attacks they demonstrated depend on a bunch of other absurd circumstances (like you have to manually and voluntarily type the URL of the attacker server in order to be attacked) but it's not even worth talking about them since the basic assumption is so completely false already. The encrypted messages stuff is not even a core part of Nostr anyway, Nostr is a broadcasting protocol for public or semi-public content. Encryption can be added on top and there are multiple ways and proposals for how to do it, including an implementation of MLS and other methods and I personally mostly do not care about any. I wish the paper authors were more honest and republished their work with the title: "the dangers of trusting a cryptographic signature without verifying it", but I imagine that it would have been too obvious and worthless if it was phrased like that.
- tptacek 1y agoThey're academic cryptography researchers. They do not care what messaging system you use. This is what academic messaging cryptography papers look like; a paper like this is why Matrix transitioned (is transitioning?) from ad hoc cryptography to MLS.
- mediumsmart 1y agoThanks for clearing up that the issue is academic as in irrelevant concerning nostr
- jb55 1y ago> The event protocol that drives the system doesn't authenticate public keys, so asymmetric signatures are performative: attackers that can intercept messages (Nostr servers, the presumed adversary of an E2EE messaging system) can just swap out keys and re-sign. This is completely nonsense, most clients do in fact check signatures. All relays do as well. > Two major clients, the mobile phone Damus app and the web Iris app, don't even verify signatures to begin with. Author of Damus here. this is an analysis of an old version. This has since been fixed. In the early days we connected to a fixed relay list of trusted relays. These relays verified signatures. This was just a pragmatic tradeoff thing until we had an optimized work queue for verifying notes (this lead to nostrdb, a custom embedded nostr database built on lmdb. it's a sqlite but for nostr https://github.com/damus-io/nostrdb https://github.com/damus-io/nostrdb) > DMs in this system are unauthenticated CBC, so attackers can simply bitflip messages and events to say what they want. not really true since the whole note is covered by a secp256k1 signature. > The apps do automatic link-preview, so they've managed to reconstitute the EFAIL attack: attackers can locate links within messages (they'll be revealed by SNI and DNS anyways) and then bitflip them to point to attacker-controlled servers, exposing both the URLs (which will often contain tokens) and, with a bit of extra work, the message itself (by tacking `?foo=` onto a URL). you can turn off these, you can turn off images as well. people should run a VPN of course if they are worried about these things.
- tptacek 1y agoI don't think you can say "this is complete nonsense" and "this has since been fixed" in the same comment. Also: don't use ECC signatures as MACs. Signatures are not MACs.
- jonstaab 1y agoThe criticisms are either implementation dependent (not checking signatures, which defeats the entire purpose of the protocol), or based on a very early proof of concept encryption scheme which has since been superseded (by NIP 44, which was independently audited). There's nothing substantial or actionable here (any more).
- irq-1 1y agoI tried to find out what key algorithm is used -- not listed anywhere. Everything led to pages about Blech32 (a bitcoin key encoding). https://hellonostr.dev/en/introduction/ https://hellonostr.dev/en/introduction/ The encoding seems to have an unmentioned/unaddressed version number included, both in the nostr doc and the bitcoin docs. npub1abcxyz... is npub (header) 1 (version) abcxyz... (key) Now take a look at the doc (linked above.)
- vnuge 1y agonip01 defines the use of secp256k1. Again, the same as bitcoin.