CVE-2025-25977 canvg Prototype Pollution vulnerability

Critical 9.8 Published Updated

An attacker can execute arbitrary code via the StyleElement constructor in the canvg JavaScript library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-25977?

CVE-2025-25977 is a critical code injection vulnerability in n/a, published on 10 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

An issue in canvg v.4.0.2 allows an attacker to execute arbitrary code via the Constructor of the class StyleElement.

Weakness: CWE-1321

Which versions are affected by CVE-2025-25977?

4 open source packages ship an affected version, including canvg. It affects 1 product.

PackageAffectedFixed in
canvg npmAll versions3.0.11
canvg npmAll versions3.0.11
canvg npmFrom 4.0.04.0.3
canvg npmFrom 4.0.04.0.3

Products include Canvg Canvg.

How do I fix CVE-2025-25977?

Upgrade canvg to a fixed version for your release line: 3.0.11 or 4.0.3.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-25977 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-25977 exists.

Sources

Also known as DEBIAN-CVE-2025-25977, GHSA-v2mw-5mch-w8c5, UBUNTU-CVE-2025-25977.

Is CVE-2025-25977 in your software?

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

Check your SBOMs for free