From 6b878caff3ad17870bf830fb6c436389646765f6 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Sun, 27 Sep 2026 10:35:57 -0400 Subject: [PATCH] securite: #87 T5c script-src sans unsafe-inline (nonces T5b) --- CHANGELOG.md | 15 ++++++++++++++- README.fr.md | 6 +++--- README.md | 6 +++--- VERSION | 2 +- backend/main.py | 6 +++++- desktop/Cargo.lock | 2 +- desktop/Cargo.toml | 2 +- desktop/tauri.conf.json | 2 +- docs/ROADMAP.md | 2 +- package.json | 2 +- 10 files changed, 31 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a8ef93..424b3c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Format basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/), et [Semantic Versioning](https://semver.org/spec/v2.0.0.html). > **En cours de développement** : les changements à venir sont listés dans la section -> [Unreleased](#unreleased). La dernière version livrée est **2.28.12**. +> [Unreleased](#unreleased). La dernière version livrée est **2.28.13**. --- @@ -14,6 +14,19 @@ et [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --- +## [2.28.13] — 2026-09-27 + +### Modifié + +- **#87 (T5c) — `script-src` sans `'unsafe-inline'`.** + Seuls les scripts avec nonce frais (`backend/csp.py`, T5b) ou servis par + `'self'`/CDN listés s'exécutent ; `style-src` garde `'unsafe-inline'` + (chantier séparé). Vérifié : `test_csp_nonce.py` 5/5, 0 handler inline + restant dans les pages HTML (propriétés `onXxx = fn` en JS non concernées + par la CSP). + +--- + ## [2.28.12] — 2026-09-27 ### Corrigé diff --git a/README.fr.md b/README.fr.md index cefa788..ce46912 100644 --- a/README.fr.md +++ b/README.fr.md @@ -4,7 +4,7 @@ **Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive. -[![Version](https://img.shields.io/badge/Version-2.28.12-blue.svg)]() +[![Version](https://img.shields.io/badge/Version-2.28.13-blue.svg)]() [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Docker](https://img.shields.io/badge/Docker-Ready-blue.svg)](https://www.docker.com/) [![Python](https://img.shields.io/badge/Python-3.11+-green.svg)](https://www.python.org/) @@ -976,8 +976,8 @@ Ce projet est sous licence **MIT** — voir le fichier [LICENSE](LICENSE) pour l ## 📝 Changelog -Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.28.12). +Consultez le [CHANGELOG.md](./CHANGELOG.md) pour l'historique complet de toutes les versions (v1.0.0 → v2.28.13). --- -*Projet : ObsiGate | Version : 2.28.12 | Dernière mise à jour : Septembre 2026* +*Projet : ObsiGate | Version : 2.28.13 | Dernière mise à jour : Septembre 2026* diff --git a/README.md b/README.md index c5b2485..575d524 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Ultra-light web gateway for your Obsidian vaults** — Access, browse, and search all your Obsidian notes from any device via a modern, responsive web interface. -[![Version](https://img.shields.io/badge/Version-2.28.12-blue.svg)]() +[![Version](https://img.shields.io/badge/Version-2.28.13-blue.svg)]() [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Docker](https://img.shields.io/badge/Docker-Ready-blue.svg)](https://www.docker.com/) [![Python](https://img.shields.io/badge/Python-3.11+-green.svg)](https://www.python.org/) @@ -1151,8 +1151,8 @@ This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) ## 📝 Changelog -See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.28.12). +See [CHANGELOG.md](./CHANGELOG.md) for the complete version history (v1.0.0 → v2.28.13). --- -*Project: ObsiGate | Version: 2.28.12 | Last updated: September 2026* +*Project: ObsiGate | Version: 2.28.13 | Last updated: September 2026* diff --git a/VERSION b/VERSION index 12f46bd..c9f834e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.28.12 +2.28.13 diff --git a/backend/main.py b/backend/main.py index 9dcd382..0bfb9cf 100644 --- a/backend/main.py +++ b/backend/main.py @@ -182,9 +182,13 @@ class SecurityHeadersMiddleware(BaseHTTPMiddleware): # A route may set a stricter per-response policy (e.g. ``sandbox`` for # standalone SVG, #108-B3); keep it instead of overwriting it. if "Content-Security-Policy" not in response.headers: + # #87 T5c : `script-src` sans 'unsafe-inline' — seuls les scripts + # avec un nonce frais (`backend.csp`) ou servis par 'self'/CDN + # listés s'exécutent. `style-src` garde 'unsafe-inline' (attributs + # `style=` et `el.style` omniprésents — chantier séparé). response.headers["Content-Security-Policy"] = ( "default-src 'self'; " - f"script-src 'self' 'unsafe-inline' 'nonce-{nonce}' blob: https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://cdn.jsdelivr.net https://static.cloudflareinsights.com; " + f"script-src 'self' 'nonce-{nonce}' blob: https://cdnjs.cloudflare.com https://unpkg.com https://esm.sh https://cdn.jsdelivr.net https://static.cloudflareinsights.com; " "style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://fonts.googleapis.com https://cdn.jsdelivr.net https://esm.sh; " "img-src 'self' data: blob:; " "connect-src 'self' blob: https://esm.sh https://unpkg.com https://cdnjs.cloudflare.com https://fonts.googleapis.com https://fonts.gstatic.com https://cdn.jsdelivr.net; " diff --git a/desktop/Cargo.lock b/desktop/Cargo.lock index 2bc08af..b45ff2a 100644 --- a/desktop/Cargo.lock +++ b/desktop/Cargo.lock @@ -2626,7 +2626,7 @@ dependencies = [ [[package]] name = "obsigate-desktop" -version = "2.28.12" +version = "2.28.13" dependencies = [ "chrono", "env_logger", diff --git a/desktop/Cargo.toml b/desktop/Cargo.toml index c60a6df..06172bd 100644 --- a/desktop/Cargo.toml +++ b/desktop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "obsigate-desktop" -version = "2.28.12" +version = "2.28.13" description = "ObsiGate Desktop — Porte d'entrée native pour vos vaults Obsidian" authors = ["Bruno Charest"] edition = "2021" diff --git a/desktop/tauri.conf.json b/desktop/tauri.conf.json index 1563b9b..bf221af 100644 --- a/desktop/tauri.conf.json +++ b/desktop/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/nicedoc/obsigate/main/desktop/tauri.conf.schema.json", "productName": "ObsiGate", - "version": "2.28.12", + "version": "2.28.13", "identifier": "com.obsigate.desktop", "build": { "frontendDist": "../frontend", diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index d273b27..3910eeb 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -1,6 +1,6 @@ # ObsiGate — Roadmap -> **Version :** 2.28.12 | **Dernière mise à jour :** 2026-09-27 +> **Version :** 2.28.13 | **Dernière mise à jour :** 2026-09-27 > **Ce fichier ne contient que le travail à venir** (🔵 En cours + ⚪ Backlog) et un index compact > vers les fonctionnalités livrées. > - **Méthode de livraison à appliquer pour toute tâche : [DELIVERY_WORKFLOW.md](./DELIVERY_WORKFLOW.md)** diff --git a/package.json b/package.json index 681e9d0..856615a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsigate", - "version": "2.28.12", + "version": "2.28.13", "description": "**Porte d'entrée web ultra-léger pour vos vaults Obsidian** — Accédez, naviguez et recherchez dans toutes vos notes Obsidian depuis n'importe quel appareil via une interface web moderne et responsive.", "main": "patch.js", "directories": {