Skip to content

Commit

Permalink
Don't accept activities from actors less than 1 day old
Browse files Browse the repository at this point in the history
  • Loading branch information
hutchisr committed Oct 9, 2024
1 parent d70267c commit 10b6b84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/backend/src/core/activitypub/ApInboxService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ export class ApInboxService {
if (actor.isSuspended) return;

if (isCreate(activity)) {
if ((new Date()).getTime() - this.idService.parse(actor.id).date.getTime() < 86_400_000 ) {
return 'skip: actor must be older than 1 day';
}
return await this.create(actor, activity);
} else if (isDelete(activity)) {
return await this.delete(actor, activity);
Expand Down

0 comments on commit 10b6b84

Please sign in to comment.