mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(core): Prevent XSS via static cache dir (#10339)
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
copyInputItems,
|
||||
ensureType,
|
||||
getBinaryDataBuffer,
|
||||
isFilePathBlocked,
|
||||
parseIncomingMessage,
|
||||
parseRequestObject,
|
||||
proxyRequestToAxios,
|
||||
@@ -34,6 +35,7 @@ import { join } from 'path';
|
||||
import Container from 'typedi';
|
||||
import type { Agent } from 'https';
|
||||
import toPlainObject from 'lodash/toPlainObject';
|
||||
import { InstanceSettings } from '@/InstanceSettings';
|
||||
|
||||
const temporaryDir = mkdtempSync(join(tmpdir(), 'n8n'));
|
||||
|
||||
@@ -663,3 +665,11 @@ describe('NodeExecuteFunctions', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('isFilePathBlocked', () => {
|
||||
test('should return true for static cache dir', () => {
|
||||
const filePath = Container.get(InstanceSettings).staticCacheDir;
|
||||
|
||||
expect(isFilePathBlocked(filePath)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user