You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet will cause a segmentation fault on master:
// This is an evil arrayconstarray=[0];Object.defineProperty(array,'0',{get(){thrownewError();}});// Trick the environment into thinking it is inside a domainprocess._setupDomainUse(array,[])[0]=1;// This call will try to use the pretended domain and segfaultrequire('crypto').randomBytes(1024,()=>{});// The process will segfault above so this never gets printedconsole.log('Still working');
This is caused by using env->domain_array->Get(0) instead of the safe variant of the Get function. This is not limited to randomBytes, there is a number of files with similar code.
The priority of this issue is very low as it uses undocumented internal functions to intentionally cause a segmentation fault. I am documenting this for the sake of completeness.
The text was updated successfully, but these errors were encountered:
PR-URL: #14548Fixes: #14519
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
The following snippet will cause a segmentation fault on master:
This is caused by using
env->domain_array->Get(0)
instead of the safe variant of theGet
function. This is not limited torandomBytes
, there is a number of files with similar code.The priority of this issue is very low as it uses undocumented internal functions to intentionally cause a segmentation fault. I am documenting this for the sake of completeness.
The text was updated successfully, but these errors were encountered: