
adrianAR (Community Member) asked a question.
¡Hello!
We are getting a XSS flow on the next code:
let divPrincipal = document.createElement("div");
divPrincipal.setAttribute("class", "col-4 text-center stack-order");
let h2 = document.createElement("h2");
h2.setAttribute("class", "no-margins");
h2.textContent = pModelo.Total;
let small = document.createElement("small");
small.textContent = pModelo.Nombre;
divPrincipal.appendChild(h2);
divPrincipal.appendChild(small);
return divPrincipal;
The flaw is marked in both append child, but I think there must not be problem, because we are using setAttribute for class and textContent for data. How can i solve this issue?
Thank you in advance.
.png)
Hi,
You can raise this XSS finding reported on line for .textContent = $var as Potential False Positive.
Regards
Kashif