You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Zip64 Data Descriptor Bug on Non-Seekable Streams #127389
When writing a ZIP archive to a non-seekable stream, entries that exceed 4GB produce a usable, but malformed archive. The local file header contains no Zip64 signals, but the data descriptor uses 8-byte (Zip64) size fields.
Root Cause
In ZipArchiveEntry.WriteLocalFileHeaderInitialize, the non-seekable branch writes the local header before compression, when sizes are unknown:
This approach:
Sets sizes to 0 (not 0xFFFFFFFF)
Does not call VersionToExtractAtLeast(ZipVersionNeededValues.Zip64)
Does not write a Zip64 extra field
Later, after compression finishes, PrepareToWriteDataDescriptor checks actual sizes:
Impact
Any reader that relies on the local header to determine data descriptor format will misparse the archive, corrupting all subsequent entries. However, most commonly zip files rely on the Central Directory to read sizes, so the true impact is probably low, eben though the local header is not correctly created.
Activity
dotnet-policy-service commentedon Apr 24, 2026
Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.
MihuBot commentedon Apr 24, 2026
I'm a bot. Here are possible related and/or duplicate issues (I may be wrong):
akasakariko commentedon Nov 4, 2026
I'd like to work on this
alinpahontu2912 commentedon Nov 4, 2026
@akasakariko highly appreciate the help, you can ping us when you have a pr ready for review
akasakariko commentedon Nov 4, 2026
@alinpahontu2912 the fix is ready for review in #136963
The PR includes synchronous and asynchronous regression coverage, metadata-only Update preservation, and the Zip64 compatibility impact
alinpahontu2912 commentedon Nov 5, 2026
Thanks @akasakariko, we will take a look
Fix Zip64 data descriptors on non-seekable streams (dotnet#136963)