A Cross-site Scripting (XSS) vulnerability has been identified in the Angular internationalization (i18n) pipeline. In ICU messages (International Components for Unicode), HTML from translated content was not properly sanitized and could execute arbitrary JavaScript.
Angular i18n typically involves three steps, extracting all messages from an application in the source language, sending the messages to be translated, and then merging their translations back into the final source code. Translations are frequently handled by contracts with specific partner companies, and involve sending the source messages to a separate contractor before receiving final translations for display to the end user.
If the returned translations have malicious content, it could be rendered into the application and execute arbitrary JavaScript.
Impact
When successfully exploited, this vulnerability allows for execution of attacker controlled JavaScript in the application origin. Depending on the nature of the application being exploited this could lead to:
- Credential Exfiltration: Stealing sensitive user data stored in page memory, LocalStorage, IndexedDB, or cookies available to JS and sending them to an attacker controlled server.
- Page Vandalism: Mutating the page to read or act differently than intended by the developer.
Attach Preconditions
- The attacker must compromise the translation file (xliff, xtb, etc.).
- Unlike most XSS vulnerabilities, this one is not exploitable by arbitrary users. An attacker must first compromise an application's translation file before they can escalate privileges into the Angular application client.
- The victim application must use Angular i18n.
- The victim application must use one or more ICU messages.
- The victim application must render an ICU message.
- The victim application must not defend against XSS via a safe Content-Security Policy (CSP) or Trusted Types.
Patches
- 21.2.0
- 21.1.6
- 20.3.17
- 19.2.19
Workarounds
Until the patch is applied, developers should consider:
- Reviewing and verifying translated content received from untrusted third parties before incorporating it in an Angular application.
- Enabling strict CSP controls to block unauthorized JavaScript from executing on the page.
- Enabling Trusted Types to enforce proper HTML sanitization.
References
References
A Cross-site Scripting (XSS) vulnerability has been identified in the Angular internationalization (i18n) pipeline. In ICU messages (International Components for Unicode), HTML from translated content was not properly sanitized and could execute arbitrary JavaScript.
Angular i18n typically involves three steps, extracting all messages from an application in the source language, sending the messages to be translated, and then merging their translations back into the final source code. Translations are frequently handled by contracts with specific partner companies, and involve sending the source messages to a separate contractor before receiving final translations for display to the end user.
If the returned translations have malicious content, it could be rendered into the application and execute arbitrary JavaScript.
Impact
When successfully exploited, this vulnerability allows for execution of attacker controlled JavaScript in the application origin. Depending on the nature of the application being exploited this could lead to:
Attach Preconditions
Patches
Workarounds
Until the patch is applied, developers should consider:
References
References