ildella on Nostr: I was giving for granted that it behave that way, then today I made an integration ...
I was giving for granted that it behave that way, then today I made an integration test over my signup API to see taht it would fail under an "attack" with a modified event.
The test failed and I got scared so I did dig deeper and wrote that test.
The whole library assembles in the "finalized event" both the original event and the sig/pub/hash properties. So when you call verifyEvent it uses the hashes that one pass as "id" rather than recalculate the hash from scratch from the original event properties.
I am no security expert but that look *very* bad to me.
The test failed and I got scared so I did dig deeper and wrote that test.
The whole library assembles in the "finalized event" both the original event and the sig/pub/hash properties. So when you call verifyEvent it uses the hashes that one pass as "id" rather than recalculate the hash from scratch from the original event properties.
I am no security expert but that look *very* bad to me.