Skip to content

Reject truncated stored ZIP entry reads - #134499

Merged
alinpahontu2912 merged 2 commits into
mainfrom
copilot/fix-fully-drained-entry-read
Sep 25, 2026
Merged

alinpahontu2912 merged 2 commits into
mainfrom
copilot/fix-fully-drained-entry-read

Conversation

Copilot AI commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #134496

Description

Fully drained ZIP entry reads now fail when EOF arrives before the declared uncompressed length, rather than completing without validating entry integrity.

  • Throw InvalidDataException for early EOF in CrcValidatingReadStream.
  • Update existing sync and async coverage for corrupted entry metadata.

Note

This description was generated by GitHub Copilot.

Copilot AI and others added 2 commits September 23, 2026 07:26
Co-authored-by: alinpahontu2912 <56953855+alinpahontu2912@users.noreply.github.com>
Co-authored-by: alinpahontu2912 <56953855+alinpahontu2912@users.noreply.github.com>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@alinpahontu2912
alinpahontu2912 requested a review from a team September 23, 2026 07:38
@alinpahontu2912
alinpahontu2912 marked this pull request as ready for review September 23, 2026 07:38
Copilot AI lite review requested due to automatic review settings September 23, 2026 07:38
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.

@alinpahontu2912 alinpahontu2912 changed the title Reject truncated ZIP entry reads Reject truncated stored ZIP entry reads Sep 23, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Exercise sync and async paths with their corresponding copy methods.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

This pull request rejects truncated ZIP entry reads with InvalidDataException.

Changes:

  • Detect early EOF before the declared uncompressed length.
  • Update corrupted-entry regression tests.
File Summary
src/​libraries/​System.IO.Compression/​tests/​ZipArchive/​zip_InvalidParametersAndStrangeFiles.cs Updates truncation failure tests.
src/​libraries/​System.IO.Compression/​src/​System/​IO/​Compression/​ZipCustomStreams.cs Validates reads against the declared length.

@alinpahontu2912

Copy link
Copy Markdown
Member

/ba-g failures are unrelated

@alinpahontu2912
alinpahontu2912 merged commit 581440b into main Sep 25, 2026
87 of 89 checks passed
@alinpahontu2912
alinpahontu2912 deleted the copilot/fix-fully-drained-entry-read branch September 25, 2026 07:56
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stored ZIP entries can report successful completion despite truncated data

5 participants