Skip to content

chore(trading-converter): bump SharpCompress 0.34.2 -> 0.48.0 (security GHSA-6c8g-7p36-r338) — Closes #7807 - #7818

Merged
jsboige merged 1 commit into
mainfrom
chore/bump-sharpcompress-7807
Jul 22, 2026
Merged

chore(trading-converter): bump SharpCompress 0.34.2 -> 0.48.0 (security GHSA-6c8g-7p36-r338) — Closes #7807#7818
jsboige merged 1 commit into
mainfrom
chore/bump-sharpcompress-7807

Conversation

@jsboige

@jsboige jsboige commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Bumps SharpCompress 0.34.2 → 0.48.0 in MyIA.Trading.Converter, fixing the known MEDIUM-severity decompression-bomb/crash vulnerability GHSA-6c8g-7p36-r338 (the 0.34.2 baseline emitted NU1902 on every build). Closes #7807.

This is NOT a drop-in bump. SharpCompress 0.48.0 ships a breaking API change: the ReaderFactory.Open / WriterFactory.Open static factory methods were removed (they became OpenReader / OpenWriter, and OpenReader now requires an explicit ReaderOptions). Verified firsthand — bumping the version alone produces two CS0117 ("does not contain a definition for 'Open'") errors at the two SharpCompress call sites. This PR migrates both call sites, so the bump is genuinely verified (not an unverified version-string change).

Why this is stacked on #7813

The project did not compile on origin/main (an unrelated System.Linq.Dynamic.Core interface-rename build break). #7813 fixes that break. This PR is based on #7813's branch so the bump can be build-verified on a compiling tree (the whole point — H.1 forbids shipping an unverified bump). GitHub will auto-retarget this PR to main once #7813 merges; no manual rebase needed.

The migration (CompressionHelper.cs)

The two SharpCompress call sites, migrated to the 0.48.0 API:

// Decompress (line 181): Open(stream) -> OpenReader(stream, ReaderOptions)
using var reader = ReaderFactory.OpenReader(entryStream, new ReaderOptions());

// Compress (line 289): Open(stream, type, opts) -> OpenWriter(stream, type, opts)
using var writer = WriterFactory.OpenWriter(archiveFileStream, objArchiveType, new WriterOptions(objCompressionType));

The entry API (reader.MoveToNextEntry(), reader.Entry.IsDirectory/.Key/.Size, reader.WriteEntryTo(...), writer.Write(...)) is unchanged in 0.48.0 — the build reported ONLY the two Open-rename errors, confirming no further migration is needed.

