Angular — это платформа разработки для создания мобильных и настольных веб-приложений с использованием TypeScript/JavaScript и других языков. До версий 20.3.28, 21.2.20 и 22.1.0 компилятор и среда выполнения Angular в @angular/core и @angular/compiler могли пропустить или выбрать неверный дезинфицирующий инструмент для чувствительных к безопасности привязок хоста директив, поскольку SecurityContext был получен из объявляющей директивы или селектора компонента, а не из конкретного элемента хоста. Несоответствие можно достичь с помощью композиции HostDirectives, унаследованных объявлений HostBinding, createComponent с пользовательским HostElement или динамических директив, элементов пространства имен SVG/MathML и нейтральных по тегам селекторов, таких как :not(...).
Таким образом, контролируемые злоумышленником значения href, src, action, xlink:href или data могут достигать атрибутов DOM без встроенного дезинфицирующего средства Angular и выполнять произвольный JavaScript в контексте браузера пользователя. Приложения, которые невозможно обновить, могут использовать DomSanitizer.sanitize с SecurityContext.URL перед назначением или ограничить ввод проверенными схемами URL-адресов HTTP и HTTPS. Эта проблема исправлена в версиях 20.3.28, 21.2.20 и 22.1.0.
Показать оригинальное описание (EN)
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 20.3.28, 21.2.20, and 22.1.0, Angular's compiler and runtime in @angular/core and @angular/compiler could omit or select an incorrect sanitizer for security-sensitive directive host bindings because SecurityContext was derived from the declaring directive or component selector rather than the concrete host element. The mismatch is reachable through hostDirectives composition, inherited HostBinding declarations, createComponent with a custom hostElement or dynamic directives, SVG/MathML namespace elements, and tag-neutral selectors such as :not(...). Attacker-controlled href, src, action, xlink:href, or data values can therefore reach DOM attributes without Angular's built-in sanitizer and execute arbitrary JavaScript in the user's browser context. Applications unable to upgrade can use DomSanitizer.sanitize with SecurityContext.URL before assignment or restrict inputs to validated HTTP and HTTPS URL schemes. This issue is fixed in versions 20.3.28, 21.2.20, and 22.1.0.
Характеристики атаки
Последствия
Строка CVSS v4.0
Тип уязвимости (CWE)
Уязвимые продукты 4
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Angular Angular
cpe:2.3:a:angular:angular:*:*:*:*:*:node.js:*:*
|
19.0.0
|
<= 19.2.25
|
|
Angular Angular
cpe:2.3:a:angular:angular:*:*:*:*:*:node.js:*:*
|
20.0.0
|
20.3.28
|
|
Angular Angular
cpe:2.3:a:angular:angular:*:*:*:*:*:node.js:*:*
|
21.0.0
|
21.2.20
|
|
Angular Angular
cpe:2.3:a:angular:angular:*:*:*:*:*:node.js:*:*
|
22.0.0
|
22.1.0
|