{"id":"GHSA-g93w-mfhg-p222","summary":"Angular vulnerable to XSS in i18n attribute bindings","details":"A Cross-Site Scripting (XSS) vulnerability has been identified in the Angular runtime and compiler. It occurs when the application uses a security-sensitive attribute (for example href on an anchor tag) together with Angular's ability to internationalize attributes. Enabling internationalization for the sensitive attribute by adding `i18n-\u003cattribute\u003e` name bypasses Angular's built-in sanitization mechanism, which when combined with a data binding to untrusted user-generated data can allow an attacker to inject a malicious script. \n\nThe following example illustrates the issue:\n```html\n\u003ca href=\"{{maliciousUrl}}\" i18n-href\u003eClick me\u003c/a\u003e\n```\n\nThe following attributes have been confirmed to be vulnerable:\n- `action`\n- `background`\n- `cite`\n- `codebase`\n- `data`\n- `formaction`\n- `href`\n- `itemtype`\n- `longdesc`\n- `poster`\n- `src`\n- `xlink:href`\n\n### Impact\nWhen exploited, this vulnerability allows an attacker to execute arbitrary code within the context of the vulnerable application's domain. This enables:\n- Session Hijacking: Stealing session cookies and authentication tokens.\n- Data Exfiltration: Capturing and transmitting sensitive user data.\n- Unauthorized Actions: Performing actions on behalf of the user.\n\n### Attack Preconditions\n1. The application must use a vulnerable version of Angular.\n2. The application must bind unsanitized user input to one of the attributes mentioned above.\n3. The bound value must be marked for internationalization via the presence of a `i18n-\u003cname\u003e` attribute on the same element.\n\n### Patches\n- 22.0.0-next.3\n- 21.2.4\n- 20.3.18\n- 19.2.20\n\n### Workarounds\nThe primary workaround is to ensure that any data bound to the vulnerable attributes is **never sourced from untrusted user input** (e.g., database, API response, URL parameters) until the patch is applied, or when it is, it shouldn't be marked for internationalization.\n\nAlternatively, users can explicitly sanitize their attributes by passing them through Angular's `DomSanitizer`:\n```ts\nimport {Component, inject, SecurityContext} from '@angular/core';\nimport {DomSanitizer} from '@angular/platform-browser';\n\n@Component({\n  template: `\n    \u003cform action=\"{{url}}\" i18n-action\u003e\n      \u003cbutton\u003eSubmit\u003c/button\u003e\n    \u003c/form\u003e\n  `,\n})\nexport class App {\n  url: string;\n\n  constructor() {\n    const dangerousUrl = 'javascript:alert(1)';\n    const sanitizer = inject(DomSanitizer);\n    this.url = sanitizer.sanitize(SecurityContext.URL, dangerousUrl) || '';\n  }\n}\n```\n\n### References\n- [Fix 1](https://github.com/angular/angular/pull/67541) \n- [Fix 2](https://github.com/angular/angular/pull/67561)","aliases":["CVE-2026-32635"],"modified":"2026-05-06T20:48:48.425804Z","published":"2026-03-13T20:56:18Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-03-13T20:56:18Z","nvd_published_at":"2026-03-16T14:19:40Z","cwe_ids":["CWE-79"],"severity":"HIGH"},"references":[{"type":"WEB","url":"https://github.com/angular/angular/security/advisories/GHSA-g93w-mfhg-p222"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-32635"},{"type":"WEB","url":"https://github.com/angular/angular/pull/67541"},{"type":"WEB","url":"https://github.com/angular/angular/pull/67561"},{"type":"WEB","url":"https://github.com/angular/angular/commit/224e60ecb1b90115baa702f1c06edc1d64d86187"},{"type":"WEB","url":"https://github.com/angular/angular/commit/78dea55351fb305b33a919c43a6b363137eca166"},{"type":"WEB","url":"https://github.com/angular/angular/commit/8630319f74c9575a21693d875cc7d5252516146d"},{"type":"WEB","url":"https://github.com/angular/angular/commit/ed2d324f9cc12aab6cfa0569ef10b73243a62c65"},{"type":"PACKAGE","url":"https://github.com/angular/angular"}],"affected":[{"package":{"name":"@angular/core","ecosystem":"npm","purl":"pkg:npm/%40angular/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"22.0.0-next.0"},{"fixed":"22.0.0-next.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/core","ecosystem":"npm","purl":"pkg:npm/%40angular/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"21.0.0-next.0"},{"fixed":"21.2.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/core","ecosystem":"npm","purl":"pkg:npm/%40angular/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"20.0.0-next.0.0.0"},{"fixed":"20.3.18"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/core","ecosystem":"npm","purl":"pkg:npm/%40angular/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"19.0.0-next.0"},{"fixed":"19.2.20"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/core","ecosystem":"npm","purl":"pkg:npm/%40angular/core"},"ranges":[{"type":"SEMVER","events":[{"introduced":"17.0.0-next.0"},{"last_affected":"18.2.14"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/compiler","ecosystem":"npm","purl":"pkg:npm/%40angular/compiler"},"ranges":[{"type":"SEMVER","events":[{"introduced":"22.0.0-next.0"},{"fixed":"22.0.0-next.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/compiler","ecosystem":"npm","purl":"pkg:npm/%40angular/compiler"},"ranges":[{"type":"SEMVER","events":[{"introduced":"21.0.0-next.0"},{"fixed":"21.2.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/compiler","ecosystem":"npm","purl":"pkg:npm/%40angular/compiler"},"ranges":[{"type":"SEMVER","events":[{"introduced":"20.0.0-next.0.0.0"},{"fixed":"20.3.18"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/compiler","ecosystem":"npm","purl":"pkg:npm/%40angular/compiler"},"ranges":[{"type":"SEMVER","events":[{"introduced":"19.0.0-next.0"},{"fixed":"19.2.20"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}},{"package":{"name":"@angular/compiler","ecosystem":"npm","purl":"pkg:npm/%40angular/compiler"},"ranges":[{"type":"SEMVER","events":[{"introduced":"17.0.0-next.0"},{"last_affected":"18.2.14"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-g93w-mfhg-p222/GHSA-g93w-mfhg-p222.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}]}