New JavaScript trick invokes arbitrary functions without parentheses

Yet another way to invoke functions without parentheses

A new technique exploits Error.prepareStackTrace and prototype pollution to call functions without parentheses. By overwriting prepareStackTrace, the stack trace becomes a function generated by the Function constructor. Polluting Object.prototype.message and Array.prototype.toString turns the stack array into executable code, and the valueOf trick triggers the call. The final payload fits in a few lines.

i found yet another way to invoke arbitrary functions in javascript without using parentheses

More from this day

2026-10-16