- frontend/app.js: the document pager put esc(routeHash(route)) inside
onclick="location.hash='...'". esc() is HTML escaping and the browser decodes
' back to ' before the handler runs; the route comes from the URL hash and
encodeURIComponent keeps ' ( ) - ., so a crafted #/doc/eu/<celex>/<segment> link
ran script on a click of the pager arrows. The pager is now plain links, and
routeApi accepts exactly the segments each kind has (act 4, eu 2, judgment 3).
- GET /users takes require_moderator. On the platform list_users reads the shared
app_user, so any Insider user could list every account. The console fetches the
roster only on the Administration screen.
- services/legal.py: html_to_text (pure-Python HTMLParser, live EU texts up to
MAX_TEXT_BYTES) and _text_answer (chunk + outline of a whole text) run in
asyncio.to_thread instead of on the event loop.
- docker-compose.managed-db.yml: the OCR worker gets the same credential blanks as
the backend (no migrator URL, no superuser password); deploy_check checks it.
Tests: test_console (routeApi extra segments, no route in an inline handler),
test_integration (GET /users is 403 for a user), test_event_loop (AST guard).
Not run here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>