TranscrIA 0.3.9.1 — Security hardening & first-boot fix / Durcissement sécurité & correctif de premier démarrage
Security hardening & first-boot fix
Patch release. All hardening is opt-in (default unchanged) — no database migration, no new dependency.
Added — all opt-in, from Administration → Configuration → "HTTP(S) hardening" (or security.*):
- HTTP(S):
behind_tls_proxy(the app learns it is served over HTTPS viaX-Forwarded-Proto— the client IP is never read fromX-Forwarded-For, so anti-brute-force stays sound),session_cookie_secure,hsts_enabled/hsts_max_age_days(HSTS emitted only on a real HTTPS response). - CSRF:
csrf_origin_check(rejects cross-origin cookie POSTs, on top of SameSite) andcsrf_tokens(synchronizer token on every state-changing request, auto-injected into forms and UI calls; the Bearer-token API stays exempt). - Content-Security-Policy (
security.csp:off|report-only|enforce): strictscript-src('self'+ per-request nonce, no'unsafe-inline'), made possible by migrating every inline event handler to a delegated dispatcher; locks down frames, objects,baseand forms. Browser-validated (Playwright):enforce→ zero CSP violations, interactions work. Deployreport-onlyfirst, thenenforce. doctor: an "HTTP(S) transport" check (warns if a federated auth backend runs without a secure cookie or TLS proxy).
Fixed:
- Concurrent first boot: on the very first boot against an empty database, multiple gunicorn workers could create the admin in parallel → unique-constraint violation → the service refused to start (a restart then worked).
ensure_adminis now idempotent.
See docs/SECURITY_MODEL.md (§§ 2, 3, 7) and docs/UPGRADE.md § "Durcissement de sécurité (0.3.9.1)".
Durcissement de sécurité & correctif de premier démarrage
Version corrective. Tous les durcissements sont opt-in (défaut inchangé) — aucune migration de base, aucune nouvelle dépendance.
Ajouté — tout opt-in, depuis Administration → Configuration → « Durcissement HTTP(S) » (ou clés security.*) :
- HTTP(S) :
behind_tls_proxy(l'app reconnaît le HTTPS viaX-Forwarded-Proto— l'IP cliente n'est jamais lue depuisX-Forwarded-For, l'anti-bourrinage reste sain),session_cookie_secure,hsts_enabled/hsts_max_age_days(HSTS uniquement sur une réponse HTTPS réelle). - CSRF :
csrf_origin_check(refuse les POST cookie d'origine croisée, en plus de SameSite) etcsrf_tokens(jeton synchroniseur à chaque requête mutante, injecté automatiquement dans les formulaires et les appels de l'interface ; l'API par jeton Bearer reste exemptée). - Content-Security-Policy (
security.csp:off|report-only|enforce) :script-srcSTRICT ('self'+ nonce par requête, sans'unsafe-inline'), rendu possible par la migration de tous les gestionnaires d'événements inline vers une délégation. Validé au navigateur (Playwright) :enforce→ zéro violation CSP, interactions fonctionnelles. Déployer d'abord enreport-only, puisenforce. doctor: contrôle « Transport HTTP(S) » (avertit si un backend d'auth fédéré tourne sans cookie sécurisé ni proxy TLS).
Corrigé :
- Premier démarrage concurrent : au tout premier boot sur une base vierge, plusieurs workers gunicorn pouvaient créer l'admin en parallèle → violation d'unicité → le service refusait de démarrer.
ensure_adminest désormais idempotent.
Guides : docs/SECURITY_MODEL.md (§§ 2, 3, 7) et docs/UPGRADE.md § « Durcissement de sécurité (0.3.9.1) ».
Docker : ghcr.io/martossien/transcria-allinone:v0.3.9.1 (slim) et :v0.3.9.1-bundled (tout embarqué) — publiques.