Problem
ui/templates.rs (1859 lines) and ui/components.rs (947 lines) generate HTML via format!() string concatenation with manual html_escape() calls. No compile-time verification of HTML structure or auto-escaping.
Risk
Missing a single html_escape() on user-controlled data (artifact names, versions) creates an XSS vector. Manual escaping is error-prone as the UI grows.
Options
| Engine |
Approach |
Binary size |
Compile-time safe |
| askama |
Jinja2-like templates, compile-time |
~0 runtime |
Yes |
| maud |
Rust macros as HTML |
~0 runtime |
Yes |
| tera |
Runtime templates |
+200KB |
No |
| Current |
format!() strings |
0 |
No |
Notes
This is a significant refactoring (2800+ lines). The current approach works and has no known XSS (all escape points are covered by tests). This is about long-term maintainability, not an urgent fix.
Evaluate whether the migration cost justifies the safety benefit given that UI is a secondary feature of NORA.
Problem
ui/templates.rs(1859 lines) andui/components.rs(947 lines) generate HTML viaformat!()string concatenation with manualhtml_escape()calls. No compile-time verification of HTML structure or auto-escaping.Risk
Missing a single
html_escape()on user-controlled data (artifact names, versions) creates an XSS vector. Manual escaping is error-prone as the UI grows.Options
Notes
This is a significant refactoring (2800+ lines). The current approach works and has no known XSS (all escape points are covered by tests). This is about long-term maintainability, not an urgent fix.
Evaluate whether the migration cost justifies the safety benefit given that UI is a secondary feature of NORA.