screentinker/server/routes
ScreenTinker c105a5941e Security: fix IDORs, XSS, rate limits, SSRF validation
HIGH 1 (teams IDOR): POST/DELETE /api/teams/:id/devices now require the
caller to own the device before assigning or detaching it. Without this
check, any team member could pull any device into their team via UUID
guess and gain remote-control access.

HIGH 2 (schedules IDOR): PUT /api/schedules/:id now re-verifies
ownership of every changed target field — device_id, group_id,
content_id, widget_id, layout_id, playlist_id. Previously only the
schedule owner was checked, letting users fire arbitrary content on
victim devices via update.

HIGH 3 (filename XSS): file.originalname captured by multer bypassed
sanitizeBody. New safeFilename() wraps every INSERT path (multipart
upload, remote URL, YouTube). Frontend sinks now go through esc() in
content-library.js, device-detail.js, video-wall.js. Web player gets
an inline escHtml helper for its info overlay where filenames, device
name, and serverUrl land in innerHTML.

HIGH 4 (kiosk public XSS): config.idleTimeout is now coerced via the
existing safeNumber() helper at both interpolation sites. A crafted
value with a newline can no longer escape the JS line comment to
inject arbitrary code into the public render endpoint.

HIGH 5 (folder DoS): POST /api/folders enforces a per-user cap of 100
folders (429 on overflow). Superadmin exempt.

MED 1 (SSRF): ImageLoader.decodeUrl rejects any URL scheme other than
http(s) so a malicious remote_url can't read local files via file://.
On the server, validateRemoteUrl() is extracted and now also runs on
PUT /api/content/:id remote_url updates — previously the SSRF check
only fired on POST.

MED 2 (fingerprint takeover): the WS device:register fingerprint
reclaim path now rejects takeover while the target device is online or
within 24h of its last heartbeat. A leaked fingerprint can no longer
hijack an active display.

MED 3 (npm audit): bumped uuid 9.x -> 14.0.0 (v3/v5/v6 buffer bounds
CVE; we only use v4 so not exploitable, but clears the audit). path-
to-regexp resolved to 0.1.13 via npm audit fix. 0 vulns remaining.

MED 4 (folder admin consistency): ownedFolder() and the content.js
folder_id move check now both treat only superadmin as privileged,
matching GET /api/folders. Previously a plain "admin" could rename
or delete folders they couldn't see, and could move content into
folders they couldn't list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:37:18 -05:00
..
activity.js Initial open source release 2026-04-08 12:14:53 -05:00
assignments.js Fix 8 security findings from Phase 3 audit + device-detail banner refresh 2026-04-13 21:36:16 -05:00
auth.js Add DISABLE_REGISTRATION env var to block public sign-ups 2026-04-22 19:35:32 -05:00
content.js Security: fix IDORs, XSS, rate limits, SSRF validation 2026-04-28 14:37:18 -05:00
device-groups.js Add group-level scheduling, group playlist assignment, and persist audio unlock 2026-04-15 20:22:42 -05:00
devices.js Phase 3: playlist publish/draft state with auto-publish from device detail 2026-04-13 20:52:29 -05:00
folders.js Security: fix IDORs, XSS, rate limits, SSRF validation 2026-04-28 14:37:18 -05:00
kiosk.js Security: fix IDORs, XSS, rate limits, SSRF validation 2026-04-28 14:37:18 -05:00
layouts.js Security audit remediation: auth, IDOR, XSS, hardening 2026-04-11 22:48:07 -05:00
playlists.js Fix 8 security findings from Phase 3 audit + device-detail banner refresh 2026-04-13 21:36:16 -05:00
provisioning.js Initial open source release 2026-04-08 12:14:53 -05:00
reports.js Initial open source release 2026-04-08 12:14:53 -05:00
schedules.js Security: fix IDORs, XSS, rate limits, SSRF validation 2026-04-28 14:37:18 -05:00
status.js Add group-level scheduling, group playlist assignment, and persist audio unlock 2026-04-15 20:22:42 -05:00
stripe.js Security audit remediation: auth, IDOR, XSS, hardening 2026-04-11 22:48:07 -05:00
subscription.js Initial open source release 2026-04-08 12:14:53 -05:00
teams.js Security: fix IDORs, XSS, rate limits, SSRF validation 2026-04-28 14:37:18 -05:00
video-walls.js Security audit remediation: auth, IDOR, XSS, hardening 2026-04-11 22:48:07 -05:00
white-label.js Initial open source release 2026-04-08 12:14:53 -05:00
widgets.js Add directory board widget renderer with scrolling, anti-burn-in, dark/light themes 2026-04-21 22:28:37 -05:00