Create Directory.build.props with the following content:
<Project>
<PropertyGroup>
<NuGetAudit>false</NuGetAudit>
</PropertyGroup>
</Project>
This file is searched by msbuild upward from project/solution dir once, so if you already have one then just modify it as above.
Source: https://improveandrepeat.com/2024/11/how-to-disable-the-nuget-audit-check-in-visual-studio-17-12/