mirror of
https://github.com/gchq/CyberChef
synced 2025-12-14 23:33:25 +00:00
fix(RecipeWaiter): sanitize user input in addOperation to prevent XSS
This commit is contained in:
@@ -8,6 +8,7 @@ import HTMLOperation from "../HTMLOperation.mjs";
|
||||
import Sortable from "sortablejs";
|
||||
import Utils from "../../core/Utils.mjs";
|
||||
import {escapeControlChars} from "../utils/editorUtils.mjs";
|
||||
import DOMPurify from 'dompurify';
|
||||
|
||||
|
||||
/**
|
||||
@@ -435,7 +436,9 @@ class RecipeWaiter {
|
||||
const item = document.createElement("li");
|
||||
|
||||
item.classList.add("operation");
|
||||
item.innerHTML = name;
|
||||
const clean = DOMPurify.sanitize(name);
|
||||
item.innerHTML = clean;
|
||||
|
||||
this.buildRecipeOperation(item);
|
||||
document.getElementById("rec-list").appendChild(item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user