Skip to content

Commit b4af886

Browse files
yubiuserDL6ER
andcommitted
HTML escape adlist URL before printing it in gravity stream
Co-authored-by: DL6ER <[email protected]> Signed-off-by: yubiuser <[email protected]>
1 parent 6e60bc9 commit b4af886

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/js/gravity.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* This file is copyright under the latest version of the EUPL.
66
* Please see LICENSE file for your rights under this license. */
77

8-
/* global apiFailure:false */
8+
/* global apiFailure:false, utils:false */
99

1010
"use strict";
1111

@@ -91,7 +91,8 @@ function parseLines(outputElement, text) {
9191
for (let line of lines) {
9292
if (line[0] === "\r") {
9393
// This line starts with the "OVER" sequence. Replace them with "\n" before print
94-
line = line.replaceAll("\r", "\n").replaceAll("\r", "\n");
94+
// we also escape HTML to prevent XSS attacks
95+
line = utils.escapeHtml(line.replaceAll("\r", "\n").replaceAll("\r", "\n"));
9596

9697
// Last line from the textarea will be overwritten, so we remove it
9798
const lastLineIndex = outputElement.innerHTML.lastIndexOf("\n");

0 commit comments

Comments
 (0)