/

CVE-2026-32635

Severity:

CRITICAL RISK

(9.0)

Cross-Site Scripting (XSS) in Angular Runtime and Compiler

CVE-2026-32635

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Client-Side Code Execution (XSS) leading to account compromise and data theft

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A Cross-Site Scripting (XSS) vulnerability in the Angular runtime and compiler appears when internationalization is enabled on security-sensitive HTML attributes (such as href) and those attributes are bound to untrusted user data.

Because the i18n-<attribute> directive bypasses Angular's built-in sanitization in these cases, an attacker can inject malicious scripts that execute in the victim's browser when viewing the affected page.

Affected context

This vulnerability affects Angular applications that:

  • Use internationalization (i18n) on HTML attributes via i18n-<attribute> markers, and
  • Apply this to security-sensitive attributes such as href, src, action, or similar, and
  • Bind those attributes to data that may be influenced, directly or indirectly, by users or other untrusted sources.

The risk primarily exists in templates where developers expect Angular's built-in sanitization to protect sensitive attributes, but the i18n configuration causes that sanitization to be skipped for those attributes.

Exploit preconditions

  • Attack surface: Any rendered Angular template where a security-sensitive attribute (for example, <a [href]="value" i18n-href>) is internationalized and bound to untrusted or insufficiently validated data.
  • Required access: Ability to inject or control the data that flows into the affected attribute binding (e.g., through form input, query parameters, CMS content, or APIs).
  • Trigger point: The browser rendering of the Angular template after the attacker-controlled value has been bound to the internationalized attribute.
  • Why exploitation is possible: The combination of i18n-<attribute> and data binding on a sensitive attribute bypasses Angular's normal sanitization logic, allowing attacker-controlled values to be written into the DOM in a way that the browser interprets as executable script.

Why this happens

The core issue lies in how Angular's i18n system interacts with its security model. Under normal circumstances, Angular sanitizes values bound to sensitive attributes to prevent script execution. However, when developers enable internationalization for such an attribute using i18n-<attribute>, internal logic in the runtime/compiler path can cause the sanitization process to be skipped or altered.

This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting). The framework's output encoding/sanitization is effectively disabled in a specific configuration, while still allowing untrusted data to flow into the DOM. The bug is not in the developer's template alone, but in the framework's failure to consistently enforce sanitization across all code paths involving i18n and sensitive attributes.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser under the origin of the vulnerable Angular application
  • Theft or exposure of user data such as session tokens, personal information, and API responses
  • Unauthorized actions on behalf of the victim (e.g., changing account details, initiating transactions)
  • Defacement or manipulation of the application's UI and content
  • Use of the application as a pivot point for broader phishing or social engineering campaigns

General mitigation guidance

Effective mitigation focuses on restoring strong output encoding and limiting the combination of i18n with sensitive attributes:

  • Avoid enabling i18n on security-sensitive attributes when those attributes receive untrusted or partially trusted values; prefer i18n on nearby text nodes or labels instead of the attribute itself.
  • Constrain attribute values to a safe, well-defined set of options (e.g., whitelisting known-good URLs or paths) rather than allowing arbitrary user-provided strings.
  • Apply explicit validation and canonicalization to any data used in sensitive attributes before it reaches the template, ensuring it cannot contain script schemes (like javascript:) or dangerous fragments.
  • Prefer safer composition patterns such as:
  • Keeping dynamic parts (like IDs or query parameters) separate from static, framework-controlled URL bases.
  • Using dedicated services or helper functions that return already-validated, sanitized values for attributes.
  • Adhere to the principle of least privilege in client-side code by minimizing where user-controlled data can influence navigation, resource loading, or form submission attributes.

How teams detect issues like this

Teams can detect and monitor for this class of issue using a combination of code-level and behavioral checks:

  • Static analysis and linting:
  • Flag templates that combine i18n-<attribute> with bindings on known security-sensitive attributes (href, src, action, formaction, xlink:href, etc.).
  • Identify attribute bindings where the source is user input or externally sourced data and ensure they pass through validation or whitelisting logic.
  • Code review practices:
  • Treat any use of i18n-<attribute> as a security-relevant construct that requires explicit review.
  • Trace data flows from controllers/services into sensitive attributes and verify that no untrusted data reaches them unsanitized.
  • Automated testing and dynamic analysis:
  • Include XSS-focused tests that attempt to inject script-like payloads into any field or parameter that may flow into internationalized attributes.
  • Use security testing tools (DAST/SAST) capable of understanding Angular templates and attribute binding patterns.
  • Policy enforcement:
  • Introduce internal guidelines or template-check rules that restrict or forbid combining i18n with sensitive attributes unless a vetted pattern is followed.

Sources

SourceLink
github.comgithub.com/angular/angular/pull/67541
github.comgithub.com/angular/angular/pull/67561
github.comgithub.com/angular/angular/security/advisories/GHSA-g93w-mfhg-p222

Frequently asked

questions

The vulnerability can be exploited wherever Angular templates combine internationalized sensitive attributes with untrusted data bindings. In large applications with extensive i18n usage, this can create multiple XSS injection points, especially if user input or CMS content flows into these attributes.

Not necessarily. The key requirement is control over the data that ends up bound to an internationalized sensitive attribute. This control might come from authenticated actions (e.g., profile fields), but it can also come from unauthenticated inputs such as public forms, URL parameters, or third-party data feeds.

The safest approach is to remove i18n markers from security-sensitive attributes that receive untrusted data, and instead internationalize nearby text elements or labels. Where dynamic values are needed, restrict them to predefined, validated values or construct URLs from trusted base paths plus tightly validated parameters handled in application logic rather than directly in the template.

Teams can prevent recurrence by formalizing secure template patterns, adding lint rules and code review checklists around i18n and sensitive attributes, and enforcing strict validation and whitelisting for any data used in attributes that affect navigation or resource loading. Incorporating security-focused testing into the CI pipeline for new and modified templates further reduces the likelihood of regressions.

Find out what's already
exploitable in your codebase.