mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Prevent arbitrary code execution via expressions (#6420)
This commit is contained in:
committed by
GitHub
parent
2aef9de148
commit
da7ae2beef
@@ -150,6 +150,13 @@ describe('Expression', () => {
|
||||
expect(evaluate('={{Boolean(1)}}')).toEqual(Boolean(1));
|
||||
expect(evaluate('={{Symbol(1).toString()}}')).toEqual(Symbol(1).toString());
|
||||
});
|
||||
|
||||
it('should not able to do arbitrary code execution', () => {
|
||||
const testFn = jest.fn();
|
||||
Object.assign(global, { testFn });
|
||||
evaluate("={{ Date['constructor']('testFn()')()}}");
|
||||
expect(testFn).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Test all expression value fixtures', () => {
|
||||
|
||||
Reference in New Issue
Block a user