Validation (H.1 firsthand, isolated worktree stacked on #7813)

$ dotnet build MyIA.Trading.Converter.csproj -c Release   (after migration + 0.48.0)
  3 Avertissement(s)   0 Erreur(s)     Temps écoulé 00:00:01.98
  • 0 errors (baseline pre-fix(trading-converter): repair System.Linq.Dynamic.Core build break (unblocks #7807) #7813 had 1 unrelated error; this PR adds 0).
  • NU1902 (SharpCompress vuln) warning is GONEGHSA-6c8g-7p36-r338 remediated.
  • 0.48.0 API surface verified firsthand via reflection: ReaderFactory.OpenReader(Stream, ReaderOptions), WriterFactory.OpenWriter(Stream, ArchiveType, IWriterOptions), ReaderOptions() ctor, WriterOptions(CompressionType) ctor, IReader/IWriter/IReaderEntry members — all present. net9.0 TFM available.
  • CRLF: 0 CR (LF-only) on both files.

Scope (anti-regression)

Closes #7807 (the dependency bump is delivered + verified).

Grain: MED/chore-security-bump — lane po-2026:CoursIA — prev: MED/fix-functional-bug (c.622 #7813). [Genre change fix-functional-bug→chore-security-bump (G-VAR-3 OK); family .NET/Trading-Converter consecutive (#7813→this) but R6 bans 4×family, 2× OK; distinct sub-systems — LINQ interface rename (#7813) vs SharpCompress dep version+API (this).]

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

…ty, GHSA-6c8g-7p36-r338)

Closes #7807. Fixes the MEDIUM-severity decompression-bomb/crash vulnerability
GHSA-6c8g-7p36-r338 (the 0.34.2 baseline emitted NU1902 on every build).

Not a drop-in bump: 0.48.0 ships a breaking API change — ReaderFactory.Open /
WriterFactory.Open were removed (became OpenReader / OpenWriter; OpenReader now
requires an explicit ReaderOptions). Bumping the version alone yields two
CS0117 errors. This PR migrates both call sites in CompressionHelper.cs:
  decompress: ReaderFactory.Open(stream) -> OpenReader(stream, new ReaderOptions())
  compress:   WriterFactory.Open(s,type,opts) -> OpenWriter(s,type,opts)
The entry API (MoveToNextEntry / Entry.* / WriteEntryTo / Write) is unchanged.

Validation firsthand (stacked on #7813 build-break fix, so tree compiles):
  dotnet build -c Release: 0 errors, 3 warnings, NU1902 vuln warning GONE.
  0.48.0 API surface verified via reflection; net9.0 TFM available.

Stacked on #7813 (MyIA.Trading.Converter did not compile on origin/main pre-fix);
GitHub auto-retargets to main once #7813 merges. Scope +3/-3, 2 files, LF-only.

Co-Authored-By: Claude <noreply@anthropic.com>

@jsboige jsboige left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

[Hermes] COMMENT -- SHA e7c1282

Security bump verify : SharpCompress 0.34.2 -> 0.48.0 remedie GHSA-6c8g-7p36-r338 (decompression-bomb). Ce n'est PAS un bump drop-in -- la PR migre correctement les 2 breaking API changes :

  • ReaderFactory.Open -> OpenReader(stream, ReaderOptions) OK
  • WriterFactory.Open -> OpenWriter(stream, type, WriterOptions) OK

Build verifie firsthand (stacked sur #7813) : 0 erreurs, NU1902 gone. Pas de changement de logique, entry API inchangee. +3/-3 surgical. Security : clean.

Note : #7807 (dependabot) couvrait le bump de version seul ; cette PR est la vraie delivery car elle inclut la migration API requise pour compiler. Stacking sur #7813 OK (sujets independants).

@jsboige
jsboige changed the base branch from fix/trading-converter-linq-build-break to main July 22, 2026 01:52
@jsboige
jsboige merged commit 703a209 into main Jul 22, 2026
jsboige added a commit that referenced this pull request Jul 22, 2026
…udit-clean) (#7829)

Clears the dotnet list --vulnerable audit flag (GHSA-cmhx-cq75-c4mj) flagged on
the transitive System.Text.RegularExpressions 4.3.0. Companion to #7818 —
together they make MyIA.Trading.Converter audit-clean.

HONEST FRAMING — NOT a runtime-exposure fix (verified firsthand G.1): the 4.3.0
transitive is runtime-SHADOWED by the framework-bundled System.Text.RegularExpressions
(9.0.x in Microsoft.NETCore.App). The runtime deps.json (single target
.NETCoreApp v9.0) has ZERO references to it — the standalone package is never
loaded. So this is a NuGet-audit false positive at runtime.

Pinning 4.3.1 (the patched version; restores cleanly, no NU1102 unlike 4.7.x
which is a runtime version not a NuGet package) is DEFENSIVE: silences the
--vulnerable audit gate, and pins the transitive to its patched version at the
source regardless of shadowing. It does not close a live exposure (none existed).

Validation (stacked on #7818): dotnet build 0 errors/3 warnings (unchanged);
dotnet list --vulnerable = "aucun package vulnérable"; CRLF=0.

Scope: +1 line (direct pin), no logic change. See #7818 (real exposure fix).

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to 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.

1 participant