Insufficient validation of untrusted input in Safe Browsing (CVE-2026-17799)
Chromium's minizip library fails to check that the encryption flag in a ZIP file's Local File Header matches the Central Directory. An attacker could craft a ZIP that Safe Browsing scans as unencrypted ciphertext while standard extraction tools decrypt and write the malware payload to disk.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: Chromium's minizip library fails to verify that the encryption flag in a ZIP file's Local File Header (LFH) matches the Central Directory (CD). An attacker can craft a ZIP archive where the CD indicates the file is unencrypted, causing Safe Browsing to scan raw ciphertext, while standard extraction tools will recognize the LFH encryption flag and successfully decrypt the malicious payload.
Affected files:
third_party/zlib/contrib/minizip/unzip.cthird_party/zlib/google/zip_reader.cc
Estimated timestamp from git blame: 2011-12-12
Summary
A logic flaw in Chromium's minizip library allows an attacker to desynchronize the General Purpose Bit Flag (GPBF) between a ZIP archive's Central Directory (CD) and its Local File Header (LFH). Specifically, minizip trusts the CD for a file's encryption status but fails to verify if this matches the LFH during coherency checks.
By manipulating these headers, an attacker can trick Safe Browsing into extracting and scanning raw ciphertext (which contains no detectable malware signatures) while ensuring that standard OS extraction tools still prompt for a password and decrypt the actual malware payload onto the user's disk.
Technical Details
When Chrome downloads a ZIP file, Safe Browsing uses ZipReader (third_party/zlib/google/zip_reader.cc) to iterate through the entries. ZipReader determines if an entry is encrypted based solely on the CD metadata:
// third_party/zlib/google/zip_reader.cc:332
entry_.is_encrypted = info.flag & 1;
When minizip opens the file (unzOpenCurrentFile3), it performs a coherency check (unz64local_CheckCurrentFileCoherencyHeader) between the LFH and the CD. However, this function has two critical behaviors:
- It never compares the encryption bit (bit 0) of the GPBF between the two headers.
- If the 'Data Descriptor' bit (bit 3) is set in the LFH, it explicitly skips validating the CRC and size fields against the CD:
// third_party/zlib/contrib/minizip/unzip.c:1460
else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0))
err=UNZ_BADZIPFILE;
If the CD indicates the file is unencrypted, minizip does not initialize decryption. It reads the raw ciphertext from the file and calculates the CRC of that ciphertext. When the file is closed (unzCloseCurrentFile), minizip compares the calculated CRC against the expected CRC it read from the CD.
Potential Exploitation Steps
An attacker can construct a malicious ZIP archive as follows:
- Encrypt Payload: Encrypt the malware payload, producing ciphertext. Calculate the CRC of the ciphertext (
CRC_Cipher). - Craft LFH: Create the Local File Header for the entry. Set bit 0 (Encrypted) and bit 3 (Data Descriptor present). Set CRC and sizes to 0.
- Append Data: Append the 12-byte encryption header and the ciphertext immediately after the LFH.
- Append Data Descriptor: Append a Data Descriptor containing the actual CRC of the plaintext payload and the plaintext sizes.
- Craft CD: Create the Central Directory entry. Set bit 0 to
0(Unencrypted) and bit 3 to0. Set the CRC field toCRC_Cipherand the sizes to match the ciphertext.
Resulting Behavior:
- Safe Browsing (minizip): Reads the CD, sees the file is unencrypted, and extracts it without a password. Because bit 3 is set in the LFH,
minizipignores the 0-value CRC/sizes in the LFH. It reads exactly the ciphertext, calculates its CRC, and verifies it against theCRC_Cipherstored in the CD. The extraction succeeds, and Safe Browsing scans the raw ciphertext, finding no malware. - Standard Extraction Tools (e.g., WinRAR, 7-Zip): Prioritize the LFH. They see bit 0 is set, prompt the user for a password, and decrypt the data. Seeing bit 3 is set, they read the appended Data Descriptor and successfully verify the plaintext CRC. The malware is extracted to disk.
Note: These are potential steps based on source code analysis. Our tooling agent does not run code to dynamically verify the exploit.
Suggested Fix
In third_party/zlib/contrib/minizip/unzip.c, update unz64local_CheckCurrentFileCoherencyHeader to strictly enforce that the encryption bit (bit 0) in the Local File Header matches the encryption bit in the Central Directory.
if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK)
err=UNZ_ERRNO;
else if ((err==UNZ_OK) && ((uFlags & 1) != (s->cur_file_info.flag & 1)))
err=UNZ_BADZIPFILE;
This will cause minizip to reject archives where the encryption status is desynchronized, preventing the bypass.
Evaluated with Chrome root at commit: b7d0c4d810da1b31400f198c70d9720fc8f0e5a0
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the coherency check in minizip never compares the encryption bit of the General Purpose Bit Flag between the Local File Header and the Central Directory, so the two headers can disagree about whether an entry is encrypted.
Impact
Safe Browsing could scan only ciphertext and miss the malware, while standard extraction tools could decrypt and write the payload to the user's disk; the report notes the steps are potential and were not dynamically verified.
What the attacker needed
Victim downloads a crafted ZIP; victim opens it with a standard unzip tool; user supplies the password
The fix
The coherency check in minizip should reject archives where the encryption bit in the Local File Header does not match the Central Directory.
How it was found
- Encrypt the malware payload and calculate the CRC of the resulting ciphertext.
- Create a Local File Header with the encrypted bit and the data descriptor bit set, and with CRC and sizes set to zero.
- Append the encryption header and the ciphertext after the Local File Header.
- Append a data descriptor containing the plaintext CRC and plaintext sizes.
- Create a Central Directory entry with the encrypted bit clear, the data descriptor bit clear, and the ciphertext CRC and sizes.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A ZIP file stores information about each file in two places: a local header next to the data and a central directory at the end. Chromium's ZIP reader trusts the central directory to decide whether a file is encrypted, but other tools trust the local header. An attacker can make these disagree so that Chrome scans harmless-looking encrypted bytes while the user's own unzip tool decrypts and saves the real malware.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.