From e02a443a4eaf02f0ab860b41d0bc7081d4110ab4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 23 Mar 2023 10:13:30 -0600 Subject: [PATCH] Check sender of bookmark:1 updates --- xmpp-vala/src/module/xep/0402_bookmarks2.vala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xmpp-vala/src/module/xep/0402_bookmarks2.vala b/xmpp-vala/src/module/xep/0402_bookmarks2.vala index 5641769a..64ed9149 100644 --- a/xmpp-vala/src/module/xep/0402_bookmarks2.vala +++ b/xmpp-vala/src/module/xep/0402_bookmarks2.vala @@ -57,6 +57,11 @@ public class Module : BookmarksProvider, XmppStreamModule { } private void on_pupsub_item(XmppStream stream, Jid jid, string id, StanzaNode? node) { + if (!jid.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) { + warning("Received alleged bookmarks:1 item from %s, ignoring", jid.to_string()); + return; + } + Conference conference = parse_item_node(node, id); Flag? flag = stream.get_flag(Flag.IDENTITY); if (flag != null) { @@ -66,6 +71,11 @@ public class Module : BookmarksProvider, XmppStreamModule { } private void on_pupsub_retract(XmppStream stream, Jid jid, string id) { + if (!jid.equals(stream.get_flag(Bind.Flag.IDENTITY).my_jid.bare_jid)) { + warning("Received alleged bookmarks:1 retract from %s, ignoring", jid.to_string()); + return; + } + try { Jid jid_parsed = new Jid(id); Flag? flag = stream.get_flag(Flag.IDENTITY);