fix(telemetry): upgrade log4net 2.0.16 -> 3.3.0 to resolve GHSA-4f7c-pmjv-c25w (NU1902)#1110
Merged
Merged
Conversation
…pmjv-c25w (NU1902) The .NET 8 SDK NuGet security audit flags log4net 2.0.16 for advisory GHSA-4f7c-pmjv-c25w (moderate severity; vulnerable < 3.3.0). Because the project sets TreatWarningsAsErrors=true, NU1902 becomes a build error and `dotnet restore` fails even with no code change. 3.3.0 is the first patched version; it supports net462/netstandard2.0 so the net472 target remains compatible, and the ILog / LogManager.GetLogger APIs used here are unchanged in log4net 3.x.
chungjac
approved these changes
Jul 1, 2026
ashishrp-aws
approved these changes
Jul 1, 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.
Problem
The
.NET 8SDK runs a NuGet security audit duringdotnet restore, which flags log4net 2.0.16 for advisory GHSA-4f7c-pmjv-c25w (moderate severity; vulnerable< 3.3.0). Becausetelemetry/csharp/AwsToolkit.Telemetry.Events/AwsToolkit.Telemetry.Events.csprojsets<TreatWarningsAsErrors>true</TreatWarningsAsErrors>, theNU1902warning becomes a build error anddotnet restorefails:This started failing with no code change because the NuGet audit reads the GitHub Advisory Database at restore time, and the advisory was published/updated in mid-June 2026.
Solution
One-line dependency bump — upgrade
log4netto 3.3.0, the first version that resolves the advisory:log4netreference undertelemetry/csharp.AwsToolkit.Telemetry.Events.Testsdepends on this project and inheritslog4nettransitively, so it is fixed by the same change.Directory.Packages.props/packages.lock.json/nuget.configexist, so no other file needs updating.net472; log4net 3.3.0 supportsnet462/netstandard2.0. The only log4net usage isILogandLogManager.GetLogger(Type)(inITelemetryLogger.csandMetricDatumExtensionMethods.cs), which are unchanged in log4net 3.x — no source changes required.Testing (verified locally, .NET 8 SDK 8.0.422)
Before (reproduces the failure):
After:
No
NU1902in any restore;log4netresolves to3.3.0.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.