Commit 48bc77a
fix(NPOI): pin 传递漏洞 System.Text.Encodings.Web + Cryptography.Xml
阶段 2 步骤 6:治理 NPOI 2.8.0 传递依赖漏洞。
NPOI 2.8.0 nuspec 强制 System.Security.Cryptography.Xml >= 8.0.2(8.0.2 有 GHSA-w3x6-4m5h-cxqf High),pin 到 8.0.3(fix 补丁)。
Core 同步:netstandard2.0/2.1 路径经 RazorEngine 拉 System.Text.Encodings.Web 4.7.1(Critical),加 TFM 条件 PackageReference 提升到 props 指定的 8.0.0。
实现要点:
- CPM 硬约束:csproj 不能写 Version,版本必须在 Directory.Packages.props
- props 加 PackageVersion System.Security.Cryptography.Xml 8.0.3 + System.Text.Encodings.Web 8.0.0
- Excel.NPOI.csproj:加顶层 PackageReference(无 Version)强制 NuGet 解析
- Core.csproj:ns2.x 条件 ItemGroup 单独加 System.Text.Encodings.Web 引用,仅 ns2.x 路径需要(net6+ 已无此漏洞传递)
验证:dotnet list package --vulnerable 对两个项目输出'没有易受攻击的包'。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 36b6184 commit 48bc77a
3 files changed
Lines changed: 22 additions & 0 deletions
File tree
- src
- Magicodes.ExporterAndImporter.Core
- Magicodes.IE.Excel.NPOI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
12 | 23 | | |
0 commit comments