fix(core): Disallow code generation in task runner (#12522)

This commit is contained in:
Tomi Turtiainen
2025-01-09 13:27:17 +02:00
committed by GitHub
parent 46f13cfca9
commit 35b618098b
5 changed files with 23 additions and 12 deletions

View File

@@ -117,5 +117,16 @@ describe('TaskRunnerProcess', () => {
const options = spawnMock.mock.calls[0][2] as SpawnOptions;
expect(options.env).not.toHaveProperty('NODE_OPTIONS');
});
it('should use --disallow-code-generation-from-strings flag', async () => {
jest.spyOn(authService, 'createGrantToken').mockResolvedValue('grantToken');
await taskRunnerProcess.start();
expect(spawnMock.mock.calls[0].at(1)).toEqual([
'--disallow-code-generation-from-strings',
expect.stringContaining('/packages/@n8n/task-runner/dist/start.js'),
]);
});
});
});