Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Set comment textConent instead of innerHTML to avoid self xss (#882)

1ilit32c130cf00bc
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 1ea8cbc0..26a654cb 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -72,7 +72,7 @@ export function getCommentHeight(comment, containerWidth, showComments = true) {
span.className = "absolute text-xs px-3 line-clamp-5";
span.style.width = containerWidth - borders + "px";
- span.innerHTML = comment;
+ span.textContent = comment;
span.id = "temp-comment-measure";
document.body.appendChild(span);