Skip to content

Fix Dependabot alerts, modernize sample dependencies, drop EOL SDK installs - #1357

Merged
Tomer Rosenthal (torosent) merged 1 commit into
mainfrom
torosent/fix-dependabot-alerts
May 21, 2026
Merged

Fix Dependabot alerts, modernize sample dependencies, drop EOL SDK installs#1357
Tomer Rosenthal (torosent) merged 1 commit into
mainfrom
torosent/fix-dependabot-alerts

Conversation

@torosent

@torosentTomer Rosenthal (torosent) commented May 21, 2026

Copy link
Copy Markdown
Member

Summary

Three related cleanups for the samples/ projects and the public PR validation pipeline:

  1. Fix all 5 open Dependabot security alerts (transitive deps in samples).
  2. Modernize outdated sample dependencies (13 package bumps + 1 deprecated package replacement).
  3. Remove EOL .NET Core 2.1 / 3.1 SDK install steps from the PR validation pipeline (recurring TLS failures as Microsoft retires EOL release infrastructure).

Dependabot alerts fixed

#AdvisoryPackageBefore → AfterAffected sampleFix
36GHSA-cmhx-cq75-c4mjSystem.Text.RegularExpressions4.3.0 → 4.3.1ManagedIdentity v1.xExplicit pin
35GHSA-7jgj-8wvc-jh57System.Net.Http4.3.0 → 4.3.4ManagedIdentity v1.xExplicit pin
31GHSA-8g4q-xg66-9fp4System.Text.Json6.0.0 → 10.0.8ApplicationInsightsSampleExplicit pin
28GHSA-rxg9-xrhp-64gjSystem.Drawing.Common4.7.0 → 6.0.0ApplicationInsightsSampleTransitive via WorkerService upgrade
25GHSA-cmhx-cq75-c4mjSystem.Text.RegularExpressions4.3.0 → 4.3.1Correlation.SamplesExplicit pin

System.Drawing.Common is resolved by bumping Microsoft.ApplicationInsights.WorkerService from 2.21.0 → 2.23.0, which brings Drawing.Common 6.0.0 transitively — outside the only known vulnerable ranges (4.x < 4.7.2 and 5.x < 5.0.3). No explicit reference or CPM entry is needed.

Sample dependency modernization (Directory.Packages.props)

PackageBeforeAfter
Azure.Identity1.18.01.21.0
Azure.Monitor.OpenTelemetry.Exporter1.6.01.8.1
Microsoft.ApplicationInsights.DependencyCollector2.12.02.23.0
Microsoft.ApplicationInsights.WorkerService2.21.02.23.0
Microsoft.Extensions.Azure1.7.41.14.0
Microsoft.Extensions.Configuration3.1.3210.0.8
Microsoft.Extensions.Configuration.Json3.1.3210.0.8
Microsoft.Extensions.Hosting6.0.110.0.8
OpenTelemetry.Exporter.Console1.1.01.15.3
OpenTelemetry.Exporter.Zipkin (deprecated)replaced with OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.3
System.Text.Json10.0.310.0.8
Vio.DurableTask.Hosting2.2.12.2.17
ncrontab (net48)1.0.03.4.0

Code changes

  • samples/DistributedTraceSample/OpenTelemetry/Program.cs: migrate deprecated AddZipkinExporter()AddOtlpExporter() (Zipkin exporter package replaced).
  • samples/Correlation.Samples/TelemetryActivator.cs: migrate from obsolete TelemetryConfiguration.InstrumentationKey to ConnectionString (APPLICATIONINSIGHTS_CONNECTION_STRING) with backward-compat fallback to the legacy APPINSIGHTS_INSTRUMENTATIONKEY env var.
  • samples/DistributedTraceSample/ApplicationInsights/ApplicationInsightsSample.csproj: removed stale System.Diagnostics.DiagnosticSource VersionOverride="7.0.2" workaround (no longer needed once Hosting is on 10.x).

CI fix (eng/templates/build-steps.yml)

