nestjs-cls icon indicating copy to clipboard operation
nestjs-cls copied to clipboard

"enterWith" security concern is resolved in node 24?

Open amrsalama opened this issue 3 months ago • 1 comments

I think this PR in node 24 (https://github.com/nodejs/node/pull/58029) resolved the security concern of "enterWith" in guard (and optionally in middleware initializers).

Tests: Image

Maybe we should add notes about it as well?

Also in older versions (based on the examples in this PR as well), we can avoid the same issue with

const als = new AsyncLocalStorage();
als.enterWith(undefined); // Forcefully enable the AsyncLocalStorage.
Image

amrsalama avatar Oct 19 '25 17:10 amrsalama