🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #7097

Bug#1095269: bug#1095269: root cause found, forwarded upstream (XADMaster#202)

#7097
From: ZenWalker
Date: Tue, 01 Dec 2026 23:00
42 lines
3628 bytes
Hi,

I have reported this upstream with a full analysis:

  https://github.com/MacPaw/XADMaster/issues/202
  "[LSAR/UNAR] WinZip-AES encrypted zips always fail with 'Missing or
   wrong password', even with the correct password (SHA-1 miscompiled
   at -O2 by strict-aliasing UB in Crypto/sha.c)"

Short version of the root cause: XADMaster/Crypto/sha.c type-puns
uint8_t
buffers through uint32_t*/uint64_t* pointers (strict-aliasing UB). With
GCC 14.2 at -O2 (trixie's default, and what Makefile.linux uses), the
generated SHA-1 code computes wrong hashes. The WinZip-AES KDF is
PBKDF2-HMAC-SHA1, so the 2-byte password verification value never
matches and unar raises "Missing or wrong password" for EVERY password,
including the correct one.

Proof with unmodified upstream sources, gcc 14.2:

  gcc -O2:  SHA1("abc") = 7f9f882da937eb765c197e9edb3f73aad3243060
            (expected a9993e364706816aba3e25717850c26c9cd0d89d)
            HMAC-SHA1 RFC 2202 TC2 also wrong
  gcc -O0 / -O1 / -O2 -fno-strict-aliasing: all correct

So this affects every WinZip-AES zip on trixie builds (7z -mem=AES128/
AES192/AES256, WinZip's AES defaults, pyzipper, ...), not just archives
created by 7z; ZipCrypto zips and RAR5 archives are unaffected (RAR5's
KDF is PBKDF2-HMAC-SHA256 and SHA-256 still compiles correctly with
this GCC). Encrypted pre-RAR5 RARs use the same broken SHA-1 code and
are presumably affected too.

Until upstream fixes it, a stopgap for the Debian build would be
compiling Crypto/ with -fno-strict-aliasing; there is also a proper
patch attached to the upstream issue that removes the type-punning
from the SHA-1 paths (verified against the SHA-1/HMAC test vectors and
against a WinZip-AES password verification value).

Given that this breaks extraction of all WinZip-AES zips with any
password, you may want to reconsider the severity.

Thanks.
Technical Details
Message-ID: <O5EZk-fqiK-15@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
References: <Kd5qN-eMwX-7@gated-at.bofh.it>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!bofh.it!news.nic.it!robomod
From: ZenWalker <scow@riseup.net>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1095269: bug#1095269: root cause found, forwarded upstream (XADMaster#202)
Date: Wed, 02 Dec 2026 00:00:02 +0100
Message-ID: <O5EZk-fqiK-15@gated-at.bofh.it>
References: <Kd5qN-eMwX-7@gated-at.bofh.it>
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Tue Dec  1 22:58:08 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: -1.451
Reply-To: ZenWalker <scow@riseup.net>, 1095269@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: pkg-gnustep-maintainers@lists.alioth.debian.org
X-Debian-Pr-Message: followup 1095269
X-Debian-Pr-Package: unar
X-Debian-Pr-Keywords: confirmed
X-Debian-Pr-Source: unar
X-Riseup-User-ID: 4784F51372A5167523D938026B4F3F3997D6AA60A9B226E2ECCAA78DB8AC26DC
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006418
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 42
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Tue, 01 Dec 2026 22:57:01 +0000
X-Original-Message-ID: <d29ce5b569e8f4b369c1ecca6d6db0bf@riseup.net>
X-Original-References: <173883006278.465476.4064970415593345661.reportbug@debian.debian>