Removed the two UseDotNet@2 steps that installed .NET Core 2.1 and .NET Core 3.1 SDKs. Both runtimes are long EOL (Aug 2021 and Dec 2022); no project in the repo targets netcoreapp2.x or netcoreapp3.x. The 2.1 release-index endpoint has become unreliable, producing intermittent TLS handshake failures that fail the whole PR validation pipeline (e.g., build #279849 DTFxCoreValidate Validate 11):

##[error]Failed to download or parse releases-index.json with error:
write EPROTO ... tlsv1 alert internal error ... SSL alert number 80

Builds use VSBuild/MSBuild, and the only SDK actually required is .NET 8 for the net8.0 test targets. The official build pipeline (eng/ci/official-build.yml) doesn't install these SDKs either.

Intentionally not modernized

  • Microsoft.Azure.DurableTask.AzureStorage 1.17.3 in ManagedIdentity v1.x (educational pin to demonstrate v1.x usage).
  • EnterpriseLibrary.SemanticLogging / CommandLineParser 1.x in DurableTask.Samples (abandoned / breaking API changes).
  • Microsoft.ApplicationInsights 2.x → 3.x (major version, out of scope).

Verification

  • ✅ All 6 sample projects, 4 src libraries, and 3 test projects build with 0 warnings, 0 errors.
  • dotnet list package --include-transitive on each affected sample confirms no vulnerable transitive versions remain.

CopilotAI review requested due to automatic review settings May 21, 2026 15:29

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Dependabot security alerts in the repository’s sample projects by ensuring patched versions of vulnerable transitive dependencies are resolved under Central Package Management (CPM).

Changes:

  • Add explicit PackageReference entries in affected sample .csproj files to force resolution of patched transitive packages.
  • Add a CPM PackageVersion entry for System.Drawing.Common at 4.7.3 so samples can reference it without per-project versioning.
  • Preserve the older Microsoft.Azure.DurableTask.AzureStorage 1.x dependency in the Managed Identity sample while overriding its vulnerable transitives.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

FileDescription
Directory.Packages.propsAdds CPM version entry for System.Drawing.Common to support patched dependency resolution.
samples/Correlation.Samples/Correlation.Samples.csprojAdds explicit reference to System.Text.RegularExpressions to override a vulnerable transitive.
samples/DistributedTraceSample/ApplicationInsights/ApplicationInsightsSample.csprojAdds explicit references to System.Drawing.Common and System.Text.Json to override vulnerable transitives.
samples/ManagedIdentitySample/DTFx.AzureStorage v1.x/ManagedIdentity.AzStorageV1.csprojAdds explicit references to System.Net.Http and System.Text.RegularExpressions to override vulnerable transitives from older dependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadDirectory.Packages.props Outdated
@torosent
Tomer Rosenthal (torosent)force-pushed the torosent/fix-dependabot-alerts branch from 21d33e6 to a36db78CompareMay 21, 2026 15:54
@torosent

Copy link
Copy Markdown
MemberAuthor

Addressed the review feedback and broadened the scope per request:

  • System.Drawing.Common pin removed. Instead, bumped Microsoft.ApplicationInsights.WorkerService 2.21.0 → 2.23.0, which transitively brings System.Drawing.Common to 6.0.0 — outside the only known vulnerable ranges (4.x < 4.7.2 and 5.x < 5.0.3). No explicit reference or new CPM entry needed.
  • Sample dependencies modernized: Microsoft.Extensions.* (Hosting/Configuration/Configuration.Json) → 10.0.8, Microsoft.Extensions.Azure → 1.14.0, Azure.Identity → 1.21.0, Azure.Monitor.OpenTelemetry.Exporter → 1.8.1, Microsoft.ApplicationInsights.DependencyCollector → 2.23.0, OpenTelemetry.Exporter.Console → 1.15.3, Vio.DurableTask.Hosting → 2.2.17, ncrontab → 3.4.0, System.Text.Json → 10.0.8.
  • Code changes for deprecated APIs:
    • OpenTelemetrySample/Program.cs: migrated from deprecated AddZipkinExporter() to AddOtlpExporter() (Zipkin exporter package replaced).
    • Correlation.Samples/TelemetryActivator.cs: migrated from obsolete TelemetryConfiguration.InstrumentationKey to ConnectionString (APPLICATIONINSIGHTS_CONNECTION_STRING) with a backward-compat fallback to the legacy env var.
  • Cleanup: removed stale System.Diagnostics.DiagnosticSource VersionOverride="7.0.2" workaround (no longer needed once Hosting is on 10.x).

Intentionally not modernized:

  • Microsoft.Azure.DurableTask.AzureStorage 1.17.3 in ManagedIdentity v1.x (educational pin — sample exists to demo v1.x).
  • EnterpriseLibrary.SemanticLogging and CommandLineParser 1.x in DurableTask.Samples (abandoned / breaking API changes).
  • Microsoft.ApplicationInsights 2.x → 3.x (major version, out of scope).

Verified: all 6 samples + 4 src libraries + 3 test projects build with 0 warnings, 0 errors, and dotnet list package --include-transitive confirms no vulnerable transitives remain in any sample graph.

The failing DTFxCoreValidate Validate 3 check on the previous push was 1 of 13 parallel test shards for DurableTask.Core.Tests.dll. This PR does not touch DurableTask.Core or its tests; it was almost certainly flaky. New checks should be running now.

CopilotAI review requested due to automatic review settings May 21, 2026 16:10
@torosent
Tomer Rosenthal (torosent)force-pushed the torosent/fix-dependabot-alerts branch from a36db78 to d47f7e1CompareMay 21, 2026 16:10
@torosent

Copy link
Copy Markdown
MemberAuthor

CI fix: removed EOL .NET Core 2.1 / 3.1 SDK installs from the PR validation pipeline

The previously failing DTFxCoreValidate Validate 11 shard on build #279849 was not a test failure or a flaky shard — it failed in the Use the .NET Core 2.1 SDK (required for build signing) task with:

##[error]Failed to download or parse releases-index.json with error:
write EPROTO ... tlsv1 alert internal error ... SSL alert number 80

Why the 2.1 / 3.1 installs are safe to drop

  • .NET Core 2.1 has been EOL since Aug 2021 and 3.1 since Dec 2022. Microsoft is rotating/retiring the TLS infrastructure for the old release indexes, which is why this task started failing intermittently (the nightly main build at 05:38 UTC succeeded; this PR build at 16:00 UTC failed on the exact same step).
  • No project in the repo targets netcoreapp2.x or netcoreapp3.x. Verified by grep across the entire tree. All libraries target netstandard2.0, all .NET Framework projects target net48/net472, and all test/sample projects targeting modern Core use net8.0.
  • The "required for build signing" comment is stale. Signing is performed by sign-files.yml@eng invoked from eng/ci/official-build.yml, which does not install .NET Core 2.1 either. Builds use VSBuild (MSBuild), not dotnet build, so the only SDK actually required is .NET 8 for the net8.0 test targets.

Change

eng/templates/build-steps.yml: removed the two UseDotNet@2 steps for 2.1.x and 3.1.x; kept the 8.0.x install.

CI is re-running on d47f7e1.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment threadDirectory.Packages.props
Comment threadsamples/DistributedTraceSample/OpenTelemetry/Program.cs
Comment threadDirectory.Packages.props
@torosent
Tomer Rosenthal (torosent)force-pushed the torosent/fix-dependabot-alerts branch from d47f7e1 to 008f203CompareMay 21, 2026 16:28
@torosentTomer Rosenthal (torosent) changed the title Fix Dependabot security alerts in sample projectsFix Dependabot alerts, modernize sample dependencies, drop EOL SDK installsMay 21, 2026
CopilotAI review requested due to automatic review settings May 21, 2026 16:36

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@torosent
Tomer Rosenthal (torosent)force-pushed the torosent/fix-dependabot-alerts branch 2 times, most recently from 5295d08 to 9c2853eCompareMay 21, 2026 17:25
CopilotAI review requested due to automatic review settings May 21, 2026 17:25

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment threadeng/templates/build-steps.yml Outdated
…stalls
Resolves all 5 open Dependabot alerts (all transitive deps in samples/),
modernizes outdated sample dependencies, and removes EOL .NET Core SDK
installs from the public PR validation pipeline.
Dependabot alerts fixed (all in samples/):
- GHSA-cmhx-cq75-c4mj System.Text.RegularExpressions 4.3.0 -> 4.3.1
- GHSA-7jgj-8wvc-jh57 System.Net.Http 4.3.0 -> 4.3.4
- GHSA-8g4q-xg66-9fp4 System.Text.Json 6.0.0 -> 10.0.8
- GHSA-rxg9-xrhp-64gj System.Drawing.Common 4.7.0 -> 6.0.0
(eliminated via WorkerService 2.21 -> 2.23 upgrade; no explicit pin)
Sample dependency modernization (Directory.Packages.props):
- Azure.Identity 1.18.0 -> 1.21.0
- Azure.Monitor.OpenTelemetry.Exporter 1.6.0 -> 1.8.1
- Microsoft.ApplicationInsights.DependencyCollector 2.12.0 -> 2.23.0
- Microsoft.ApplicationInsights.WorkerService 2.21.0 -> 2.23.0
- Microsoft.Extensions.Azure 1.7.4 -> 1.14.0
- Microsoft.Extensions.Configuration 3.1.32 -> 10.0.8
- Microsoft.Extensions.Configuration.Json 3.1.32 -> 10.0.8
- Microsoft.Extensions.Hosting 6.0.1 -> 10.0.8
- OpenTelemetry.Exporter.Console 1.1.0 -> 1.15.3
- OpenTelemetry.Exporter.Zipkin (deprecated) replaced by
OpenTelemetry.Exporter.OpenTelemetryProtocol 1.15.3
- System.Text.Json 10.0.3 -> 10.0.8
- Vio.DurableTask.Hosting 2.2.1 -> 2.2.17
- ncrontab (net48) 1.0.0 -> 3.4.0
Code changes:
- OpenTelemetrySample/Program.cs: migrate deprecated AddZipkinExporter
to AddOtlpExporter.
- Correlation.Samples/TelemetryActivator.cs: migrate from obsolete
TelemetryConfiguration.InstrumentationKey to ConnectionString
(APPLICATIONINSIGHTS_CONNECTION_STRING) with backward-compat fallback
to the legacy APPINSIGHTS_INSTRUMENTATIONKEY env var.
CI fix (eng/templates/build-steps.yml):
- Remove the .NET Core 2.1 and 3.1 SDK install steps. Both runtimes are
long EOL (2021 and 2022); no project in the repo targets netcoreapp2.x
or netcoreapp3.x, and the 2.1 release-index endpoint has become
unreliable, causing intermittent TLS failures that fail the entire PR
validation pipeline (e.g., build #279849 'DTFxCoreValidate Validate 11').
Builds use VSBuild/MSBuild and the only SDK actually required is .NET 8
for the net8.0 test targets.
Intentionally not modernized:
- Microsoft.Azure.DurableTask.AzureStorage 1.17.3 in ManagedIdentity v1.x
(educational pin to demonstrate v1.x usage).
- EnterpriseLibrary.SemanticLogging, CommandLineParser 1.x in
DurableTask.Samples (abandoned / breaking API changes).
- Microsoft.ApplicationInsights 2.x -> 3.x (major version, out of scope).
Verified: all 6 sample projects, all 4 src libraries, and all 3 test
projects build with 0 warnings and 0 errors. 'dotnet list package
--include-transitive' confirms no vulnerable transitive versions remain
in any sample's resolved graph.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@torosent
Tomer Rosenthal (torosent)force-pushed the torosent/fix-dependabot-alerts branch from 9c2853e to acac1dcCompareMay 21, 2026 17:50
@torosent
Tomer Rosenthal (torosent) merged commit d08f0d5 into mainMay 21, 2026
47 checks passed
@torosent
Tomer Rosenthal (torosent) deleted the torosent/fix-dependabot-alerts branch May 21, 2026 18:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@torosent@nytian