medikoo / deferred

Modular and fast Promises implementation for JavaScript
ISC License
364 stars 20 forks source link

Prevent stack trace grow in certain scenarios #42

Open medikoo opened 8 years ago

medikoo commented 8 years ago

Some places were already addressed: https://github.com/medikoo/deferred/commit/d0fea732adf7a437caa4d548e46808e433db68c3 https://github.com/medikoo/deferred/commit/4499d0f5a0e063177c8c61e988460673dd8bf368

Still, there is at least one vulnerability left:

    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Function.exports._onresolve.then (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:64:4)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Function.exports._onresolve.then (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:64:4)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Object.DMap.processValue (/home/medikoo/ldz/2/node_modules/deferred/ext/array/map.js:78:49)
    at Function.exports._onresolve.done (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:77:12)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Object.DMap.processValue (/home/medikoo/ldz/2/node_modules/deferred/ext/array/map.js:78:49)
    at Function.exports._onresolve.done (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:77:12)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Function.exports._onresolve.then (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:64:4)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
    at Function.exports._onresolve.then (/home/medikoo/ldz/2/node_modules/deferred/_ext.js:64:4)
    at Object.Deferred._settle (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:80:26)
    at Object.Deferred.resolve (/home/medikoo/ldz/2/node_modules/deferred/deferred.js:123:15)
medikoo commented 8 years ago

Other one, which exposed today.

It looks as result of very long (1000+) then chain:

    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)
    at Function.exports._onresolve.then (/home/eregistrations/gt-production/node_modules/deferred/_ext.js:54:11)
    at Object.Deferred._settle (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:84:26)
    at Object.Deferred.resolve (/home/eregistrations/gt-production/node_modules/deferred/deferred.js:127:15)