CVE-2021-46871 phoenix_html allows Cross-site Scripting in HEEx class attributes

Medium 6.1 Published Updated

Cross-site scripting vulnerability in Phoenix.HTML allows attackers to inject malicious scripts via HEEx class attributes.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-46871?

CVE-2021-46871 is a medium-severity cross-site scripting vulnerability in n/a, published on 10 Jan 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

tag.ex in Phoenix Phoenix.HTML (aka phoenix_html) before 3.0.4 allows XSS in HEEx class attributes.

Weakness: CWE-79

Which versions are affected by CVE-2021-46871?

6 open source packages ship an affected version, including phoenix_html. It affects 1 product.

PackageAffectedFixed in
phoenix_html HexAll versions3.0.4
phoenix_html HexAll versions3.0.4
phoenix_html HexAll versions3.0.4
phoenix_html HexAll versions3.0.4
phoenix_html npmAll versions3.0.4
phoenix_html npmAll versions3.0.4

Products include Phoenixframework Phoenix Html.

How do I fix CVE-2021-46871?

Upgrade phoenix_html to 3.0.4 or later.

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-46871 being exploited?

There is no known exploitation of CVE-2021-46871 in the wild and no public exploit code.

Sources

Also known as GHSA-5g2h-9x5v-5h3x, GHSA-j3gg-r6gp-95q2.

Is CVE-2021-46871 in your software?

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

Check your SBOMs for free