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

+3
View File
@@ -26,6 +26,9 @@ PUBLIC = [(2, 1, 6, "", ("93.184.216.34", 0))]
def web(monkeypatch):
"""Subscriber callbacks: handler(request) -> response, by host"""
hosts, seen = {}, []
# Every test client shares one IP; don't let earlier tests rate-limit this one
from starpunk.rate_limiter import RateLimiter
monkeypatch.setattr("starpunk.routes.websub._limiter", RateLimiter(limit=1000, window_seconds=60))
def handler(request):
host = request.headers["host"]