CVE-2024-21907 Improper Handling of Exceptional Conditions in Newtonsoft.Json

High 7.5 Published Updated

Remote attackers can cause a denial of service via stack overflow in Newtonsoft.Json by sending crafted data to the deserialization method.

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

What is CVE-2024-21907?

CVE-2024-21907 is a high-severity denial of service vulnerability in newtonsoft:json.net, published on 3 Jan 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Newtonsoft.Json before version 13.0.1 is affected by a mishandling of exceptional conditions vulnerability. Crafted data that is passed to the JsonConvert.DeserializeObject method may trigger a StackOverflow exception resulting in denial of service. Depending on the usage of the library, an unauthenticated and remote attacker may be able to cause the denial of service condition.

Weakness: CWE-755

Which versions are affected by CVE-2024-21907?

2 open source packages ship an affected version, including Newtonsoft.Json. It affects 1 product.

PackageAffectedFixed in
Newtonsoft.Json NuGetAll versions13.0.1
Newtonsoft.Json NuGetAll versions13.0.1

Products include Newtonsoft Json.net.

How do I fix CVE-2024-21907?

Upgrade Newtonsoft.Json to 13.0.1 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2024-21907 being exploited?

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

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as ECHO-b343-99af-a20d, GHSA-5crp-9r3c-p9vr, UBUNTU-CVE-2024-21907.

Is CVE-2024-21907 in your software?

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

Check your SBOMs for free