Commit 2e5d8e7
esm: protect ESM loader from prototype pollution
Fixes: #45035
PR-URL: #45044
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 17349a2 commit 2e5d8e7Copy full SHA for 2e5d8e7
File tree
Expand file treeCollapse file tree
8 files changed
+67
-6
lines changedOpen diff view settings
Filter options
- lib/internal
- bootstrap
- modules/esm
- test
- es-module
- parallel
Expand file treeCollapse file tree
8 files changed
+67
-6
lines changedOpen diff view settings
Collapse file
lib/internal/bootstrap/loaders.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/loaders.js+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
53 | 53 | |
54 | 54 | |
55 | 55 | |
| 56 | + |
56 | 57 | |
57 | 58 | |
58 | 59 | |
| ||
281 | 282 | |
282 | 283 | |
283 | 284 | |
| 285 | + |
| 286 | + |
284 | 287 | |
285 | 288 | |
286 | 289 | |
|
Collapse file
lib/internal/modules/esm/load.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/load.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | | - |
| 62 | + |
63 | 63 | |
64 | 64 | |
65 | 65 | |
| ||
93 | 93 | |
94 | 94 | |
95 | 95 | |
| 96 | + |
96 | 97 | |
97 | 98 | |
98 | 99 | |
|
Collapse file
lib/internal/modules/esm/loader.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
664 | 664 | |
665 | 665 | |
666 | 666 | |
| 667 | + |
667 | 668 | |
668 | 669 | |
669 | 670 | |
| ||
880 | 881 | |
881 | 882 | |
882 | 883 | |
| 884 | + |
883 | 885 | |
884 | 886 | |
885 | 887 | |
|
Collapse file
lib/internal/modules/esm/module_job.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/module_job.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
215 | 215 | |
216 | 216 | |
217 | 217 | |
218 | | - |
| 218 | + |
219 | 219 | |
220 | 220 | |
221 | 221 | |
|
Collapse file
lib/internal/modules/esm/resolve.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/resolve.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1017 | 1017 | |
1018 | 1018 | |
1019 | 1019 | |
1020 | | - |
| 1020 | + |
1021 | 1021 | |
1022 | 1022 | |
1023 | 1023 | |
|
Collapse file
test/es-module/test-cjs-prototype-pollution.js
Copy file name to clipboard+17Lines changed: 17 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 | + |
Collapse file
test/es-module/test-esm-prototype-pollution.mjs
Copy file name to clipboard+15Lines changed: 15 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 | + |
Collapse file
test/parallel/test-primordials-promise.js
Copy file name to clipboardExpand all lines: test/parallel/test-primordials-promise.js+26-3Lines changed: 26 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | | - |
22 | | - |
23 | | - |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
24 | 47 | |
25 | 48 | |
26 | 49 | |
|
0 commit comments