Private
Public Access
ssrf_guard.MAX_RESPONSE_BYTES (S1) already bounds the raw download, but a feed within that byte cap can still carry an unreasonable number of entries, or one entry with an unreasonably large body — both cost real CPU/DB time (nh3 sanitization, an Article row/UPDATE) per entry. fetch_and_ingest now processes at most MAX_ENTRIES_PER_POLL (200) entries per poll (logging a warning when truncated) and sanitize_html bounds both its input (sanitizer cost) and output (what's actually stored/rendered) length. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>