mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-24 00:36:16 -04:00
fix(RecipeWaiter): sanitize user input in addOperation to prevent XSS
This commit is contained in:
parent
848660f8e1
commit
857576dbe4
3 changed files with 22 additions and 8 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue