Skip to content

fix(security): static theme FOUC boot script (CodeQL #12) - #51

Merged
ArianAr merged 1 commit into
mainfrom
fix/codeql-theme-boot-script
Jul 15, 2026
Merged

fix(security): static theme FOUC boot script (CodeQL #12)#51
ArianAr merged 1 commit into
mainfrom
fix/codeql-theme-boot-script

Conversation

@ArianAr

@ArianAr ArianAr commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes CodeQL alert #12 (js/bad-code-sanitization on server/lib/theme.ts).

THEME_BOOT_SCRIPT was built with template interpolation of JSON.stringify(THEME_STORAGE_KEY). That pattern is treated as unsafe code construction even though the value is a trusted constant.

Change: fully static IIFE string with the "papercut-theme" key literal. Unit test asserts the boot script embeds THEME_STORAGE_KEY so they cannot drift.

Test plan

CodeQL js/bad-code-sanitization flagged constructing THEME_BOOT_SCRIPT
via JSON.stringify interpolation. Embed the storage key as a literal
instead; test keeps the key and boot script in sync.

Addresses code scanning alert #12.
@ArianAr ArianAr added security Security-related issue or fix (non-advisory tracking) area:ui Log canvas and web UI labels Jul 15, 2026
@ArianAr
ArianAr merged commit 8594ceb into main Jul 15, 2026
9 of 10 checks passed
@ArianAr
ArianAr deleted the fix/codeql-theme-boot-script branch July 15, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Log canvas and web UI security Security-related issue or fix (non-advisory tracking)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant