fix: WebSub hardening from the adversarial review (v2.10.1)

- Per-item error handling in the worker; hard time limits on requests
- Notes with photos announced after attach; feed cache/ETag follow
  content_version
- Keep failing subscriptions until lease end; retry DNS and render errors;
  hub.mode=denied for gone topics
- Spec 5.1: decode unreserved chars, echo requested topic, ignore lease and
  secret on unsubscribe, case-insensitive Content-Type, refuse empty secret
- Limits count pending requests per callback address; callback validation;
  request_id guards the verification race (migration 017)
- Render once per topic per pass; likes only push /likes; Vary: Accept

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-03 11:23:36 -07:00
1 parent 409b8b31b4
commit b2043286fa
17 files changed
+825 -151

No files matched your search

+1 -4
View File
@@ -760,10 +760,7 @@ def handle_update(data: dict, token_info: dict):
if "photo" in touched:
from starpunk.media import attach_media_to_note
attach_media_to_note(note.id, media_ids, captions)
note_changed(note.id)
if not changes: # update_note already told WebSub otherwise
from starpunk import websub
websub.note_changed(note, was_public=note.published)
note_changed(note.id) # attach_media_to_note tells WebSub
except InvalidNoteDataError as e:
raise MicropubValidationError(str(e))
except MicropubError: