Commit Graph
7 Commits
Author SHA1 Message Date
billisdead defc07648c Security: close the 9 items from the June review + one found along the way
Findings from the 2026-06-24 security review, now mandatory before this
platform leaves the LAN for a public VPS (see budget/externalization note):

- Timing attack on admin password: hmac.compare_digest instead of !=
- CORS wildcard removed, restricted to ALLOWED_ORIGINS (needed for credentials)
- hCaptcha now fails closed on network error instead of open
- HMAC signatures use the full SHA-256 digest instead of a 64-bit truncation
- Consultation-scoped submissions were missing the consent/cooldown checks
  the global submission route already had
- Admin search capped at 200 chars (ILIKE cost)
- Webhook URLs validated against SSRF (private/loopback/link-local/metadata
  IPs rejected, re-checked at trigger time too, redirects not followed)
- Flood tracker backed by Redis when REDIS_URL is set (shared across Gunicorn
  workers, survives restarts), falls back to in-memory otherwise
- Admin session moved from sessionStorage/Bearer token to an httpOnly+Secure+
  SameSite=Strict cookie; new /api/admin/logout and /api/admin/session routes

Also found while wiring ProxyFix for the cookie's Secure flag: the app never
told Flask about the Nginx reverse proxy, so request.remote_addr saw Nginx's
own IP for every request in production — silently breaking rate limiting,
flood detection, and IP blacklist (everyone would collapse onto one shared
key). Added ProxyFix (1 hop).

CSV exports now stream instead of loading everything into memory. AI prompts
delimit citizen-submitted content explicitly and instruct the model to treat
it as inert data, never instructions, to reduce prompt injection surface.

Docs (DEX.md, SECURITE_ANTI_ABUS.md, README.md, DEPLOIEMENT.md) and
dev-local.sh updated to match.
2026-09-10 09:27:50 +02:00
billisdeadandClaude Sonnet 4.6 8f904f4cf0 Merge ARCHITECTURE.md into README, expand Légifrance section on transparence
- README: add sommaire, integrate full architecture content (diagram,
  components, routes, flows, security, decisions, scalability), add
  Légifrance articles table and PISTE setup instructions
- ARCHITECTURE.md: removed (content fully merged into README)
- transparence.tsx: expand Légifrance block with full table of 11 tracked
  articles (priority, description), cache/resilience/monitoring details

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 09:54:12 +02:00
billisdeadandClaude Sonnet 4.6 c70d594292 CONTRIBUTING : procédure formalisée + README : soutien remonté
- CONTRIBUTING.md : section "Proposer une contribution" réécrite avec
  tableaux Markdown, blocs de code inline (convention branches, commits,
  template PR), règles backend/frontend détaillées
- README.md : mention financement déplacée juste après la présentation,
  avant la section Fonctionnalités ; section Soutenir le projet supprimée
  en fin de fichier

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 14:50:34 +02:00
billisdeadandClaude Sonnet 4.6 e1620aa3c8 README complet + CONTRIBUTING.md
- README réécrit à partir du code : fonctionnalités réelles, stack,
  installation (dev local, build, prod), variables d'environnement
  documentées avec leur effet, références aux docs existants
- CONTRIBUTING.md créé : signalement de bug, procédure de PR,
  mention que GitHub est un miroir public du dépôt Gitea source

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 14:43:19 +02:00
billisdeadandClaude Sonnet 4.6 bc6bd3f9d7 Dé-Replit-isation complète du projet
Supprimés :
- replit.md — doc Replit obsolète
- docs/GITEA_TUTO.md — tuto push Replit → Gitea (obsolète)
- artifacts/api-server/ — serveur TypeScript mort, remplacé par Flask
- artifacts/voix-du-peuple/vite.config.selfhost.ts — fusionné dans vite.config.ts

Nettoyés :
- ai_agent.py — fallback Replit AI supprimé (Mistral + OpenAI-compatible suffisent)
- vite.config.ts — plugins @replit/* retirés, PORT optionnel (défaut 5173)
- package.json + pnpm-workspace.yaml — @replit/* retirés du catalog et des deps
- badge.tsx + button.tsx — commentaires // @replit supprimés
- README.md, DEPLOIEMENT.md, DAT.md, DEX.md, WIKI.md — références Replit remplacées

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 22:41:06 +02:00
billisdeadandClaude Sonnet 4.6 45edc1fa77 Licence EUPL-1.2 + hardening anti-abus
P1 — Licence :
- Ajout du fichier LICENSE (EUPL-1.2 complet)
- README mis à jour : section licence, table docs, vars d'environnement
- En-têtes EUPL ajoutés dans les fichiers sources principaux (Flask, React)

P2 — Hardening anti-abus :
- Rate limiting Redis-ready (REDIS_URL) avec clé fingerprint + IP
- Honeypot anti-bot : champ caché côté client + vérification serveur
- Fingerprinting non-PII via FingerprintJS (hash SHA-256, colonne ideas.fingerprint_hash)
- Cooldown session : cookie httpOnly signé HMAC-SHA256 (SECRET_KEY requis)
- Détection de flood : alerte WARNING si > FLOOD_THRESHOLD soumissions / 5 min
- hCaptcha stub : intégré, activable via HCAPTCHA_SECRET_KEY + VITE_HCAPTCHA_SITE_KEY
- Nouvelles dépendances : redis (backend), @fingerprintjs/fingerprintjs + @hcaptcha/react-hcaptcha (frontend)
- docs/SECURITE_ANTI_ABUS.md : documentation complète des seuils et de la configuration

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-23 18:05:46 +02:00
pironantoine a9d31ea735 Add a detailed README file with project explanation and screenshots
Add README.md with project overview, features, tech stack, and screenshots. Also updates agent metadata.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 923ae0e3-a363-4db8-b04a-e8baca2a1330
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 93d7a692-969b-4714-971e-b44e7d4b3a92
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8af7d2ec-2cc3-4ece-8af3-9f071488d072/923ae0e3-a363-4db8-b04a-e8baca2a1330/nghZcOj
Replit-Helium-Checkpoint-Created: true
2026-04-04 14:32:55 +00:00