n8n-io/n8n · error · Error
Object.getPrototypeOf is not allowed
Error message
Object.getPrototypeOf is not allowed
What it means
Error "Object.getPrototypeOf is not allowed" thrown in n8n-io/n8n.
Source
Thrown at packages/@n8n/expression-runtime/src/runtime/safe-globals.ts:34
const blockedMethods = [
'defineProperty',
'defineProperties',
'setPrototypeOf',
'getOwnPropertyDescriptor',
'getOwnPropertyDescriptors',
'__defineGetter__',
'__defineSetter__',
'__lookupGetter__',
'__lookupSetter__',
];
if (blockedMethods.includes(prop as string)) {
return undefined;
}
// Block getPrototypeOf by throwing (more secure than returning undefined)
if (prop === 'getPrototypeOf') {
throw new Error('Object.getPrototypeOf is not allowed');
}
// Wrap Object.create to accept only one argument (blocks property descriptor injection)
if (prop === 'create') {
return (proto: object | null) => Object.create(proto);
}
// Allow other Object methods
const value = (target as any)[prop];
if (typeof value === 'function') {
// Use arrow function wrapper to preserve 'this' binding
return (...args: any[]) => value.apply(target, args);
}
return value;
},
});
/**View on GitHub (pinned to 5ac6606e81)
When it happens
Trigger: Thrown at packages/@n8n/expression-runtime/src/runtime/safe-globals.ts:34 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/2594fcead9a7c5b8.
Report an issue: GitHub.