CVE-2021-4231 Angular Comment cross site scripting
Remote attackers can execute arbitrary scripts via comment handling in Angular, potentially compromising user sessions or data.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-4231?
CVE-2021-4231 is a low-severity cross-site scripting vulnerability in unspecified Angular, published on 26 May 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
A vulnerability was found in Angular up to 11.0.4/11.1.0-next.2. It has been classified as problematic. Affected is the handling of comments. The manipulation leads to cross site scripting. It is possible to launch the attack remotely but it might require an authentication first. Upgrading to version 11.0.5 and 11.1.0-next.3 is able to address this issue. The name of the patch is ba8da742e3b243e8f43d4c63aa842b44e14f2b09. It is recommended to upgrade the affected component.
Weakness: CWE-79
Which versions are affected by CVE-2021-4231?
6 open source packages ship an affected version, including @angular/core. It affects 2 products.
| Package | Affected | Fixed in |
|---|---|---|
@angular/core npm | All versions | 10.2.5 |
@angular/core npm | All versions | 10.2.5 |
@angular/core npm | From 11.0.0 | 11.0.5 |
@angular/core npm | From 11.0.0 | 11.0.5 |
@angular/core npm | From 11.1.0-next.0 | 11.1.0-next.3 |
@angular/core npm | From 11.1.0-next.0 | 11.1.0-next.3 |
Products include Angular Angular, Angularjs Angularjs.
How do I fix CVE-2021-4231?
Upgrade @angular/core to a fixed version for your release line: 10.2.5, 11.0.5 or 11.1.0-next.3.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2021-4231 being exploited?
There is no known exploitation of CVE-2021-4231 in the wild and no public exploit code.
Other vulnerabilities in unspecified Angular
- CVE-2026-68945 Angular: Cache-Key Ambiguity in HttpTransferCache Leading to Cross-Request Response Reuse and State Poisoning
- CVE-2026-46417 Angular: SSRF via Hostname Hijacking in @angular/platform-server
- CVE-2026-50168 Angular: URL Parser Differential in @angular/platform-server leading to SSRF Allowlist Bypass
- CVE-2026-54266 Angular: Weak 32-Bit Cache Key Hashing in `HttpTransferCache` Leading to Cross-Request Data Leakage and State Poisoning
- CVE-2026-41423 Angular: SSRF via protocol-relative and backslash URLs in Angular Platform-Server
Sources
Also known as CLSA-2026-1775176151, CLSA-2026-1775176154, CLSA-2026-1780707086, CLSA-2026-1783213293, CLSA-2026-1792161091, CLSA-2026-1792161093 and 40 more.