v0.8.20-alpha — Security: open-redirect fix in is_safe_url
Security patch release on top of v0.8.19-alpha.
Fixed
-
Open redirect via the
nextparameter (CWE-601). Theis_safe_url()helper validatedurljoin(request.host_url, target)whileredirect()was called with the rawtarget. A scheme-relative input such as////evil.comresolved to a same-host URL during validation but was emitted verbatim in theLocationheader, where browsers interpret it as a network-path-relative redirect to an attacker-controlled host.is_safe_url()now validates the raw target against a local-path allowlist: leading/required, scheme-relative URLs (//,/\), backslashes, control characters, and any value that produces a scheme or netloc when parsed are rejected. The duplicate copy insrc/api/auth.pywas removed; password login and the SSOnext/ callback flow share one validator. Regression tests intests/test_open_redirect.py.Reported by RacerZ and Fushuling. Tracked as a GitHub Security Advisory; CVE pending.
Tests
- New
tests/test_open_redirect.py— 7 cases covering scheme-relative URLs, absolute URLs, backslash variants,javascript:/data:schemes, CRLF/control-character injection, missing leading slash, and accepted local paths. tests/test_transcription_model_override.py— pre-existing env-bleed flake fixed; the helper now isolates the call from any admin-savedtranscription_default_modelSystemSetting that may exist in a dev DB. 275 backend tests passing.
No new features, no breaking changes
Upgrade is the usual docker compose pull && docker compose up -d. Users on v0.8.19-alpha or earlier should upgrade promptly; the workaround for those who cannot is to front Speakr with a reverse proxy that strips next query parameters on the /login route, or block requests where next starts with //, \\, or contains a scheme.