You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
themes: fix asset 404 fallback and overly broad server #40
themes: fix asset 404 fallback and server overly broad
Context
pkg/theme/manager.go:87-126GetAssetURLs double-checks AllowedAssetKeys/LockedAssetKeys, but L120-123 only checks fs.ContainedPath, not os.Stat. List() at manager.go:48 does os.Stat.
Problem
If overwrite.json maps sidebar-logo but the PNG was deleted/corrupted, GetAssetURLs returns a URL that 404s. <img src> shows broken image instead of falling back to || '/logo.png' (Sidebar.svelte:110, TitleBar.svelte:23).
pkg/theme/server.go:33-34 serves http.Dir(getThemesDir()) with CORS * — any extra file smuggled via zip (e.g. evil.html) is serveable, even though only PNGs should be.
Fix
In manager.go:120-123 add os.Stat like List() does; if missing, skip entry so frontend fallback triggers.
In server.go:33-34 restrict to whitelisted extensions or at least set Content-Type correctly; consider serving only themes/<id>/*.png + *.css allowlist.
Activity