CVE-2021-4231 Angular Comment cross site scripting

Low 3.5 Published Updated

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.

PackageAffectedFixed in
@angular/core npmAll versions10.2.5
@angular/core npmAll versions10.2.5
@angular/core npmFrom 11.0.011.0.5
@angular/core npmFrom 11.0.011.0.5
@angular/core npmFrom 11.1.0-next.011.1.0-next.3
@angular/core npmFrom 11.1.0-next.011.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.

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.

Is CVE-2021-4231 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free