-
Notifications
You must be signed in to change notification settings - Fork 275
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
Targeting Net8.0 (Isolated) and using Durable Functions Orchestration within an Azure Functions project causes NuGet to restore old vulnerable packages #2978
Comments
@mikejohnstonPremierinc have you tried using latest durable extension |
Transferred to azure-functions-durable-extension to track this. With the current SDK the resolution is for the worker extension owners to release versions that bring in a WebJobs extension with transitive CVE's addressed. |
@jviau I have not. Can you tell me the exact steps to try, then I will reply if it worked? Thanks! |
@mikejohnstonPremierinc update the line |
@jviau I have now tried this, and this did not work. |
@jviau I have a direct ticket with the Product Group team from Microsoft. Below is what they said. If this is the case, then how are vulnerable dependencies automatically addressed in a situation like this?
|
Is this your root issue, that these other packages were downloaded? This behavior is how nuget is designed. It is not owned by the durable nor functions team. Nuget will first download all packages in the transitive closure, but it will ultimately only include one copy of that in your final build output. |
@jviau This is not how NuGet is designed. Please read this stating that when a user adds a direct dependency to the .csproj file, it should NOT download any other version. For other projects, this is what I see occurring and there is no issue with other projects. For this specific Functions project, this is NOT what I am seeing |
You are not comparing the same scenarios. Your console app declares only a single Newtonsoft.Json package. Your function app has a large package closure, where different packages have their own dependency chain. These various dependency chains may point to differing versions of Newtonsoft.Json. The default nuget resolving will download all of these packages and cache them locally. Then unification is performed, reducing these conflicting asks of Newtonsoft.Json versions down to a single version (which in this case is most likely 13.0.1). The linked issue mentions using
There is a second project in play with dotnet isolated function apps: |
@mikejohnstonPremierinc I'll include more samples /docs when that PR is checked. But the gist is you will add an msbuild property to your app and then use a command we provide to generate the initial |
@jviau Can you link me to the sample and docs so I can implement the direct reference to |
Description
NuGet is restoring non-targeted old versions of packages for this specific azure functions project.
For example, if I add
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
to my .csproj file, NuGet should ONLY restore13.0.3
.Instead, it is restoring
9.0.1
,10.0.1
,10.0.2
,11.0.2
13.0.1
Cause
I originally thought the cause was bug 13943. 13943 bug was first seen in the new version of the NuGet Dependency Resolver that came packaged with the new version of Visual Studio.
I implemented the workaround for 13943. The workaround is to use the legacy resolver, but my issue persisted. Old packages were still being restored.
I then downgraded Visual Studio to earlier versions, and my issue still persisted.
I posted a bug on the NuGet repository myself, as shown Here. But a developer told me that the issue is not caused by a bug within the NuGet code, but instead it is a bug within the azure functions code, as explained Here.
Specifically:
Workarounds
There are no known workarounds
Steps to reproduce
Azure Functions
. Choose it and click Next.NET 8.0 Isolated (Long Term Support)
andDurable Functions Orchestration
C:\Users\username\.nuget\packages\newtonsoft.json
. You will notice that NuGet downloaded versions9.0.1
,10.0.1
,10.0.2
,11.0.2
13.0.1
C:\Users\username\.nuget\packages\newtonsoft.json
. The folder should now be empty.<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
The text was updated successfully, but these errors were encountered: