Skip to content

Commit

Permalink
fix(Read PDF Node): Disable JS evaluation from PDFs (#9336)
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed May 8, 2024
1 parent 695e762 commit c4bf5b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nodes-base/utils/binary.ts
Expand Up @@ -7,6 +7,7 @@ import get from 'lodash/get';
import iconv from 'iconv-lite';

import { getDocument as readPDF, version as pdfJsVersion } from 'pdfjs-dist';
import type { DocumentInitParameters } from 'pdfjs-dist/types/src/display/api';
import { flattenObject } from '@utils/utilities';

export type JsonToSpreadsheetBinaryFormat = 'csv' | 'html' | 'rtf' | 'ods' | 'xls' | 'xlsx';
Expand Down Expand Up @@ -157,7 +158,7 @@ export async function extractDataFromPDF(
) {
const binaryData = this.helpers.assertBinaryData(itemIndex, binaryPropertyName);

const params: { password?: string; url?: URL; data?: ArrayBuffer } = { password };
const params: DocumentInitParameters = { password, isEvalSupported: false };

if (binaryData.id) {
params.data = await this.helpers.binaryToBuffer(
Expand Down

0 comments on commit c4bf5b2

Please sign in to comment.