diff --git a/chrome/browser/download/insecure_download_blocking.cc b/chrome/browser/download/insecure_download_blocking.cc index b79cb917c7c5b..86361fd596bbd 100644 --- a/chrome/browser/download/insecure_download_blocking.cc +++ b/chrome/browser/download/insecure_download_blocking.cc @@ -217,6 +217,23 @@ struct InsecureDownloadData { // used for Chrome stuff. Background fetch should probably be HTTPS-only. auto download_source = item->GetDownloadSource(); auto transition_type = item->GetTransitionType(); + LOG(ERROR) << "[POC] InsecureDownloadData: url=" << dl_url + << " transition_type=" << static_cast(transition_type) + << " (core=" + << (static_cast(transition_type) & + static_cast(ui::PAGE_TRANSITION_CORE_MASK)) + << ", " + << ui::PageTransitionGetCoreTransitionString(transition_type) + << ")"; + LOG(ERROR) << "[POC] broken-check (transition & TYPED)=" + << (static_cast(transition_type) & + static_cast(ui::PAGE_TRANSITION_TYPED)) + << " (transition & AUTO_TOPLEVEL)=" + << (static_cast(transition_type) & + static_cast(ui::PAGE_TRANSITION_AUTO_TOPLEVEL)) + << " (transition & RELOAD)=" + << (static_cast(transition_type) & + static_cast(ui::PAGE_TRANSITION_RELOAD)); if (download_source == DownloadSource::RETRY || (transition_type & ui::PAGE_TRANSITION_RELOAD) || (transition_type & ui::PAGE_TRANSITION_TYPED) || @@ -272,6 +289,11 @@ struct InsecureDownloadData { !download_delivered_securely) && !net::IsLocalhost(dl_url); } + LOG(ERROR) << "[POC] is_mixed_content_=" << is_mixed_content_ + << " is_insecure_download_=" << is_insecure_download_ + << " initiator=" + << (initiator_.has_value() ? initiator_->GetURL().spec() + : "(none)"); // A download is considered initiated from a trusted WebUI (e.g. chrome://) // if either: @@ -413,6 +435,8 @@ InsecureDownloadStatus GetInsecureDownloadStatusForDownload( // If the download is fully secure, early abort. if (!data.is_insecure_download_) { + LOG(ERROR) << "[POC] GetInsecureDownloadStatusForDownload -> SAFE " + "(is_insecure_download_=false)"; return InsecureDownloadStatus::SAFE; } @@ -432,6 +456,10 @@ InsecureDownloadStatus GetInsecureDownloadStatusForDownload( ContainsExtension(kSafeExtensions, data.extension_)) { return InsecureDownloadStatus::SAFE; } + LOG(ERROR) + << "[POC] GetInsecureDownloadStatusForDownload -> BLOCK (bypassable " + "warning) -- BUG: mixed-content classification was lost due to " + "broken bitwise-AND on PageTransition core value"; return InsecureDownloadStatus::BLOCK; } @@ -454,6 +482,8 @@ InsecureDownloadStatus GetInsecureDownloadStatusForDownload( return InsecureDownloadStatus::BLOCK; } + LOG(ERROR) << "[POC] GetInsecureDownloadStatusForDownload -> SILENT_BLOCK " + "(hard block, no user override)"; return InsecureDownloadStatus::SILENT_BLOCK; }