Upgrading Newtonsoft.Json 12 to 13
Breaking12.0.3 → 13.0.4Breaking2Security1New7Changed4Fixed22
SecurityHigh · CVSS 7.5Improper Handling of Exceptional Conditions in Newtonsoft.JsonGHSA-5crp-9r3c-p9vr · CVE-2024-21907 ↗
BreakingUpgrade verdict
2 breaking changes and a security fix.
In plain terms
- The package no longer ships the old portable class library builds, so projects targeting those profiles must move to a supported target.
- Code that caught InvalidCastException for a wrong token type must now catch JsonSerializationException.
- Improper Handling of Exceptional Conditions in Newtonsoft.Json
Must act 3 items need code or config changes
Target frameworks requirement changed in 13.0.2-beta1: .NETFramework2.0, .NETFramework3.5, .NETFramework4.0, .NETFramework4.5, .NETPortable0.0-Profile259, .NETPortable0.0-Profile328, .NETStandard1.0, .NETStandard1.3, .NETStandard2.0 → .NETFramework2.0, .NETFramework3.5, .NETFramework4.0, .NETFramework4.5, .NETStandard1.0, .NETStandard1.3, .NETStandard2.0, net6.0.
What you must change
Breaking2
Removes portable assemblies from the NuGet package.
Throws JsonSerializationException instead of InvalidCastException on mismatched JToken.
JsonSerializationExceptionInvalidCastExceptionJTokenSecurity1
Improper Handling of Exceptional Conditions in Newtonsoft.Json
High · CVSS 7.5