Close the security gaps found by the application audit
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:
parent
1adccb4e04
commit
7046515d20
20 changed files with 233 additions and 36 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { createToolboxImportPayload } from "./helpers/toolboxImport.js";
|
||||
import { solidPngDataUrl } from "./helpers/solidPng.js";
|
||||
import { readStoredModuleData } from "./helpers/storage.js";
|
||||
|
||||
async function setup(page, type, data) {
|
||||
|
|
@ -150,12 +151,11 @@ test("a simple checklist can hide and restore checked rows", async ({ page }) =>
|
|||
});
|
||||
|
||||
test("images open a gallery and navigate the current collection without looping", async ({ page }) => {
|
||||
const makeImage = (color) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360"><rect width="640" height="360" fill="${color}"/></svg>`)}`;
|
||||
const tool = await setup(page, "images", {
|
||||
images: [
|
||||
{ id: "one", label: "First", dataUrl: makeImage("#8b5cf6") },
|
||||
{ id: "two", label: "Second", dataUrl: makeImage("#22d3ee") },
|
||||
{ id: "three", dataUrl: makeImage("#f6c453") }
|
||||
{ id: "one", label: "First", dataUrl: solidPngDataUrl([139, 92, 246]) },
|
||||
{ id: "two", label: "Second", dataUrl: solidPngDataUrl([34, 211, 238]) },
|
||||
{ id: "three", dataUrl: solidPngDataUrl([246, 196, 83]) }
|
||||
]
|
||||
});
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ test("images open a gallery and navigate the current collection without looping"
|
|||
|
||||
test("image gallery keeps proportional cards and compact centered rows at maximum zoom", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1550, height: 900 });
|
||||
const makeImage = (index) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360"><rect width="640" height="360" fill="hsl(${index * 45} 70% 45%)"/></svg>`)}`;
|
||||
const makeImage = (index) => solidPngDataUrl([40 + index * 30, 90, 220 - index * 25]);
|
||||
const tool = await setup(page, "images", {
|
||||
images: Array.from({ length: 7 }, (_, index) => ({ id: `image-${index}`, label: `Image ${index + 1}`, dataUrl: makeImage(index) }))
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue