-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to newer Newtonsoft or switch to System.Text.json #2202
Comments
I'm afraid that issue belongs more to NuGet than to Hangfire and is present in other packages as well, for example, see the following question on Stack Overflow: There was the DependencyVersion switch in the early days of NuGet, but I don't know how to use it with The thing is, Hangfire is an abstraction itself (since it's a framework). It does specify the minimum supported version for its dependencies, and actual versions can be specified (Hangfire will work with any of them) in the target application by specifying those dependent packages explicitly: <ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="*" />
</ItemGroup> Unfortunately, if we try to implement this NuGet-based feature in the project itself, we'll be forced to specify only the latest versions almost all of the time, forcing developers into dependency hell problem, where one package requires one version, and another package requires another version of Hangfire.Core or Newtonsoft.Json. UPD. This is a general issue with NuGet, and is tracked in NuGet/Home#5553. |
@allenkepler-finastra Mybe instruct your dev-team to always make sure they run on newest version of all packages their project references. |
I did find that this has been talked about a number of times here. I didn't see it at first and can't find the close issue button. Hopefully you'll consider updated to the minimal "safe" version in 2.0 or moving to System.Text.Json. As far as dependency hell goes, I've been their and done that. I've never had to do much more for newtonsoft than add binding redirects in my older net framework projects. Thanks! |
It can be very challenging to migrate to another serialisation framework, even if we talk about JSON – there can be different ways of expressing the same things (like types using the |
I've tried to migrate my project from |
Yes, and there also can be some advanced configuration of the serialisation process that will be very difficult to match with |
At the very least I would like to be on Newtonsoft 13. |
@jttommy, you can use any Newtonsoft.Json version, starting from 5.0.1 by explicitly referencing this package from your project, please see #2202 (comment). |
@odinserj I hear that, but it's quite frustrating to need to add a reference to an assembly that we ourselves don't need to use just to patch over a security vulnerability introduced by the library. At this point, all users of Newtonsoft JSON from NetStandard2.0 or higher should be using version 13.0.1 or higher, and allowing a minimum version that is well-known to be vulnerable feels a little odd, possibly irresponsible. Just my $0.02 as someone who is now having to go in and add a ton of unnecessary references to Newtonsoft.Json in a bunch of projects that have nothing to do with Json. |
@odinserj instead of making a breaking change it would be way better to provide an extensibility point to allow different serializers (and therefore also custom ones provided by the user). For some projects it might be better to use Newtonsoft.Json (especially existing ones when they use custom json converters), for others System.Text.Json would be better, maybe some want to use XML. Looking at Just as a thought, |
The version of Newtonsoft referenced has known vulnerabilities. Anyone referencing this has to also reference a newer version of Newtonsoft to clear security scans. My solution is Newtonsoft free and I'd rather not add packages for my dev teams to accidentally use. If possible I think it would be better to switch to System.Text.Json or extract serialization in a similar fashion to how database was done.
Thanks
Vulnerability info:
GHSA-5crp-9r3c-p9vr
The text was updated successfully, but these errors were encountered: