Close the security gaps found by the application audit
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 20m8s
Validate and deploy Sokko G / deploy (push) Successful in 10s

Imported toolboxes could run scripts on the site origin through image data
URLs, so only bitmap images are now accepted at import, display and opening.
The Cards game and its fake admin login no longer turn on when NODE_ENV is
missing, and the Node server now sends a CSP and the other security headers.

The deployment script no longer runs files owned by the service account as
root, the services cannot gain privileges through sudo, and the deployment
key stays in a single workflow step with actions pinned by commit. The script
and systemd units must still be reinstalled on the server after delivery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-06 10:55:35 +01:00
parent 1adccb4e04
commit 7046515d20
20 changed files with 233 additions and 36 deletions

View file

@ -2,6 +2,7 @@
import { useEffect, useRef, useState } from "react";
import { DrawingControls } from "../features/toolboxes/modules/DrawingControls.jsx";
import { DrawingOverlay } from "../features/toolboxes/modules/DrawingOverlay.jsx";
import { isSafeImageDataUrl } from "../features/toolboxes/storage/modules/shared.js";
import { DRAWING_COLORS, DRAWING_WIDTHS } from "../utils/drawingOptions.js";
import { Icon } from "./Icon.jsx";
import { ImageGallery } from "./ImageGallery.jsx";
@ -55,6 +56,8 @@ function dataUrlToBlob(dataUrl) {
}
function openImageInNewTab(dataUrl) {
// Un blob hérite de l'origine du site : seul un format bitmap peut y être ouvert sans risque.
if (!isSafeImageDataUrl(dataUrl)) return;
try {
const url = URL.createObjectURL(dataUrlToBlob(dataUrl));
window.open(url, "_blank", "noopener,noreferrer");