Commit Graph

3 Commits

Author SHA1 Message Date
Antoine du Hamel
d7f193434a
lib: add Promise methods to avoid-prototype-pollution lint rule
PR-URL: https://github.com/nodejs/node/pull/43849
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2022-07-26 23:38:24 +01:00
Antoine du Hamel
3fb57843de
lib: implement safe alternatives to Promise static methods
PR-URL: https://github.com/nodejs/node/pull/43728
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-07-10 14:17:23 +01:00
Antoine du Hamel
2eeb4e1d94
lib: make primordials Promise methods safe
`catch` and `finally` methods on %Promise.prototype% looks up the `then`
property of the instance, making it at risk of prototype pollution.

PR-URL: https://github.com/nodejs/node/pull/38650
Refs: https://tc39.es/ecma262/#sec-promise.prototype.catch
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-05-19 09:21:37 -07:00