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: sanitize CSS in GetCSS for edited or manually installed themes #45
GetCSS returns the theme stylesheet as raw file bytes. Sanitization only runs during installation, so editing an installed theme.css or copying a theme folder into the themes directory bypasses the CSS sanitizer entirely.
Current behavior
pkg/theme/installer.go:111 calls SanitizeCSS when installing a .theme package.
pkg/theme/manager.go:60-80 (GetCSS) reads the file and returns string(data) without sanitizing.
The frontend injects that result into <style id="aether-theme-overwrite">.
This means the protections documented in docs/THEMES.md (blocked url(), overlays, window controls, etc.) can be bypassed by editing the installed file or placing a theme folder directly in the data directory.
Proposed fix
Run SanitizeCSS in GetCSS before returning the stylesheet, or re-sanitize when a theme is activated.
scopeSelector already avoids double-prefixing selectors that start with #aether-root, so sanitizing an already-installed stylesheet should be idempotent; add a regression test for that.
Alternatively, document that manual edits are unsupported and enforce a read-only installed file, but sanitizing on read is the safer default.
Activity