Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subscription flow for Event ID integrity #119

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

filouz
Copy link

@filouz filouz commented Feb 19, 2024

This PR addresses a security issue by ensuring event IDs are verified, preventing a scenario where attackers could spoof event IDs to inject malicious events. It includes a fix and unit tests (TestEventIDIntegrity) for validation.

@fiatjaf
Copy link
Collaborator

fiatjaf commented Feb 26, 2024

This thing duplicates the hash calculation, so I'm trying to think of a way to not do that. Maybe create a new method, but I don't know.

@filouz
Copy link
Author

filouz commented Feb 26, 2024

To avoid recalculating the hash, you should update the ID using the one generated by the checkSignature method.

btw, I opened this issue due to the lack of feedback on my PR. Given the potential security risk, I strongly suggest reporting this as an issue, particularly if it is being deployed in a production environment by the community.

good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants