From af933ae82c5224300a7f4b0f59ebaf725c01dbc9 Mon Sep 17 00:00:00 2001 From: igorescento <12073355+igopet3811@users.noreply.github.com> Date: Sat, 17 Dec 2022 10:04:53 +0000 Subject: [PATCH] Vulnerability fix CVE-2022-46161 Co-authored-by: Igorescento Petrarca --- dev-playground/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-playground/server.js b/dev-playground/server.js index c59e63d63..e2deb1a7e 100644 --- a/dev-playground/server.js +++ b/dev-playground/server.js @@ -42,7 +42,7 @@ function createPdfBinary(pdfDoc, callback) { } app.post('/pdf', function (req, res) { - eval(req.body.content); + const dd = new Function(req.body.content + '; return dd;')(); createPdfBinary(dd, function (binary) { res.contentType('application/pdf');