screentinker/frontend
ScreenTinker 8ec33721f7 Security: sanitize notes, add CSP headers, tighten CORS
LOW 1 (notes XSS): device.notes textarea content now goes through
esc(). Notes weren't in the sanitizeBody allow-list at write time, so
HTML in the field would render unescaped on the device-detail page.

LOW 2 (CSP): enabled Helmet contentSecurityPolicy with default-src
'self', script-src 'self', style-src 'self' 'unsafe-inline', plus the
data:/blob:/https: image and media sources the player needs. Strict
script-src blocks <script> injection; script-src-attr 'unsafe-inline'
keeps existing inline onclick handlers working until they can be
refactored to addEventListener (TODO comment in code).

  CSP applies to /app and most other paths. Skipped on the public
  widget and kiosk render endpoints, the landing page, and /player —
  those legitimately need inline scripts/styles. upgrade-insecure-
  requests is explicitly disabled so HTTP-only self-hosted LAN
  deployments aren't broken.

  Refactored two inline onclick handlers in index.html to data-close-
  modal attributes wired by a delegated listener in app.js. Was the
  only blocker for /app under strict script-src.

LOW 3 (CORS): Express CORS now only allows screentinker.com (and
subdomains) + localhost in production. SELF_HOSTED=true bypasses the
allowlist (operator owns their deployment). Development mode stays
open. Same policy applied to the Socket.IO CORS config which was
previously origin: '*'. Native clients (Android, server-to-server,
kiosk iframes) send no Origin and pass through unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:37:31 -05:00
..
assets Landing: replace iframe mock with dashboard screenshot 2026-04-21 19:47:13 -05:00
css QA fixes: toast aria-live + scope playlist flex-wrap to mobile 2026-04-21 16:00:41 -05:00
js Security: sanitize notes, add CSP headers, tighten CORS 2026-04-28 14:37:31 -05:00
legal Update ToS: add CSAM policy, fix MIT license conflict, add governing law 2026-04-24 11:26:32 -05:00
index.html Security: sanitize notes, add CSP headers, tighten CORS 2026-04-28 14:37:31 -05:00
landing.html Add Discord link and refresh feature copy 2026-04-23 17:47:00 -05:00
manifest.json Initial open source release 2026-04-08 12:14:53 -05:00
robots.txt Initial open source release 2026-04-08 12:14:53 -05:00
sitemap.xml SEO: open-source positioning, GitHub links, OG image, semantic <main> 2026-04-21 19:56:22 -05:00
sw-admin.js Initial open source release 2026-04-08 12:14:53 -05:00