Skip to content

Improve ZIP encryption method detection #135205

Description

@rzikm

Current code may incorrectly identify encryption method as AES solely based on the presence of the extra field. The format specification says

As for any encrypted file, bit 0 of the "general purpose bit flags" field must be set to 1 in each AES-encrypted file's local header and central directory entry.

Additionally, the presence of an AES-encrypted file in a Zip file is indicated by a new compression method code (decimal 99) in the file's local header and central directory entry, used along with the AES extra data field described below. There is no change in either the version made by or version needed to extract codes.

We should make sure we report AES encryption only if both conditions are satisfied (Encryption bit + compression method in header), and throw if the extra field is absent.

Activity

  1. added
    untriaged
    on Oct 5, 2026
  2. dotnet-policy-service commented on Oct 5, 2026

    @dotnet-policy-service
    Contributor

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

  3. added theissue type on Oct 5, 2026
  4. removed
    untriaged
    on Oct 5, 2026
  5. added this to the 12.0.0 milestone on Oct 5, 2026
  6. self-assigned this
    on Oct 5, 2026
  7. linked a pull request that will close this issueFix ZIP AES encryption method detection #135220on Oct 5, 2026
  8. added a commit that references this issue on Oct 6, 2026
    06b83f7
  9. locked and limited conversation to collaborators on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions