Downgrade SIL.BuildTasks to depend on SIL.Core v. 9.0.0 - #88
Conversation
andrew-polk
left a comment
There was a problem hiding this comment.
@andrew-polk reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on tombogle).
ec5eb63 to
b29e9bc
Compare
This re-introduces the build-time dependency on Newtonsoft.Json 11.0.1, which has a real DoS vulnerability: GHSA-5crp-9r3c-p9vr, via deeply-nested JSON causing stack overflow or high CPU/memory (fixed in 13.0.1). This is unfortunate, since Dependabot will continue to flag this in every product that uses SIL.BuildTasks. In the actual shipped-product runtime-risk sense, there is essentially no actual vulnerability. Because the package is IsTool=true, neither SIL.BuildTasks' nor SIL.Core's DLLs get added as compile references or copied into the consumer's bin/publish output — they're only loaded into the MSBuild process itself via UsingTask, on the build machine, at build time. The vulnerable code (Newtonsoft.Json deserializing deeply-nested JSON causing a DoS) never ships inside Bloom's actual installed product, and nothing in SIL.BuildTasks' own tasks (file editing, WiX GUIDs, changelog stamping, NUnit wrapping) feeds untrusted external JSON through it during a build.
So the reasoning doesn't get lost the way the original 7.0.0 -> 17.0.0 bump's motivation did.
Bundling the version cut into this same PR since it needs to ship ASAP to unblock consumers broken by the SIL.Core 17.0.0/Mono.Unix issue.
b29e9bc to
84526d8
Compare
@tombogle Done, and rebased this PR's commits on top of the #81 merge. I tweaked the CHANGELOG to reflect the correct changes at each step. I put the P.S. I also bumped the CHANGELOG date for 3.2.2 from 2026-09-01 to 2026-09-02, since it's still September 1st in parts of the US at the moment but it seems likely that the release won't actually happen until September 2nd or later. |
rmunn
left a comment
There was a problem hiding this comment.
A long-term solution might be to change the Mono.Unix dependency in SIL.Core to only apply to the netstandard2.0 build, and remove that dependency from the net461/net462/net472 build (whichever version of .NET Framework we end up on). But this should work for now.
| @@ -13,7 +13,7 @@ | |||
| <PackageReference Include="Markdig.Signed" Version="0.41.1" /> | |||
| <PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.9.6" /> | |||
There was a problem hiding this comment.
Worth noting that Microsoft.Build.Tasks.Core version 15.9.30 was the last version to build for a .NET Framework 4.6 version. From Microsoft.Build.Tasks.Core version 16 onwards that package depends on .NET Framework 4.7.2. So it's possible we will get some errors when we try to use SIL.BuildTasks from a net461 or net462 build (such as ChorusHub). However, #82 bumped the Microsoft.Build.Tasks.Core dependency from 17 to 18, so the net472 dependency issue was already present before SIL.Core was bumped.
Therefore, I'm not going to suggest downgrading the Microsoft.Build.Tasks.Core dependency down to 15 in this PR, because that .NET Framework version mismatch already existed before the SIL.Core version bump that this PR is intended to address. (The Microsoft.Build.Tasks.Core dependency was introduced in SIL.BuildTasks release 3.1.2-beta0002).
There was a problem hiding this comment.
SIL.BuildTasks' task assemblies aren't compiled into the product; they're loaded via <UsingTask> into whatever process is doing the build (MSBuild.exe or dotnet build's host), which runs on the .NET Framework/SDK installed on the build machine - not on the TargetFramework the project declares. A net461-targeting project can still be built by an MSBuild host running on 4.7.2+/4.8, with no relationship between the two.
So the real risk isn't "does the product target net46x" - it's "is the build machine itself frozen below 4.7.2," which would need an older VS/Build Tools install. Given #82 already bumped Microsoft.Build.Tasks.Core to 18 with no reported breakage, that doesn't seem to be happening in practice. I'd be surprised if any of our build agents/tooling are operating on .net 4.6.x.
(Even then, .NET Framework doesn't always hard-fail at load time just because a dependency was compiled against newer reference assemblies - it can still work unless a not-actually-present API gets called.)
| @@ -13,7 +13,7 @@ | |||
| <PackageReference Include="Markdig.Signed" Version="0.41.1" /> | |||
| <PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.9.6" /> | |||
There was a problem hiding this comment.
SIL.BuildTasks' task assemblies aren't compiled into the product; they're loaded via <UsingTask> into whatever process is doing the build (MSBuild.exe or dotnet build's host), which runs on the .NET Framework/SDK installed on the build machine - not on the TargetFramework the project declares. A net461-targeting project can still be built by an MSBuild host running on 4.7.2+/4.8, with no relationship between the two.
So the real risk isn't "does the product target net46x" - it's "is the build machine itself frozen below 4.7.2," which would need an older VS/Build Tools install. Given #82 already bumped Microsoft.Build.Tasks.Core to 18 with no reported breakage, that doesn't seem to be happening in practice. I'd be surprised if any of our build agents/tooling are operating on .net 4.6.x.
(Even then, .NET Framework doesn't always hard-fail at load time just because a dependency was compiled against newer reference assemblies - it can still work unless a not-actually-present API gets called.)
|
Great idea. I have filed an issue to that effect. |
tombogle
left a comment
There was a problem hiding this comment.
@tombogle resolved 1 discussion.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on andrew-polk).
…asks CHANGELOG note Adds a comment to the generated BingTranslatorService/Reference.cs warning that its hand-added #if NETFRAMEWORK guard will be silently dropped if the WCF proxy is regenerated, reintroducing the net8.0-windows build break it fixes. Points to issue #163 as the real long-term fix (removing this generated proxy entirely). Also corrects the CHANGELOG's SIL.ReleaseTasks security note: 3.3.0 does not cleanly remove a vulnerable dependency as previously stated. It reintroduces a build-time-only, non-exploitable dependency on a vulnerable Newtonsoft.Json via a temporary SIL.Core revert (see sillsdev/SIL.BuildTasks#88). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…asks CHANGELOG note Adds a comment to the generated BingTranslatorService/Reference.cs warning that its hand-added #if NETFRAMEWORK guard will be silently dropped if the WCF proxy is regenerated, reintroducing the net8.0-windows build break it fixes. Points to issue #163 as the real long-term fix (removing this generated proxy entirely). Also corrects the CHANGELOG's SIL.ReleaseTasks security note: 3.3.0 does not cleanly remove a vulnerable dependency as previously stated. It reintroduces a build-time-only, non-exploitable dependency on a vulnerable Newtonsoft.Json via a temporary SIL.Core revert (see sillsdev/SIL.BuildTasks#88). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…e net461 with net462 (#161) * +semver:major Upgrade SIL.ReleaseTasks and System.ServiceModel dependencies; replace net461 with net462 Upgrades SIL.ReleaseTasks (2.5.0 -> 3.2.1) and System.ServiceModel.Http/Primitives (6.2.0 -> 8.1.2) to remove vulnerable transitive dependencies. BREAKING CHANGE: The SIL.ReleaseTasks upgrade transitively raises the resolved version of System.Resources.Extensions, which no longer ships a net461-specific assembly, so net461 is no longer a supported or tested target framework. Replaced net461 with net462 across all projects. Also fixes API incompatibilities in the internal BingTranslator/generated WCF proxy surfaced by the System.ServiceModel upgrade. * Upgrade build/test tooling and pin System.Security.Cryptography.Xml to a patched version Bumps GitVersion.MsBuild, Microsoft.SourceLink.GitHub, JetBrains.Annotations, SIL.ReleaseTasks (3.2.1 -> 3.3.0), and the NUnit/Test SDK packages. All of these are PrivateAssets="all" build/test-only dependencies with no effect on consumers. Also adds a direct System.Security.Cryptography.Xml 8.0.4 reference to L10NSharp.Windows.Forms: System.ServiceModel.Primitives 8.1.2 otherwise resolves a vulnerable 8.0.2 of that package transitively on net8.0-windows, and a direct PackageReference overrides it. No public API or supported-framework changes. * Version 11.0.0 release prep * Document BingTranslator proxy regeneration risk; correct SIL.ReleaseTasks CHANGELOG note Adds a comment to the generated BingTranslatorService/Reference.cs warning that its hand-added #if NETFRAMEWORK guard will be silently dropped if the WCF proxy is regenerated, reintroducing the net8.0-windows build break it fixes. Points to issue #163 as the real long-term fix (removing this generated proxy entirely). Also corrects the CHANGELOG's SIL.ReleaseTasks security note: 3.3.0 does not cleanly remove a vulnerable dependency as previously stated. It reintroduces a build-time-only, non-exploitable dependency on a vulnerable Newtonsoft.Json via a temporary SIL.Core revert (see sillsdev/SIL.BuildTasks#88). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This re-introduces the build-time dependency on Newtonsoft.Json 11.0.1, which has a real DoS vulnerability: GHSA-5crp-9r3c-p9vr, via deeply-nested JSON causing stack overflow or high CPU/memory (fixed in 13.0.1). This is unfortunate, since Dependabot will continue to flag this in every product that uses SIL.BuildTasks.
In the actual shipped-product runtime-risk sense, there is essentially no actual vulnerability. Because the package is IsTool=true, neither SIL.BuildTasks' nor SIL.Core's DLLs get added as compile references or copied into the consumer's bin/publish output — they're only loaded into the MSBuild process itself via UsingTask, on the build machine, at build time. The vulnerable code (Newtonsoft.Json deserializing deeply-nested JSON causing a DoS) never ships inside Bloom's actual installed product, and nothing in SIL.BuildTasks' own tasks (file editing, WiX GUIDs, changelog stamping, NUnit wrapping) feeds untrusted external JSON through it during a build.
This change is