-
Notifications
You must be signed in to change notification settings - Fork 289
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
Posts from other profiles showing in profile view timeline #1846
Comments
Never seen this before. Thanks @fishcharlie @jb55 @danieldaquino @tyiu @ericholguin have yall seen this behavior? |
Same, I haven't seen this before either. 🤔 |
Notes:
I'd be happy to submit a patch to add that guard statement if it is determined that Damus should be defensive here and protect against relays not filtering data properly. If not we can close this issue. I should also note that a client like https://iris.to handles this as expected (I don't see other people's posts in my profile view). I'm unsure about other clients. TLDR: Question for Damus maintainers: should I submit a patch to filter events that don't match your pubkey in ProfileModel.swift, to protect against relays sending bad data (not properly filtering events sent)? Or should Damus not be responsible for that? |
Can this be exploited by a malicious relay to add notes where they shouldnt be? cc @jb55 |
@alltheseas From my perspective, yes. When Damus asks for a users notes, a relay can return any list of notes it wants (not necessarily from that user that Damus asked about). And Damus will (currently) happily show them on every users profile page (even if the notes aren't associated with that user). Technically a relay returning notes that aren't associated with that user is a NIP spec violation. But obviously bugs (and malicious actors) can exist. Also. If anyone wants to test this. You can add |
Recreated. Your airport npub appears on @fishcakeday profile. |
On Mon, Jan 01, 2024 at 06:33:06PM -0800, alltheseas wrote:
Can this be exploited by a malicious relay to add notes where they shouldnt be?
cc @jb55
yes, which is why we don't connect to random relays, and why I'm
switching to a different way to pull notes:
Only ever query the local relay (nostrdb). The only role of network code
that pulls notes from other relays is to dump into nostrdb. This
will completely eliminate these types of exploits, and make the outbox
model doable in damus apps.
|
@jb55 Ok it sounds like you have a better solution than just adding a guard to check that the pubkeys match. I will work on fixing this on my end for the relay. @alltheseas Not sure if you want to close this issue or link it to whatever ticket @jb55 has for changing how Damus pulls notes. But that's up to you 😃. Thanks all for the insight here. |
On Tue, Jan 02, 2024 at 09:40:09AM -0800, Charlie Fish wrote:
@jb55 Ok it sounds like you have a better solution than just adding a guard to check that the pubkeys match.
I will work on fixing this on my end for the relay.
@alltheseas Not sure if you want to close this issue or link it to whatever ticket @jb55 has for changing how Damus pulls notes. But that's up to you 😃.
Thanks all for the insight here.
I'm ok with having the guard for now until we have switched over to this
new model.
|
@jb55 Awesome, I'll submit a patch hopefully today or tomorrow for that. |
Thanks @fishcharlie I added #1851 as a follow on long-term solution in the local relay migration |
Closes: #1846 Lightning-Invoice: lnbc1pjef2gupp5ffv0he47r6s6us9s2pfxy023mx8lutwlh3sq365rzgmmj6efl8nsdqqcqzpgxqrrs0fppq65gwnyvf5pn5zj5ryx9s4n7y58clk7yqsp5v7pa2ges4rgvtt0nh6lnt4cevm8n2ql9p7kqstwfp4wutf8faa8q9qyyssqwx8t9kk0m3jj6vu0kvftl3nc8zqyfl5l8ne058q5dnqyad3cqfz8vdnna5g0vy9f2ttwugc0sr20p0hsem84g8xd85ptnwgmryrf4lqqmygv34 Signed-off-by: Charlie Fish <contact@charlie.fish> Reviewed-by: William Casarin <jb55@jb55.com> Signed-off-by: William Casarin <jb55@jb55.com> Changelog-Fixed: Fixed bug where sometimes notes from other profiles appear on profile pages
Current Result
Profile timeline view shows posts/notes from users other than the user I'm viewing.
Expected Result
I expect when viewing a profile that it only shows me posts/notes from that specific user and posts/notes that user has reposted.
Steps to reproduce
From my perspective:
Obviously I wouldn't be surprised if more steps took place prior to this to get damus into this state, but I can not identify what those would be.
Video Recording
nostrTimelineBug.mp4
Version
Damus:
1.6 (28) 2585a37
TestFlight
Also observed on a2cac14 (development build I was using).
iOS:
17.2.1
iPhone 15 Pro Max
Other Information
The text was updated successfully, but these errors were encountered: