n8n-core 1.102.0 → 1.102.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,38 +25,12 @@ function isFilePathBlocked(filePath) {
25
25
  const allowedPaths = getAllowedPaths();
26
26
  const resolvedFilePath = (0, node_path_1.resolve)(filePath);
27
27
  const blockFileAccessToN8nFiles = process.env[constants_1.BLOCK_FILE_ACCESS_TO_N8N_FILES] !== 'false';
28
- if (allowedPaths.length) {
29
- for (const path of allowedPaths) {
30
- if (resolvedFilePath.startsWith(path)) {
31
- return false;
32
- }
33
- }
28
+ const restrictedPaths = blockFileAccessToN8nFiles ? getN8nRestrictedPaths() : [];
29
+ if (restrictedPaths.some((restrictedPath) => (0, backend_common_1.isContainedWithin)(restrictedPath, resolvedFilePath))) {
34
30
  return true;
35
31
  }
36
- if (blockFileAccessToN8nFiles) {
37
- const { n8nFolder, staticCacheDir } = di_1.Container.get(instance_settings_1.InstanceSettings);
38
- const restrictedPaths = [n8nFolder, staticCacheDir];
39
- if (process.env[constants_1.CONFIG_FILES]) {
40
- restrictedPaths.push(...process.env[constants_1.CONFIG_FILES].split(','));
41
- }
42
- if (process.env[constants_1.CUSTOM_EXTENSION_ENV]) {
43
- const customExtensionFolders = process.env[constants_1.CUSTOM_EXTENSION_ENV].split(';');
44
- restrictedPaths.push(...customExtensionFolders);
45
- }
46
- if (process.env[constants_1.BINARY_DATA_STORAGE_PATH]) {
47
- restrictedPaths.push(process.env[constants_1.BINARY_DATA_STORAGE_PATH]);
48
- }
49
- if (process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]) {
50
- restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]);
51
- }
52
- if (process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]) {
53
- restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]);
54
- }
55
- for (const path of restrictedPaths) {
56
- if (resolvedFilePath.startsWith(path)) {
57
- return true;
58
- }
59
- }
32
+ if (allowedPaths.length) {
33
+ return !allowedPaths.some((allowedPath) => (0, backend_common_1.isContainedWithin)(allowedPath, resolvedFilePath));
60
34
  }
61
35
  return false;
62
36
  }
@@ -96,4 +70,25 @@ const getFileSystemHelperFunctions = (node) => ({
96
70
  },
97
71
  });
98
72
  exports.getFileSystemHelperFunctions = getFileSystemHelperFunctions;
73
+ function getN8nRestrictedPaths() {
74
+ const { n8nFolder, staticCacheDir } = di_1.Container.get(instance_settings_1.InstanceSettings);
75
+ const restrictedPaths = [n8nFolder, staticCacheDir];
76
+ if (process.env[constants_1.CONFIG_FILES]) {
77
+ restrictedPaths.push(...process.env[constants_1.CONFIG_FILES].split(','));
78
+ }
79
+ if (process.env[constants_1.CUSTOM_EXTENSION_ENV]) {
80
+ const customExtensionFolders = process.env[constants_1.CUSTOM_EXTENSION_ENV].split(';');
81
+ restrictedPaths.push(...customExtensionFolders);
82
+ }
83
+ if (process.env[constants_1.BINARY_DATA_STORAGE_PATH]) {
84
+ restrictedPaths.push(process.env[constants_1.BINARY_DATA_STORAGE_PATH]);
85
+ }
86
+ if (process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]) {
87
+ restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]);
88
+ }
89
+ if (process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]) {
90
+ restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]);
91
+ }
92
+ return restrictedPaths;
93
+ }
99
94
  //# sourceMappingURL=file-system-helper-functions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-system-helper-functions.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/file-system-helper-functions.ts"],"names":[],"mappings":";;;AA+BA,8CAoDC;AAnFD,wDAAmD;AACnD,gCAAoC;AAEpC,+CAAkD;AAClD,qCAA2C;AAC3C,+CAAgF;AAChF,yCAAoC;AAEpC,2CAQqB;AACrB,2DAAu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ceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/file-system-helper-functions.ts"],"names":[],"mappings":";;;AA+BA,8CAiBC;AAhDD,wDAAsE;AACtE,gCAAoC;AAEpC,+CAAkD;AAClD,qCAA2C;AAC3C,+CAAgF;AAChF,yCAAoC;AAEpC,2CAQqB;AACrB,2DAAuD;AAEvD,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAuB,CAAC,CAAC;IAClE,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,YAAY,GAAG,oBAAoB;SACvC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF,SAAgB,iBAAiB,CAAC,QAAgB;IACjD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,gBAAgB,GAAG,IAAA,mBAAO,EAAC,QAAQ,CAAC,CAAC;IAC3C,MAAM,yBAAyB,GAAG,OAAO,CAAC,GAAG,CAAC,0CAA8B,CAAC,KAAK,OAAO,CAAC;IAE1F,MAAM,eAAe,GAAG,yBAAyB,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjF,IACC,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,IAAA,kCAAiB,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC,EAC5F,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAA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AC,qCAAyB,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,sCAA0B,CAAC,EAAE,CAAC;QAC7C,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,sCAA0B,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,eAAe,CAAC;AACxB,CAAC"}
@@ -1,2 +1,5 @@
1
+ import { Transform } from 'stream';
1
2
  export declare const sandboxHtmlResponse: (html: string) => string;
3
+ export declare const bufferEscapeHtml: (input: Buffer) => Buffer<ArrayBuffer>;
4
+ export declare const createHtmlSandboxTransformStream: () => Transform;
2
5
  export declare const isHtmlRenderedContentType: (contentType: string) => boolean;
@@ -1,15 +1,81 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isHtmlRenderedContentType = exports.sandboxHtmlResponse = void 0;
3
+ exports.isHtmlRenderedContentType = exports.createHtmlSandboxTransformStream = exports.bufferEscapeHtml = exports.sandboxHtmlResponse = void 0;
4
+ const stream_1 = require("stream");
4
5
  const sandboxHtmlResponse = (html) => {
5
6
  const escapedHtml = html.replaceAll('&', '&amp;').replaceAll('"', '&quot;');
6
- return `
7
- <iframe srcdoc="${escapedHtml}" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
7
+ return `<iframe srcdoc="${escapedHtml}" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
8
8
  style="position:fixed; top:0; left:0; width:100vw; height:100vh; border:none; overflow:auto;"
9
- allowtransparency="true">
10
- </iframe>`;
9
+ allowtransparency="true"></iframe>`;
11
10
  };
12
11
  exports.sandboxHtmlResponse = sandboxHtmlResponse;
12
+ const bufferEscapeHtml = (input) => {
13
+ const ampersand = Buffer.from('&', 'utf8').readUInt8(0);
14
+ const escapedAmpersand = Buffer.from('&amp;', 'utf8');
15
+ const doublequote = Buffer.from('"', 'utf8').readUInt8(0);
16
+ const escapedDoublequote = Buffer.from('&quot;', 'utf8');
17
+ let ampersandCount = 0;
18
+ let doublequoteCount = 0;
19
+ for (let i = 0; i < input.length; i++) {
20
+ if (input[i] === ampersand)
21
+ ampersandCount++;
22
+ else if (input[i] === doublequote)
23
+ doublequoteCount++;
24
+ }
25
+ if (ampersandCount === 0 && doublequoteCount === 0)
26
+ return Buffer.from(input);
27
+ const resultLength = input.length +
28
+ ampersandCount * (escapedAmpersand.length - 1) +
29
+ doublequoteCount * (escapedDoublequote.length - 1);
30
+ const output = Buffer.alloc(resultLength);
31
+ let writeOffset = 0;
32
+ for (let i = 0; i < input.length; i++) {
33
+ if (input[i] === ampersand) {
34
+ escapedAmpersand.copy(output, writeOffset);
35
+ writeOffset += escapedAmpersand.length;
36
+ }
37
+ else if (input[i] === doublequote) {
38
+ escapedDoublequote.copy(output, writeOffset);
39
+ writeOffset += escapedDoublequote.length;
40
+ }
41
+ else {
42
+ output[writeOffset++] = input[i];
43
+ }
44
+ }
45
+ return output;
46
+ };
47
+ exports.bufferEscapeHtml = bufferEscapeHtml;
48
+ const createHtmlSandboxTransformStream = () => {
49
+ let isFirstChunk = true;
50
+ const prefix = Buffer.from('<iframe srcdoc="', 'utf8');
51
+ const suffix = Buffer.from('" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" style="position:fixed; top:0; left:0; width:100vw; height:100vh; border:none; overflow:auto;" allowtransparency="true"></iframe>', 'utf8');
52
+ return new stream_1.Transform({
53
+ transform(chunk, encoding, done) {
54
+ try {
55
+ chunk = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding);
56
+ const escapedChunk = (0, exports.bufferEscapeHtml)(chunk);
57
+ const transformedChunk = isFirstChunk
58
+ ? Buffer.concat([prefix, escapedChunk])
59
+ : escapedChunk;
60
+ isFirstChunk = false;
61
+ done(null, transformedChunk);
62
+ }
63
+ catch (error) {
64
+ done(error);
65
+ }
66
+ },
67
+ flush(done) {
68
+ try {
69
+ this.push(isFirstChunk ? Buffer.concat([prefix, suffix]) : suffix);
70
+ done();
71
+ }
72
+ catch (error) {
73
+ done(error);
74
+ }
75
+ },
76
+ });
77
+ };
78
+ exports.createHtmlSandboxTransformStream = createHtmlSandboxTransformStream;
13
79
  const isHtmlRenderedContentType = (contentType) => {
14
80
  const contentTypeLower = contentType.toLowerCase();
15
81
  return (contentTypeLower.startsWith('text/html') || contentTypeLower.startsWith('application/xhtml+xml'));
@@ -1 +1 @@
1
- {"version":3,"file":"html-sandbox.js","sourceRoot":"","sources":["../src/html-sandbox.ts"],"names":[],"mappings":";;;AAIO,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAGnD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE5E,OAAO;oBACY,WAAW;;;YAGnB,CAAC;AACb,CAAC,CAAC;AAVW,QAAA,mBAAmB,uBAU9B;AAMK,MAAM,yBAAyB,GAAG,CAAC,WAAmB,EAAE,EAAE;IAChE,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAEnD,OAAO,CAEN,gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAChG,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,yBAAyB,6BAOpC"}
1
+ {"version":3,"file":"html-sandbox.js","sourceRoot":"","sources":["../src/html-sandbox.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAM5B,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE;IAGnD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,EAA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AAG,IAAA,wBAAgB,EAAC,KAAK,CAAC,CAAC;gBAC7C,MAAM,gBAAgB,GAAG,YAAY;oBACpC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;oBACvC,CAAC,CAAC,YAAY,CAAC;gBAChB,YAAY,GAAG,KAAK,CAAC;gBAErB,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,KAAc,CAAC,CAAC;YACtB,CAAC;QACF,CAAC;QAED,KAAK,CAAC,IAAuB;YAC5B,IAAI,CAAC;gBACJ,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBACnE,IAAI,EAAE,CAAC;YACR,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,CAAC,KAAc,CAAC,CAAC;YACtB,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,gCAAgC,oCAkC3C;AAMK,MAAM,yBAAyB,GAAG,CAAC,WAAmB,EAAE,EAAE;IAChE,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAEnD,OAAO,CAEN,gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAChG,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,yBAAyB,6BAOpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-core",
3
- "version": "1.102.0",
3
+ "version": "1.102.1",
4
4
  "description": "Core functionality of n8n",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -55,13 +55,13 @@
55
55
  "winston": "3.14.2",
56
56
  "xml2js": "0.6.2",
57
57
  "zod": "3.25.67",
58
- "@n8n/backend-common": "^0.13.0",
58
+ "@n8n/config": "1.46.0",
59
59
  "@n8n/client-oauth2": "0.27.0",
60
+ "@n8n/di": "0.8.0",
60
61
  "@n8n/constants": "0.9.0",
61
- "@n8n/config": "1.46.0",
62
+ "n8n-workflow": "1.100.0",
62
63
  "@n8n/decorators": "0.13.0",
63
- "@n8n/di": "0.8.0",
64
- "n8n-workflow": "1.100.0"
64
+ "@n8n/backend-common": "^0.13.0"
65
65
  },
66
66
  "license": "SEE LICENSE IN LICENSE.md",
67
67
  "homepage": "https://n8n.io",