Improper state validation in Safebrowsing (CVE-2026-87532)
A logic flaw in Chromium's Safe Browsing RAR analyzer causes it to treat an early extraction abort as a successful scan when an archive declares a dictionary size above the internal 4 GB limit. An attacker could craft a RAR archive so that malicious files after the oversized entry are never inspected, allowing the download to proceed without a warning.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
Project Fortify, 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: A logic flaw in Chromium's Safe Browsing RAR analyzer allows a crafted RAR archive to completely bypass scanning. By declaring a large dictionary size that exceeds the 4 GB internal extraction limit, the analyzer terminates extraction early but erroneously reports a valid scan status. This allows any subsequent malicious payloads in the archive to completely escape detection.
Affected files:
third_party/unrar/src/extract.cppthird_party/unrar/google/unrar_wrapper.ccchrome/utility/safe_browsing/rar_analyzer.cc
Estimated timestamp from git blame: 2024-05-21
Potential Safe Browsing RAR Scan Bypass via Crafted File Headers
Within Chromium's Safe Browsing RAR analyzer, a potential logic flaw in handling large dictionary sizes (FileHead.WinSize) can be exploited to terminate archive parsing prematurely while still reporting a successful analysis (ArchiveAnalysisResult::kValid). This enables subsequent files inside the archive (which may contain malicious payloads) to completely bypass Safe Browsing inspection.
Root Cause Analysis
When a RAR5/RAR7 archive file header declares a dictionary size (FileHead.WinSize) exceeding the default limit of 4 GB (WinSizeLimit), CmdExtract::ExtractCurrentFile() invokes CheckWinLimit(), which in turn calls uiDictLimit():
// third_party/unrar/src/extract.cpp
bool CmdExtract::CheckWinLimit(Archive &Arc,std::wstring &ArcFileName) {
if (Arc.FileHead.WinSize<=Cmd->WinSizeLimit || Arc.FileHead.WinSize<=Cmd->WinSize)
return true;
if (uiDictLimit(Cmd,ArcFileName,Arc.FileHead.WinSize,Max(Cmd->WinSizeLimit,Cmd->WinSize)))
Cmd->WinSizeLimit=Arc.FileHead.WinSize;
else {
ErrHandler.SetErrorCode(RARX_FATAL);
Arc.SeekToNext();
return false;
}
return true;
}
Since Chromium compiles unrar with the SILENT macro defined, the uiDictLimit implementation in third_party/unrar/src/uisilent.cpp unconditionally returns false:
// third_party/unrar/src/uisilent.cpp
bool uiDictLimit(CommandData *Cmd,const std::wstring &FileName,uint64 DictSize,uint64 MaxDictSize) {
return false; // Stop extracting.
}
Consequently, CheckWinLimit returns false, causing CmdExtract::ExtractCurrentFile to return false early (at third_party/unrar/src/extract.cpp:712).
An attacker can easily craft a dictionary size that is valid according to the RAR specification (which supports up to 64 GB via UNPACK_MAX_DICT) but exceeds Chromium's internal 4 GB threshold. For instance, setting CompInfo to 0x4001 inside a RAR7 file header declares an 8 GB dictionary size. This bypasses the validation in arcread.cpp but triggers the early abort in CheckWinLimit.
Error Propagation Failure
When ExtractCurrentFile fails, the extraction loop in RarReader::ExtractNextEntry (third_party/unrar/google/unrar_wrapper.cc) terminates early and returns false:
bool RarReader::ExtractNextEntry() {
write_error_ = false;
bool success = true, repeat = true;
while (success || repeat) {
...
success = extractor_->ExtractCurrentFile(*archive_, header_size, repeat);
...
if (success) {
return true;
}
...
}
return false; // Returns false because success is false.
}
Crucially, in RarAnalyzer::ResumeExtraction (chrome/utility/safe_browsing/rar_analyzer.cc), the analyzer loop interprets ExtractNextEntry() == false as having successfully reached the end of the archive (EOF), without verifying if an extraction error occurred:
bool RarAnalyzer::ResumeExtraction() {
while (reader_.ExtractNextEntry()) {
...
}
if (reader_.HasWriteError()) {
results()->analysis_result = ArchiveAnalysisResult::kDiskError;
results()->success = false;
return false;
}
...
results()->success = true;
results()->analysis_result = ArchiveAnalysisResult::kValid;
return true;
}
Because write_error_ remains false (as no write/disk error occurred), the entire analyzer marks the scan as successful (ArchiveAnalysisResult::kValid, success = true). Any files stored after the large dictionary entry in the RAR archive are completely skipped and ignored during inspection, while the scan is reported as fully valid.
At the same time, standard desktop extraction utilities (like 64-bit WinRAR or 7-Zip) running on a user's machine do not have this rigid, silent 4 GB limit and will successfully unpack all files in the archive (including any subsequent malicious binaries).
Potential Step-by-Step Reproduction Flow
(Please note: the following steps are based on static analysis of the source code. Our tooling agent does not have the ability to compile or run the code dynamically to verify with an active exploit POC.)
- Archive Construction: Construct a sequential RAR5/RAR7 archive containing:
- Entry 0:
readme.txt(a benign text file). - Entry 1:
dummy.bin(a crafted file header withCompInfo = 0x4001, declaring an 8 GB dictionary size). - Entry 2:
evil.exe(the malicious payload).
- Entry 0:
- Download: Download this RAR archive in Google Chrome.
- Safe Browsing Scan: Chrome sends the archive to the sandboxed utility process for analysis via
RarAnalyzer. - Early Exit: Extraction fails on
dummy.binbecause of the 8 GB dictionary size.RarAnalyzerinterprets the resultingfalsefromExtractNextEntryas successful completion of the archive, completely skipping overevil.exe. - Clean Result: Safe Browsing reports a valid scan with
readme.txtas the only content, permitting the download without any warning.
Suggested Fix
To resolve this issue, the Safe Browsing RAR analyzer should explicitly distinguish between a normal EOF and an extraction/iteration failure.
We suggest modifying RarReader to expose whether any fatal errors were recorded by ErrHandler (such as ErrHandler.GetErrorCode() != RARX_SUCCESS) after iteration finishes. If a fatal extraction error is detected, ResumeExtraction() should propagate the failure (e.g., reporting ArchiveAnalysisResult::kFailedDuringIteration or ArchiveAnalysisResult::kUnknown) and set success = false, rather than treating the early abort as a clean, successful scan.
Evaluated with Chrome root at commit: b1520ef4a76878853a31f0943b565e42060edec8
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
Impact
A crafted RAR archive could bypass Safe Browsing inspection entirely, allowing malicious files inside to be downloaded without a warning, though the report is based on static analysis and was not dynamically verified.
What the attacker needed
Victim downloads a crafted RAR archive; archive contains an entry with oversized dictionary; Chrome Safe Browsing enabled
The fix
The analyzer should distinguish a normal end-of-archive from an extraction failure by checking the unrar error code and propagating a failure result instead of reporting a valid scan.
How it was found
- Construct a RAR archive with a benign file, then a crafted entry declaring an 8 GB dictionary size, then a malicious payload.
- Download the archive in Google Chrome.
- Chrome sends the archive to the sandboxed utility process for Safe Browsing analysis.
- Extraction fails on the crafted entry because of the oversized dictionary, and the analyzer treats the failure as successful completion.
- Safe Browsing reports a valid scan and permits the download without a warning.
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.
Safe Browsing checks downloaded files for malware. For RAR archives, it uses a helper that unpacks the archive and looks at each file inside. The helper stops early if an archive claims to need a very large dictionary (a memory setting), but the main checker mistakes that stop for 'finished reading everything' and reports the archive as clean. Files placed after the oversized entry are never looked at, so malware can slip through.
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.