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
Password-protected ZIP archives cannot be extracted if they contain an empty file #132213
An archive written by System.IO.Compression can be read back by System.IO.Compression, and every entry created with a password is encrypted with the requested method regardless of its length.
Actual behavior
Unhandled exception. System.IO.InvalidDataException: The archive entry was compressed using an unsupported compression method.
at System.IO.Compression.ZipArchiveEntry.OpenCore(FileAccess access, ReadOnlySpan`1 password)
at System.IO.Compression.ZipFileExtensions.ExtractToFile(ZipArchiveEntry source, String destinationFileName, Boolean overwrite, ReadOnlySpan`1 password)
at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, Encoding entryNameEncoding, Boolean overwriteFiles, ReadOnlySpan`1 password)
at System.IO.Compression.ZipFile.ExtractToDirectory(String sourceArchiveFileName, String destinationDirectoryName, ZipExtractionOptions options)
Regression?
No. The password support is new in .NET 11 Preview 7, so this has not worked previously.
Known Workarounds
None.
Configuration
Tested on:
.NET SDK 11.0.100-preview.7.26381.103,
runtime 11.0.0-preview.7.26381.103,
linux-x64,
window-x64
Other information
Total Commander, see this empty entry as un-ecrypted and can read w/o issue. 7-zip also sees as un-ecrypted but generates an error on read.
Activity
dotnet-policy-service commentedon Aug 12, 2026
Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.
Fix extraction of password-protected ZIP archives with empty files (#…