From 778da5d10feb642be44afb1d3bd2554b141c42ad Mon Sep 17 00:00:00 2001 From: Adam Buckingham Date: Tue, 23 Apr 2024 13:02:20 -0400 Subject: [PATCH] Mitigating an XSS shown by snyk --- src/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index 37ba684a..71fe9ce1 100644 --- a/src/index.html +++ b/src/index.html @@ -81,10 +81,12 @@ // TO-DO: build this into an angular hook rather than this hack function errorUpdater() { - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.has("error")) { - const el = document.getElementById("login-error"); - el.innerHTML = '

' + urlParams.get('error') + '

'; + const urlParams = new URLSearchParams(window.location.search); + if (urlParams.has("error")) { + const el = document.getElementById("login-error"); + const p = document.createElement('p'); + p.textContent = urlParams.get('error'); + el.appendChild(p); } } setTimeout( errorUpdater, 1000);