mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-23 02:21:42 -08:00
fix(core): Upgrade sheetjs to address CVE-2024-22363 (#9498)
This commit is contained in:
parent
75408b0113
commit
8737c0965e
|
@ -1,4 +1,5 @@
|
|||
import path from 'path';
|
||||
import { readFileSync } from 'fs';
|
||||
import type { IWorkflowBase } from 'n8n-workflow';
|
||||
import * as Helpers from '@test/nodes/Helpers';
|
||||
import type { WorkflowTestData } from '@test/nodes/types';
|
||||
|
@ -9,6 +10,9 @@ describe('Execute Spreadsheet File Node', () => {
|
|||
await Helpers.initBinaryDataService();
|
||||
});
|
||||
|
||||
const readBinaryFile = (fileName: string) =>
|
||||
readFileSync(path.resolve(__dirname, fileName), 'base64');
|
||||
|
||||
const loadWorkflow = (fileName: string, csvName: string) => {
|
||||
const workflow = Helpers.readJsonFileSync<IWorkflowBase>(
|
||||
`nodes/SpreadsheetFile/test/${fileName}`,
|
||||
|
@ -109,7 +113,7 @@ describe('Execute Spreadsheet File Node', () => {
|
|||
mimeType: 'text/html',
|
||||
fileType: 'html',
|
||||
fileExtension: 'html',
|
||||
data: 'PGh0bWw+PGhlYWQ+PG1ldGEgY2hhcnNldD0idXRmLTgiLz48dGl0bGU+U2hlZXRKUyBUYWJsZSBFeHBvcnQ8L3RpdGxlPjwvaGVhZD48Ym9keT48dGFibGU+PHRyPjx0ZCBkYXRhLXQ9InMiIGRhdGEtdj0iQSIgaWQ9InNqcy1BMSI+QTwvdGQ+PHRkIGRhdGEtdD0icyIgZGF0YS12PSJCIiBpZD0ic2pzLUIxIj5CPC90ZD48dGQgZGF0YS10PSJzIiBkYXRhLXY9IkMiIGlkPSJzanMtQzEiPkM8L3RkPjwvdHI+PHRyPjx0ZCBkYXRhLXQ9Im4iIGRhdGEtdj0iMSIgaWQ9InNqcy1BMiI+MTwvdGQ+PHRkIGRhdGEtdD0ibiIgZGF0YS12PSIyIiBpZD0ic2pzLUIyIj4yPC90ZD48dGQgZGF0YS10PSJuIiBkYXRhLXY9IjMiIGlkPSJzanMtQzIiPjM8L3RkPjwvdHI+PHRyPjx0ZCBkYXRhLXQ9Im4iIGRhdGEtdj0iNCIgaWQ9InNqcy1BMyI+NDwvdGQ+PHRkIGRhdGEtdD0ibiIgZGF0YS12PSI1IiBpZD0ic2pzLUIzIj41PC90ZD48dGQgZGF0YS10PSJuIiBkYXRhLXY9IjYiIGlkPSJzanMtQzMiPjY8L3RkPjwvdHI+PC90YWJsZT48L2JvZHk+PC9odG1sPg==',
|
||||
data: readBinaryFile('spreadsheet.html'),
|
||||
fileName: 'spreadsheet.html',
|
||||
fileSize: '535 B',
|
||||
},
|
||||
|
@ -127,7 +131,7 @@ describe('Execute Spreadsheet File Node', () => {
|
|||
data: {
|
||||
mimeType: 'application/rtf',
|
||||
fileExtension: 'rtf',
|
||||
data: 'e1xydGYxXGFuc2lcdHJvd2RcdHJhdXRvZml0MVxjZWxseDFcY2VsbHgyXGNlbGx4M1xwYXJkXGludGJsIEFcY2VsbCBCXGNlbGwgQ1xjZWxsXHBhcmRcaW50Ymxccm93XHRyb3dkXHRyYXV0b2ZpdDFcY2VsbHgxXGNlbGx4MlxjZWxseDNccGFyZFxpbnRibCAxXGNlbGwgMlxjZWxsIDNcY2VsbFxwYXJkXGludGJsXHJvd1x0cm93ZFx0cmF1dG9maXQxXGNlbGx4MVxjZWxseDJcY2VsbHgzXHBhcmRcaW50YmwgNFxjZWxsIDVcY2VsbCA2XGNlbGxccGFyZFxpbnRibFxyb3d9',
|
||||
data: readBinaryFile('spreadsheet.rtf'),
|
||||
fileName: 'spreadsheet.rtf',
|
||||
fileSize: '267 B',
|
||||
},
|
||||
|
@ -143,7 +147,7 @@ describe('Execute Spreadsheet File Node', () => {
|
|||
data: {
|
||||
mimeType: 'application/vnd.ms-excel',
|
||||
fileExtension: 'xls',
|
||||
data: '0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAgAAAAAAAAAAEAAAAQAAAAEAAAD+////AAAAAAAAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/////v////7///8EAAAABQAAAP7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7///8CAAAAAwAAAAQAAAAFAAAABgAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAAAARAAAAEgAAABMAAAD+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+/////v////7////+////UgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQH//////////wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAUAAAAAAAABAFMAaAAzADMAdABKADUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
|
||||
data: readBinaryFile('spreadsheet.xls'),
|
||||
fileName: 'spreadsheet.xls',
|
||||
fileSize: '3.58 kB',
|
||||
},
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body><table><tr><td data-t="s" data-v="A" id="sjs-A1">A</td><td data-t="s" data-v="B" id="sjs-B1">B</td><td data-t="s" data-v="C" id="sjs-C1">C</td></tr><tr><td data-t="n" data-v="1" id="sjs-A2">1</td><td data-t="n" data-v="2" id="sjs-B2">2</td><td data-t="n" data-v="3" id="sjs-C2">3</td></tr><tr><td data-t="n" data-v="4" id="sjs-A3">4</td><td data-t="n" data-v="5" id="sjs-B3">5</td><td data-t="n" data-v="6" id="sjs-C3">6</td></tr></table></body></html>
|
|
@ -0,0 +1 @@
|
|||
{\rtf1\ansi\trowd\trautofit1\cellx1\cellx2\cellx3\pard\intbl A\cell B\cell C\cell\pard\intbl\row\trowd\trautofit1\cellx1\cellx2\cellx3\pard\intbl 1\cell 2\cell 3\cell\pard\intbl\row\trowd\trautofit1\cellx1\cellx2\cellx3\pard\intbl 4\cell 5\cell 6\cell\pard\intbl\row}
|
BIN
packages/nodes-base/nodes/SpreadsheetFile/test/spreadsheet.xls
Normal file
BIN
packages/nodes-base/nodes/SpreadsheetFile/test/spreadsheet.xls
Normal file
Binary file not shown.
|
@ -901,7 +901,7 @@
|
|||
"ts-ics": "^1.2.2",
|
||||
"typedi": "0.10.0",
|
||||
"uuid": "8.3.2",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz",
|
||||
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
|
||||
"xml2js": "0.6.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1518,8 +1518,8 @@ importers:
|
|||
specifier: 8.3.2
|
||||
version: 8.3.2
|
||||
xlsx:
|
||||
specifier: https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz
|
||||
version: '@cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz'
|
||||
specifier: https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz
|
||||
version: '@cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz'
|
||||
xml2js:
|
||||
specifier: 0.6.2
|
||||
version: 0.6.2
|
||||
|
@ -25274,10 +25274,10 @@ packages:
|
|||
resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==}
|
||||
dev: false
|
||||
|
||||
'@cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz':
|
||||
resolution: {registry: https://registry.npmjs.org/, tarball: https://cdn.sheetjs.com/xlsx-0.19.3/xlsx-0.19.3.tgz}
|
||||
'@cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz':
|
||||
resolution: {tarball: https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz}
|
||||
name: xlsx
|
||||
version: 0.19.3
|
||||
version: 0.20.2
|
||||
engines: {node: '>=0.8'}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
|
Loading…
Reference in a new issue