Add a Content-Security-Policy meta tag to the hub and game pages
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 62/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- html, typescript, vite
Direzione di ricerca
Read index.html and games/_template/index.html, then compare the game pages to see how they are built and whether a shared build step can add the policy. Run npm install and npm run dev, then check the hub and games online and offline for CSP violations while testing Phaser, Google Fonts, and the service worker. Done when every page loads without CSP violations; run npm run typecheck and npm run build.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
No page sets a Content-Security-Policy. GitHub Pages cannot send custom response headers, so a <meta http-equiv> tag is the only way to add one. This is defence in depth for a static site.
Where
index.html:3-14games/_template/index.html:1-13and eachgames/*/index.html
Suggested fix
Add a policy along these lines and test Phaser, Google Fonts and the service worker against it:
default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
font-src https://fonts.gstatic.com; img-src 'self' data: blob:; worker-src 'self';
connect-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; base-uri 'none'; object-src 'none'
Phaser may need blob: or data: in further directives. Injecting the tag from one place at build time avoids editing eleven HTML files.
Acceptance criteria
- Hub and all games load with no CSP violations in the console, online and offline
Getting started
- Relevant files:
index.html,games/_template/index.html,games/*/index.html - Run locally:
npm install, thennpm run dev - Checks:
npm run typecheckandnpm run build(there is no test suite yet) - Related docs:
README.md
Filed by repo-audit/full-audit at b001f5d. Severity: low. Effort: M. audit-key: security|index.html|Content-Security-Policy
- Lingua principale
- TypeScript
- Stelle
- 3
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TMHSDigital/GH-Arcade
-
enhancement good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
TMHSDigital/GH-Arcade#50 ·
-
enhancement good first issue severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
TMHSDigital/GH-Arcade#47 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/GH-Arcade#34 ·
-
documentation good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/GH-Arcade#33 ·
-
dependencies good first issue severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
TMHSDigital/GH-Arcade#27 ·
Tutte le issue di TMHSDigital/GH-Arcade
Issue simili
-
automated-triage type/bug type/ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
📦 expo-router Android contributor: external needs review sdk-58 severity: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
expo/expo#53436 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Translate the READMEApertadocumentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
asasemahmed/openboard#68 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Document PowerShell shell semantics and read-only Bash deduplication in Built-in Tools referenceApertadocumentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100