Maintenance Notes Are Interpreted as HTML in the Dashboard
Level 2 · node · Security · Missing HTML text escaping for operator-authored notes
Scenario
A fictional factory maintenance dashboard renders technician notes into server-generated HTML. Notes may include angle brackets around part names or ampersands in equipment labels. The current renderer inserts raw note strings into HTML, causing portions of the text to be interpreted as markup or disappear. Trace the data flow from the note repository through formatting to the dashboard view.
Requirements
Render the note safely as HTML element text. Encode angle brackets and ampersands as HTML entities. Preserve ordinary English and Korean text unchanged, and keep the existing article element and note CSS class structure.
Acceptance criteria
- A plain English note appears inside the existing HTML structure.
- Angle brackets in a note display as text rather than markup.
- Ampersands in a note are safely encoded as HTML entities.
- Korean characters and the existing output structure are preserved.