{"id":"GHSA-hh8m-fm6v-7cvg","revision":"470858cbcdad4e87a0b40bb331a960db","records":[{"revision":"470858cbcdad4e87a0b40bb331a960db","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-hh8m-fm6v-7cvg","aliases":["CVE-2026-88057"],"title":"Angular: Sanitization bypass via directive host bindings on concrete host elements in @angular/core and @angular/compiler","description":"Angular automatically sanitizes untrusted values bound to security-sensitive DOM sinks (such as `href`, `src`, `action`, `xlink:href`, and `data`) to protect against Cross-Site Scripting (XSS).\n\nPrior to the fix, the Angular compiler determined the `SecurityContext` for directive host bindings (`host: {'[attr.href]': 'value'}` or `@HostBinding('attr.href')`) based solely on the declaring directive or component selector at compile time, rather than the concrete host element that the directive was applied to.\n\nWhen a directive with a security-sensitive host binding was applied to a different concrete host element—such as through:\n- `hostDirectives` composition,\n- Class inheritance of host bindings,\n- Dynamic component instantiation (`createComponent` with custom `hostElement` or dynamic directives),\n- Elements with SVG/MathML namespaces (e.g. `<svg:a>`, `<math>`), or\n- Elements using tag-neutral selectors (e.g. `:not(...)`),\n\nthe compiler either failed to associate a sanitizer with the host binding or attached an incorrect security context. As a result, untrusted inputs (e.g. `javascript:...` URLs) bound via the host binding would be written to the DOM attribute without passing through Angular's built-in sanitizer.\n\n### Impact\nAn attacker capable of controlling the value bound to an affected directive host binding could execute arbitrary JavaScript in the user's browser context (Cross-Site Scripting).\n\n### Patches\nThis issue has been resolved in versions:\n- `22.1.0` \n- `21.2.20`\n- `20.3.28`\n\n### Workarounds\nEnsure that any user-controlled values assigned to properties bound via directive host bindings are explicitly sanitized using `DomSanitizer.sanitize(SecurityContext.URL, ...)` before assignment, or restrict the input to validated safe URL schemes (e.g. `http://`, `https://`).","state":0,"publishedAt":"2026-09-10T20:18:02+00:00","modifiedAt":"2026-09-10T20:30:04.4381984+00:00","affected":[{"ecosystem":"npm","name":"@angular/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"22.0.0"},{"kind":"fixed","version":"22.1.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/compiler","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"22.0.0"},{"kind":"fixed","version":"22.1.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"21.0.0"},{"kind":"fixed","version":"21.2.20"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/compiler","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"21.0.0"},{"kind":"fixed","version":"21.2.20"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"20.0.0"},{"kind":"fixed","version":"20.3.28"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/compiler","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"20.0.0"},{"kind":"fixed","version":"20.3.28"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/core","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"19.2.25"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@angular/compiler","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"19.2.25"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/angular/angular/security/advisories/GHSA-hh8m-fm6v-7cvg","https://github.com/angular/angular/issues/69550","https://github.com/angular/angular/pull/69558","https://github.com/angular/angular/commit/2f96c8020f85ccb715a76de4b79a0c680c2c7264","https://github.com/angular/angular/commit/6afe6fa781c2f0931f0aedd729b9884a8fe212ee","https://github.com/angular/angular/commit/6caa298dee58319b2d674dc91364e26ffe3ecb2b","https://github.com/angular/angular","https://github.com/angular/angular/releases/tag/v20.3.28","https://github.com/angular/angular/releases/tag/v21.2.20","https://github.com/angular/angular/releases/tag/v22.1.0"],"sourceUrl":"https://github.com/advisories/GHSA-hh8m-fm6v-7cvg","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-hh8m-fm6v-7cvg","identifiers":["GHSA-hh8m-fm6v-7cvg","CVE-2026-88057"]},"retained":false,"historicalAffected":[]}],"coverage":[]}