From f5c5cfc5cef55a0c55a875fd7638fd891cfec520 Mon Sep 17 00:00:00 2001 From: Dev Prashant Date: Thu, 30 Jul 2026 00:18:26 +0530 Subject: [PATCH] Fix DOM XSS in a11y-snapshot-scanner fixSuggestion rendering --- data/themes.json | 12 ++++++------ tools/a11y-snapshot-scanner.html | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/data/themes.json b/data/themes.json index e013c1d..dfd7149 100644 --- a/data/themes.json +++ b/data/themes.json @@ -6,6 +6,12 @@ "description": "Clean single-column layout. ATS-compliant, zero JavaScript, A4 print-ready. System fonts only.", "author": "Praveen Kumar Purushothaman" }, + { + "id": "cosmic", + "name": "Cosmic", + "description": "Two-column layout, Immersive starry backdrop, Glowing elements, Monospace typography.", + "author": "Riya Halbhavi" + }, { "id": "cyber", "name": "Cyber", @@ -24,12 +30,6 @@ "description": "Two-column layout, Black, grey, and white color scheme, Minimalist and clean.", "author": "Riya Halbhavi" }, - { - "id": "cosmic", - "name": "Cosmic", - "description": "Two-column layout, Immersive starry backdrop, Glowing elements, Monospace typography.", - "author": "Riya Halbhavi" - }, { "id": "resume-opus-5", "name": "Opus 5", diff --git a/tools/a11y-snapshot-scanner.html b/tools/a11y-snapshot-scanner.html index f80317e..16c1990 100644 --- a/tools/a11y-snapshot-scanner.html +++ b/tools/a11y-snapshot-scanner.html @@ -1179,8 +1179,12 @@
Hardware Interface Pins
descName = btn.value || btn.getAttribute("aria-label") || btn.getAttribute("title"); } + function escapeHtml(str) { + return String(str).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + } + if (!descName || descName.trim() === "") { - addFinding("error", "Unlabeled Button Action", btn, "The button element has no textual description. Screen-readers will announce the element simply as 'button', blocking interaction guidance.", ``); + addFinding("error", "Unlabeled Button Action", btn, "The button element has no textual description. Screen-readers will announce the element simply as 'button', blocking interaction guidance.", ``); } });