angular/packages/zone.js/lib
arturovt 4321c21a53 fix(zone.js): validate __Zone_symbol_prefix to prevent DOM clobbering attacks
Previously, `__Zone_symbol_prefix` was read directly from `globalThis` without validating its type:

const symbolPrefix = global['__Zone_symbol_prefix'] || '__zone_symbol__';

This made it possible for DOM clobbering to interfere with Zone’s internal symbol handling. If an attacker injected a DOM element with the same name (for example via a form field or anchor ID), `global['__Zone_symbol_prefix']` could resolve to a DOM element instead of a string. Because DOM elements are truthy, the fallback would not be used, and Zone would construct invalid internal keys (e.g. “[object HTMLFormElement]...”), breaking patching and lookup logic in subtle ways.

After the fix, `rawPrefix` is only accepted when it is a string matching `/^[a-zA-Z0-9_]+$/`. Any other value (DOM nodes, empty strings, or strings with unexpected characters) is rejected and replaced with the default `'__zone_symbol__'`.

This prevents DOM clobbering from influencing Zone’s internal symbol generation and keeps the patching system stable even in the presence of malicious or unexpected global values.
2026-05-23 23:16:39 +03:00
..
browser refactor(zone.js): remove legacy browser support (#63511) 2025-10-16 14:58:45 +00:00
common fix(zone.js): support passthrough of Promise.try API 2026-02-17 11:32:49 -08:00
extra refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
jasmine fix(zone.js): Support jasmine v6 2025-10-24 18:46:04 +02:00
jest refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
mix refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
mocha refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
node refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
rxjs refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
testing refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
vitest feat(zone.js): support vitest patching in zone.js/testing (#68395) 2026-04-30 15:44:35 -07:00
zone-spec refactor(zone.js): Improve missing proxy zone error for jest imported (#64497) 2025-10-22 23:26:23 +00:00
BUILD.bazel refactor(zone.js): remove legacy browser support (#63511) 2025-10-16 14:58:45 +00:00
zone-global.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone-impl.ts fix(zone.js): validate __Zone_symbol_prefix to prevent DOM clobbering attacks 2026-05-23 23:16:39 +03:00
zone.api.extensions.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone.configurations.api.ts fix(zone.js): allow draining microtasks in Promise.then (through flag) 2026-04-15 10:31:28 -04:00
zone.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00