From 3e054573da70da78312a4da018889fc55c469041 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Wed, 27 Mar 2024 23:01:51 +0900 Subject: [PATCH] fix (backend): reject anonymous objects --- packages/backend/src/remote/activitypub/resolver.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 5f7752bd3..e972d35de 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -133,7 +133,10 @@ export default class Resolver { throw new Error("invalid response"); } - if (object.id == null) return object; + if (object.id == null) { + throw new Error("Object has no ID"); + } + if (finalUrl === object.id) return object; if (new URL(finalUrl).host !== new URL(object.id).host) {