Commit 8ad7622
committed
fix(WorkerPlugin): sanitize webpackEntryOptions at the parse boundary
Move the prototype-pollution guard out of buildChunkGraph and into the
place where the `webpackEntryOptions` magic comment is consumed: copy
only safe own keys (skip `__proto__`/`constructor`/`prototype`) instead
of `Object.assign`. This protects every consumer of the resulting
entryOptions (the entrypoint constructor and the gap-fill) at the
untrusted-input boundary, so buildChunkGraph no longer needs key
validation and keeps only its `name`-identity exclusion. The existing
worker test still asserts the keys never reach entrypoint.options.1 parent 5fbee11 commit 8ad7622
2 files changed
Lines changed: 19 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
595 | | - | |
596 | | - | |
597 | 595 | | |
598 | 596 | | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | 597 | | |
608 | 598 | | |
609 | 599 | | |
| 600 | + | |
610 | 601 | | |
611 | 602 | | |
612 | 603 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
356 | 370 | | |
357 | 371 | | |
358 | 372 | | |
| |||
0 commit comments