From 4ec0e2f08651787704abc82690ede40a713c0203 Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Mon, 10 Jun 2024 11:57:18 -0400 Subject: [PATCH] Disable eval support in pdfjs --- src/plugins/pdfPlayer/plugin.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/pdfPlayer/plugin.js b/src/plugins/pdfPlayer/plugin.js index 6a14a4a684..0a7d203415 100644 --- a/src/plugins/pdfPlayer/plugin.js +++ b/src/plugins/pdfPlayer/plugin.js @@ -207,7 +207,12 @@ export class PdfPlayer { this.bindEvents(); GlobalWorkerOptions.workerSrc = appRouter.baseUrl() + '/libraries/pdf.worker.js'; - const downloadTask = getDocument(downloadHref); + const downloadTask = getDocument({ + url: downloadHref, + // Disable for PDF.js XSS vulnerability + // https://github.com/mozilla/pdf.js/security/advisories/GHSA-wgrm-67xf-hhpq + isEvalSupported: false + }); return downloadTask.promise.then(book => { if (this.cancellationToken) return; this.book = book;