CVE-2025-4087 Unsafe attribute access during XPath parsing

Medium 4.8 Published Updated

Unsafe XPath parsing in Firefox and Thunderbird allows out-of-bounds reads and potential memory corruption, requiring an upgrade to patched versions.

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-4087?

CVE-2025-4087 is a medium-severity memory corruption vulnerability in Mozilla Firefox, published on 29 Apr 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A vulnerability was identified in Thunderbird where XPath parsing could trigger undefined behavior due to missing null checks during attribute access. This could lead to out-of-bounds read access and potentially, memory corruption. This vulnerability was fixed in Firefox 138, Firefox ESR 128.10, Thunderbird 138, and Thunderbird 128.10.

Weakness: CWE-125

Which versions are affected by CVE-2025-4087?

It affects 2 products.

Products include Mozilla Firefox, Mozilla Thunderbird.

How do I fix CVE-2025-4087?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2025-4087 being exploited?

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

All Mozilla Firefox vulnerabilities

Sources

Also known as DEBIAN-CVE-2025-4087, GHSA-3mvr-vp9h-cr29, UBUNTU-CVE-2025-4087.

Is CVE-2025-4087 in your software?

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

Check your SBOMs for free