Add direct reference to System.Text.Encodings.Web version 4.7.2 due to CVE-2021-26701#4390
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4390 +/- ##
=======================================
Coverage 84.73% 84.74%
=======================================
Files 300 300
Lines 12010 12010
=======================================
+ Hits 10177 10178 +1
+ Misses 1833 1832 -1 |
build/Common.props
Outdated
| <SystemCollectionsImmutablePkgVer>1.4.0</SystemCollectionsImmutablePkgVer> | ||
| <SystemDiagnosticSourcePkgVer>7.0.0</SystemDiagnosticSourcePkgVer> | ||
| <SystemTextJsonPkgVer>4.7.2</SystemTextJsonPkgVer> | ||
| <SystemTextJsonPkgVer>5.0.2</SystemTextJsonPkgVer> |
There was a problem hiding this comment.
I got some advice from the owner of System.Text.Json and System.Text.Encoding.Web:
- The proposed version bump of
System.Text.Jsonmight give trouble to users who rely on certain features that were affected by these breaking changes. - There is much higher confidence that
System.Text.Encoding.Webversion bump is very backward compatible (so we don't expect any surprise due to breaking changes).
Given the above information, I suggest that we don't make the System.Text.Json version bump, instead, we add explicit dependency to System.Text.Encoding.Web and enforce the versions which have fixed the security vulnerabilities.
There was a problem hiding this comment.
@reyang based on your comments, I've reverted the version bump of System.Text.Json and added a direct reference to System.Text.Encodings.Web version 4.7.2 to the following projects:
Exporter.ConsoleExporter.JaegerExporter.Zipkin
Instrumentation.Http.Tests is also referencing System.Text.Json, but apparently it's using version 6.0.5 which references version >6.0.0 of System.Text.Encodings.Web which is not affected by the vulnerability.
I see, however, that there's at least one other library referencing a vulnerable version of System.Text.Encodings.Web:
OpenTelemetry.Instrumentation.AspNetCore->Microsoft.AspNetCore.Http.Abstractions/2.1.1->System.Text.Encodings.Web/4.5.0
In this case I think the solution should be to add a direct reference to System.Text.Encodings.Web/4.5.1 (patched version) as there's no other Microsoft.AspNetCore.Http.Abstractions/2.1.x minor release that fix the issue (actually, latest version, 2.2.0, doesn't fix it either).
If you want me to do the change, please advise how should I proceed as I'm not familiarized with the project's dependency management.
There was a problem hiding this comment.
I see, however, that there's at least one other library referencing a vulnerable version of
System.Text.Encodings.Web:
OpenTelemetry.Instrumentation.AspNetCore->Microsoft.AspNetCore.Http.Abstractions/2.1.1->System.Text.Encodings.Web/4.5.0In this case I think the solution should be to add a direct reference to
System.Text.Encodings.Web/4.5.1(patched version) as there's no otherMicrosoft.AspNetCore.Http.Abstractions/2.1.xminor release that fix the issue (actually, latest version,2.2.0, doesn't fix it either).If you want me to do the change, please advise how should I proceed as I'm not familiarized with the project's dependency management.
@jrebagliatti I suggest that we address this in a separate PR.
@vishweshbankwar Would you look into the OpenTelemetry.Instrumentation.AspNetCore part?
reyang
left a comment
There was a problem hiding this comment.
LGTM. @jrebagliatti would you update the PR title/description to reflect the intention/change? (e.g. System.Text.Encodings.Web)
|
@jrebagliatti, could you please update PR title to reflect current content? |
Kielek
left a comment
There was a problem hiding this comment.
AutoInstrumentation - as we should avoid bumping libraries, the CVE is good explanation to do it.


Fixes #3735
Changes
Added direct reference to package
System.Text.Encodings.Webversion4.7.2to deal with CVE-2021-26701. This overrides dependency path to a vulnerable version:System.Text.Json/4.7.2->SystemText.Encodings.Web/4.7.1.See my comment in #3789.
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes