From 48bf54b948b0ae46f45f2e6731e9f59fad1ac6af Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 17 Apr 2026 13:32:49 -0400 Subject: [PATCH] fix: #14185, assert note if Like received to a post that doesn't already exist --- src/activitypub/inbox.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/activitypub/inbox.js b/src/activitypub/inbox.js index 374ad3da1c..2a52a96903 100644 --- a/src/activitypub/inbox.js +++ b/src/activitypub/inbox.js @@ -338,9 +338,16 @@ inbox.like = async (req) => { exists = await posts.exists(_id); id = _id; } - } else { exists = await posts.exists(object.id); + if (!exists) { + // Proactively pull in the note + const asserted = await activitypub.notes.assert(0, object.id, { skipChecks: 1 }); + if (!asserted) { + throw new Error('[[error:invalid-pid]]'); + } + exists = true; + } id = object.id; } if (!id || !exists) {