Improper state validation in Downloads (CVE-2026-95330)
A stale SHA256 hash state from an interrupted parallel download is carried over when the download resumes as a serial stream, so the hash Chrome computes does not match the file actually written to disk. An attacker-controlled server could therefore deliver a malicious file while Safe Browsing receives a benign hash.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 4 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 potential vulnerability exists where resuming an interrupted parallel download as a serial download leads to the propagation of a stale SHA256 hash state. Because the file on disk is truncated but the over-long hash state is retained, the completed download's hash is calculated incorrectly. This mismatch allows a malicious file to bypass Safe Browsing blocklist checks by reporting a benign hash.
Affected files:
components/download/internal/common/download_item_impl.cccomponents/download/internal/common/base_file.cc
Estimated timestamp from git blame: 2019-05-30
Potential Security Vulnerability: Safe Browsing Bypass via Stale Hash State
There is a potential logic and state-tracking issue in Chromium's download resumption code that can allow an attacker-controlled server to bypass Safe Browsing download blocklist checks.
When an interrupted parallel download with non-contiguous slices is resumed as a single-stream (non-parallelizable) download, Chrome can propagate a stale secure hash state covering a larger range of bytes than the resumption offset. As a result, the on-disk file is truncated to the resumption offset, but the over-long hash state is retained. Subsequent writes are appended, leading to a calculated file hash that does not match the actual file on disk.
Note: These are potential steps and behavior analyzed from the source code; our tooling does not currently have the capability to execute a live proof-of-concept.
Root Cause & Potential Exploit Path
1. Creation of Stale Hash State
During a parallel download session, if the download is interrupted, BaseFile::Finish() (components/download/internal/common/base_file.cc:321) is called to handle the partial state. For a sparse file, CalculatePartialHash() is executed, which sequentially reads and hashes the file from offset 0 up to bytes_so_far_ (the total sum of written bytes across all slices, e.g., A + B).
If slice 0 was written to [0, A) and slice 1 to [X, X + B) (where X > A), the sequential read hashes v1[0, A) followed by B zero bytes from the unwritten hole. The resulting secure_hash_ state covers A + B bytes and represents SHA256(v1[0, A) || zeroes^B). This state is saved on the download item.
2. Parallel-to-Serial Resumption and Mismatched Propagation
Upon resumption, Chrome requests the first hole offset A via download_params->set_offset(A). The stale hash_state_ (covering A + B bytes) is passed to the resumption parameters (components/download/internal/common/download_item_impl.cc:2618).
If the attacker's server responds with 206 Partial Content but omits the Content-Length header, Chrome disqualifies the download from being parallelized further. The download job is converted to a standard serial job, and received_slices_ on the download item is cleared.
3. Bypassing Defensive Resets
This mismatched hash state survives because the defensive guards are bypassed:
- Sparse-file reset bypassed: In
BaseFile::Initialize(), becausereceived_slices_was cleared and there is only a single stream,IsSparseFile()evaluates tofalse. Therefore, thesecure_hash_.reset()call for sparse files is bypassed. - Re-hash calculation bypassed: Since
secure_hash_is already non-null,CalculatePartialHash()is not re-run. - Truncation reset bypassed: In
BaseFile::Open(), because the file on disk is larger than the resumption offsetA(due to the presence of slice 1), the file is truncated toAbytes. However, becauseA > 0, the reset blockif (bytes_so_far_ == 0) secure_hash_ = ...is bypassed, keeping the over-longsecure_hash_active.
4. Safe Browsing Bypass Impact
The remaining payload v2[A, end) is appended sequentially. At completion, the physical file on disk is v1[0, A) || v2[A, end), while the final computed hash is SHA256(v1[0, A) || zeroes^B || v2[A, end)).
When Chrome queries item->GetHash() to generate the ClientDownloadRequest for Safe Browsing, it sends the mismatched (benign) hash. This allows an attacker to deliver a malicious payload on disk while ensuring Safe Browsing scans only see a clean, pre-calculated benign hash.
Proposed Remediation
To resolve this state mismatch, when a download transitions from a parallel/sparse state to a serial/non-parallelizable state, the partial hash state should be invalidated.
Specifically, in DownloadItemImpl::OnDownloadFileInitialized() (components/download/internal/common/download_item_impl.cc), when received_slices_ is cleared because the job is no longer parallelizable, the associated hash_state_ should also be reset:
// If the download is not parallel, clear the |received_slices_| and the stale hash state.
if (!received_slices_.empty() && !job_->IsParallelizable()) {
destination_info_.received_bytes =
GetMaxContiguousDataBlockSizeFromBeginning(received_slices_);
received_slices_.clear();
hash_state_.reset(); // Prevent propagating the stale sparse hash state
}
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
Root cause
Likely, when a download switches from parallel to serial, the code clears the received slices but does not reset the partial hash state, and the existing guards that would reset it are all skipped.
Impact
An attacker could deliver a malicious payload to disk while Safe Browsing only sees a clean hash, though the report notes these are potential steps analysed from source and no live proof-of-concept was executed.
What the attacker needed
Attacker-controlled download server; user starts and resumes a download; server omits Content-Length on resume
The fix
When a download stops being parallelizable and the received slices are cleared, the partial hash state should also be reset.
How it was found
- Start a parallel download with non-contiguous slices and interrupt it, so a partial hash covering more bytes than the first hole is saved.
- Resume the download, with Chrome requesting the first hole offset.
- Have the server reply with a partial content response that omits the content length, so Chrome drops parallelisation and clears the received slices.
- Chrome truncates the file to the resumption offset but keeps the over-long hash state, then appends the remaining payload.
- The final hash sent to Safe Browsing does not match the file on disk, so the malicious file is not blocked.
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.
Chrome can download a file in several pieces at once, and it keeps a running fingerprint (a hash) of the bytes as they arrive so it can check the file against a blocklist of bad downloads. If the download is interrupted and later resumed in a different mode, the old fingerprint is kept even though part of the file was thrown away, so the fingerprint no longer describes the real file. A malicious server could exploit this so the blocklist check sees a harmless fingerprint while the user gets a harmful file.
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.