Skip to content

Can't update vulnerable packages - when the project restore is already failing #14988

Closed
NuGet/NuGet.Client
#7605

Description

@nkolev92

@rcmosher commented on Tue, 16 Jun 2026 10:28:59 GMT
dotnet restore revealed I have a vulnerable package, Marten. I ran the following:

dotnet package update --vulnerable

giving the following error:

error: Restore failed
Unhandled exception: Specified method is not supported.

Then I tried a bare dotnet package update giving the following error:

error: NU1904: Warning As Error: Package 'Marten' 8.24.0 has a known critical severity vulnerability, https://github.com/advisories/GHSA-vmw2-qwm8-x84c
Preview restore with updated packages was not successful. Force mode is not yet available.

This makes it seem like it is failing to to an update because of a vulnerable package, blocking updating from the vulnerable package. I was able to manually change the version in Directory.Packages.props and restore.

Activity

  1. nkolev92 commented on Jul 9, 2026

    @nkolev92
    MemberAuthor

    @marcpopMSFT commented on Thu, 09 Jul 2026 21:05:08 GMT
    @dotnet/nuget-team to take a look. It's sdk cli but nuget owned command.

  2. nkolev92 commented on Jul 9, 2026

    @nkolev92
    MemberAuthor

    @nkolev92 commented on Thu, 09 Jul 2026 21:32:54 GMT
    We can probably just move this to the nuget/home repo.

    @marcpopMSFT Any concerns with that, I can move it.

    @rcmosher What's the SDK version you are using?

  3. nkolev92 commented on Jul 9, 2026

    @nkolev92
    MemberAuthor

    @zivkan commented on Thu, 09 Jul 2026 23:21:44 GMT
    I asked copilot to try to repro the bug, and it was able to with the 10.0.301 SDK, and whatever 10.0.400-preview SDK I have installed.

  4. added
    Functionality:Update
    on Jul 9, 2026
  5. dotnet-policy-service commented on Jul 9, 2026

    @dotnet-policy-service
    Contributor

    @@nkolev92 Issue is missing Type label, remember to add a Type label

  6. added
    missing-required-type
    on Jul 9, 2026
  7. removed
    missing-required-type
    on Jul 9, 2026
  8. nkolev92 commented on Jul 9, 2026

    @nkolev92
    MemberAuthor

    Repro project csproj:

    <Project Sdk="Microsoft.NET.Sdk">
    
      <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="Marten" Version="8.24.0" />
      </ItemGroup>
    
    </Project>

    Key part is TreatWarningsAsErrors, without it, it does work.

  9. nkolev92 commented on Jul 9, 2026

    @nkolev92
    MemberAuthor

    There's no indication this is a regression, reproes with 10.0.300.

  10. added
    Area:ErrorHandling
    on Jul 13, 2026
  11. changed the title [-]Can't update vulnerable packages[/-] [+]Can't update vulnerable packages - when the project restore is already failing[/+] on Jul 13, 2026
  12. added
    Priority:2
    on Jul 13, 2026
  13. added
    Category:Quality Week
    on Jul 24, 2026
  14. self-assigned this
    on Jul 30, 2026
  15. added this to the 7.11 milestone on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area:ErrorHandlingArea:NuGetAuditCategory:Quality WeekFunctionality:UpdatePriority:2Product:dotnet.exeType:Bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions