Repository navigation
Apply insecure HTTP source checks to audit sources during restore - #7514
Merged
Merged
Conversation
Restore only validated regular package sources for insecure HTTP usage, so an HTTP audit source configured without allowInsecureConnections was used silently. This makes audit sources follow the same NU1302/NU1803 behavior as package sources, respecting allowInsecureConnections, matching what 'dotnet list package' already does. Co-authored-by: Copilot <[email protected]>
… 10.0.400 Skip the insecure HTTP check for audit sources when NuGetAudit is disabled, since audit sources are only contacted while auditing. Package sources continue to use the 9.0.100 SdkAnalysisLevel gate while audit sources use 10.0.400. Co-authored-by: Copilot <[email protected]>
…rwise Unlike package sources (which warn below the gate and error at/above it), audit sources only error when the SDK analysis level is 10.0.400 or higher, and emit no diagnostic otherwise. Co-authored-by: Copilot <[email protected]>
All call sites use the existing overload that takes allowInsecureConnections. Co-authored-by: Copilot <[email protected]>
Restore_WithHttpAuditSourceAndAllowInsecureConnectionsFalse_ThrowsError asserted the same NU1302 outcome as Restore_WithHttpAuditSourceSdkAnalysisLevel100400_ThrowsError, which more precisely covers the 10.0.400 gate boundary. Co-authored-by: Copilot <[email protected]>
donnie-msft
reviewed
Jun 26, 2026
donnie-msft
left a comment
Contributor
There was a problem hiding this comment.
Glad to see this change!
This means that the VS Settings should now have "Allow Insecure Connections" and require that to be checked for HTTP audit sources. Do you agree and if so, plan on filing an issue for that?
kartheekp-ms
previously approved these changes
Jun 26, 2026
nkolev92
previously approved these changes
Jun 26, 2026
nkolev92
previously approved these changes
Jun 29, 2026
kartheekp-ms
previously approved these changes
Jun 29, 2026
jebriede
previously approved these changes
Jun 29, 2026
jebriede
left a comment
Contributor
There was a problem hiding this comment.
Approving with suggestions
When the same source URL is configured multiple times (for example as both a package source and an audit source), the insecure HTTP check now reports it only once. Deduplication happens at the point of emission, after the insecure-source guard, so a secure entry with the same URL never suppresses an insecure one. Co-authored-by: Copilot <[email protected]>
zivkan
dismissed stale reviews from jebriede, kartheekp-ms, and nkolev92
via
June 30, 2026 06:47
65c7afe
nkolev92
previously approved these changes
Jun 30, 2026
jebriede
previously approved these changes
Jun 30, 2026
jebriede
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes: NuGet/Home#14962
Description
Restore only validated regular package sources for insecure HTTP usage, so an HTTP audit source configured without
allowInsecureConnectionswas contacted silently, unlike package sources which produce NU1302/NU1803. This makes audit sources respectallowInsecureConnectionstoo, matching whatdotnet list package --vulnerablealready does.Key behavior, with two intentional differences from package sources:
NuGetAuditis disabled.10.0.400or higher and emit no diagnostic below that. The package-source gate stays at9.0.100.PR Checklist
Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.N/A