maint: Dependency upgrades and High backlog items (v2.11.0)

- All dependencies to current releases (97 known vulnerabilities -> 0),
  Python 3.14, uv pinned, requirements-test.txt, lxml/dateutil pinned
- CSRF tokens on admin forms, logout and IndieAuth consent
- IndieAuth client and crosspost link-card fetches via safe_get
- FLASK_DEBUG/FLASK_ENV default off/production; image sets them
- Foreign keys enforced on pooled connections; migration 018 removes orphans
- Rate limits shared across processes (rate_limits, migration 019)
- datetime.utcnow() and sqlite3 default adapters replaced
- compose.yaml fixed; duplicate dev_auth.py and test.ini removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-03 13:09:52 -07:00
1 parent 9f17e145ff
commit 75946be7b2
67 files changed
+885 -498

No files matched your search

@@ -328,14 +328,16 @@ In place:
untrusted redirect URIs never followed.
- Post-login redirects are limited to this site.
CSRF (v2.11.0): admin form POSTs, `/auth/logout` and the consent form's
approve button need a `csrf_token` field (or `X-CSRF-Token` header) equal to
an HMAC-SHA256 of the `starpunk_session` cookie under `SECRET_KEY`; anything
else gets 400. The token changes with every login and needs no storage.
Endpoints apps call with bearer tokens are not affected. The client metadata
fetch uses `webmention_ssrf.safe_get` (every redirect hop checked, the
connection pinned, a 5-second limit).
Known gaps:
- Admin forms and the consent form have no CSRF token. They rely on the
`SameSite=Lax` session cookie, which cross-site POSTs don't carry.
- The client metadata fetch checks the `client_id` URL against private
addresses, but then makes a plain `httpx.get` that follows redirects.
Redirect hops are not re-checked and the connection is not pinned, unlike
`webmention_ssrf.safe_get`.
- `scopes_supported` leaves out `draft`, although Micropub honours it and
the consent screen grants it when requested. Unknown scopes are also shown
and granted as requested; they just have no effect.