Use textContent instead of innerHTML
Previously, setting `innerHTML` was used to display the statuses. These could include content communicated from the remote VNC server, allowing the remove VNC server to inject HTML into the noVNC page. This commit switches all uses of `innerHTML` to use `textContent`, which is not vulnerable to the HTML injection.
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@
|
||||
function message(str) {
|
||||
console.log(str);
|
||||
cell = document.getElementById('messages');
|
||||
cell.innerHTML += msg_cnt + ": " + str + newline;
|
||||
cell.textContent += msg_cnt + ": " + str + newline;
|
||||
cell.scrollTop = cell.scrollHeight;
|
||||
msg_cnt++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user