Skip to content

Cap remote recipient fetches per incoming activity#3094

Open
pfefferle wants to merge 4 commits intotrunkfrom
fix/cap-remote-recipient-fetches
Open

Cap remote recipient fetches per incoming activity#3094
pfefferle wants to merge 4 commits intotrunkfrom
fix/cap-remote-recipient-fetches

Conversation

@pfefferle
Copy link
Member

Summary

  • Limits the number of outbound HTTP requests triggered by remote recipient URLs in to/cc/bcc fields of incoming activities.
  • Defaults to 5 remote fetches per activity, filterable via activitypub_max_remote_recipient_fetches.
  • Prevents abuse where a crafted activity with many remote recipients could trigger unlimited outbound requests from the server.

Test plan

  • Send an activity with fewer than 5 remote recipients in to/cc/bcc — all should be resolved as before.
  • Send an activity with more than 5 remote recipients — only the first 5 should trigger outbound fetches, the rest should be skipped.
  • Verify local (same-domain) recipients are unaffected by the cap.

Limit the number of outbound HTTP requests triggered by remote
recipient URLs in to/cc/bcc fields to prevent abuse. Defaults to 5,
filterable via `activitypub_max_remote_recipient_fetches`.
Copilot AI review requested due to automatic review settings March 25, 2026 10:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR mitigates abuse of the shared inbox endpoint by limiting how many outbound HTTP fetches can be triggered from remote recipient URLs embedded in incoming ActivityPub activities.

Changes:

  • Add a per-activity cap (default: 5) on remote recipient lookups, filterable via activitypub_max_remote_recipient_fetches.
  • Skip additional remote recipient fetches once the cap is reached while continuing to process same-domain recipients.
  • Add a patch-level changelog entry documenting the fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
includes/rest/class-inbox-controller.php Adds the remote-recipient fetch cap (and introduces a new filter) inside get_local_recipients().
.github/changelog/fix-cap-remote-recipient-fetches Documents the change as a patch “fixed” item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants