Commit ded8335
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: #38650
Backport-PR-URL: #38878
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>1 parent 864fe99 commit ded8335Copy full SHA for ded8335
File tree
Expand file treeCollapse file tree
7 files changed
+87
-13
lines changedOpen diff view settings
Filter options
- lib
- internal
- fs
- modules
- per_context
- timers
- test
- message
- parallel
Expand file treeCollapse file tree
7 files changed
+87
-13
lines changedOpen diff view settings
Collapse file
lib/internal/fs/promises.js
Copy file name to clipboardExpand all lines: lib/internal/fs/promises.js+7-7Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7 | 7 | |
8 | 8 | |
9 | 9 | |
10 | | - |
11 | 10 | |
12 | 11 | |
13 | 12 | |
| 13 | + |
14 | 14 | |
15 | 15 | |
16 | 16 | |
| ||
186 | 186 | |
187 | 187 | |
188 | 188 | |
189 | | - |
| 189 | + |
190 | 190 | |
191 | 191 | |
192 | 192 | |
193 | 193 | |
194 | | - |
| 194 | + |
195 | 195 | |
196 | 196 | |
197 | 197 | |
| ||
507 | 507 | |
508 | 508 | |
509 | 509 | |
510 | | - |
| 510 | + |
511 | 511 | |
512 | 512 | |
513 | 513 | |
| ||
638 | 638 | |
639 | 639 | |
640 | 640 | |
641 | | - |
| 641 | + |
642 | 642 | |
643 | 643 | |
644 | 644 | |
| ||
717 | 717 | |
718 | 718 | |
719 | 719 | |
720 | | - |
| 720 | + |
721 | 721 | |
722 | 722 | |
723 | 723 | |
| ||
742 | 742 | |
743 | 743 | |
744 | 744 | |
745 | | - |
| 745 | + |
746 | 746 | |
747 | 747 | |
748 | 748 | |
|
Collapse file
lib/internal/modules/run_main.js
Copy file name to clipboardExpand all lines: lib/internal/modules/run_main.js+6-3Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
5 | 4 | |
6 | 5 | |
7 | 6 | |
| ||
51 | 50 | |
52 | 51 | |
53 | 52 | |
54 | | - |
| 53 | + |
55 | 54 | |
56 | 55 | |
57 | 56 | |
| ||
60 | 59 | |
61 | 60 | |
62 | 61 | |
63 | | - |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
64 | 67 | |
65 | 68 | |
66 | 69 | |
|
Collapse file
lib/internal/per_context/primordials.js
Copy file name to clipboardExpand all lines: lib/internal/per_context/primordials.js+31Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
253 | 253 | |
254 | 254 | |
255 | 255 | |
| 256 | + |
| 257 | + |
256 | 258 | |
257 | 259 | |
258 | 260 | |
| ||
384 | 386 | |
385 | 387 | |
386 | 388 | |
| 389 | + |
| 390 | + |
| 391 | + |
| 392 | + |
| 393 | + |
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
387 | 418 | |
388 | 419 | |
Collapse file
+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
6 | | - |
7 | 6 | |
| 7 | + |
8 | 8 | |
9 | 9 | |
10 | 10 | |
| ||
71 | 71 | |
72 | 72 | |
73 | 73 | |
74 | | - |
| 74 | + |
75 | 75 | |
76 | 76 | |
77 | 77 | |
| ||
115 | 115 | |
116 | 116 | |
117 | 117 | |
118 | | - |
| 118 | + |
119 | 119 | |
120 | 120 | |
121 | 121 | |
|
Collapse file
test/message/esm_display_syntax_error_import.out
Copy file name to clipboardExpand all lines: test/message/esm_display_syntax_error_import.out+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
Collapse file
test/message/esm_display_syntax_error_import_module.out
Copy file name to clipboardExpand all lines: test/message/esm_display_syntax_error_import_module.out+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
6 | 6 | |
7 | 7 | |
8 | 8 | |
| 9 | + |
Collapse file
test/parallel/test-primordials-promise.js
Copy file name to clipboard+38Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
0 commit comments