Commit 62a3108f authored by Dan Rubery's avatar Dan Rubery Committed by Commit Bot

Always ping for DMG files

There are a lot of features of DMG files that we don't support, and some
of these can be used to deliver malware. We should always send a ping
when we detect a DMG file, instead of relying on detecting the contained
binary.

Bug: 882927
Change-Id: Idf7523f575a5d9778ab5d14ea1112317118fd2ed
Reviewed-on: https://chromium-review.googlesource.com/1225050Reviewed-by: default avatarJialiu Lin <jialiul@chromium.org>
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595497}
parent c77be1dd
......@@ -730,6 +730,7 @@ void CheckClientDownloadRequest::OnDmgAnalysisFinished(
} else {
base::UmaHistogramSparse("SBClientDownload.DmgFileFailureByType",
uma_file_type);
type_ = ClientDownloadRequest::MAC_ARCHIVE_FAILED_PARSING;
}
if (archived_executable_) {
......@@ -745,16 +746,6 @@ void CheckClientDownloadRequest::OnDmgAnalysisFinished(
UMA_HISTOGRAM_TIMES("SBClientDownload.ExtractDmgFeaturesTime",
base::TimeTicks::Now() - dmg_analysis_start_time_);
if (!archived_executable_) {
if (!results.success) {
type_ = ClientDownloadRequest::INVALID_MAC_ARCHIVE;
} else {
PostFinishTask(DownloadCheckResult::SAFE,
REASON_ARCHIVE_WITHOUT_BINARIES);
return;
}
}
OnFileFeatureExtractionDone();
}
#endif // defined(OS_MACOSX)
......
......@@ -593,8 +593,9 @@ void DownloadProtectionServiceTest::CheckClientDownloadReportCorruptArchive(
EXPECT_EQ(0, GetClientDownloadRequest()->archived_binary_size());
EXPECT_TRUE(GetClientDownloadRequest()->has_download_type());
ClientDownloadRequest::DownloadType expected_type =
type == ZIP ? ClientDownloadRequest_DownloadType_INVALID_ZIP
: ClientDownloadRequest_DownloadType_INVALID_MAC_ARCHIVE;
type == ZIP
? ClientDownloadRequest_DownloadType_INVALID_ZIP
: ClientDownloadRequest_DownloadType_MAC_ARCHIVE_FAILED_PARSING;
EXPECT_EQ(expected_type, GetClientDownloadRequest()->download_type());
ClearClientDownloadRequest();
......
......@@ -68,7 +68,7 @@ bool IsBinaryDownloadForCurrentOS(
// Platform-specific types are relevant only for their own platforms.
#if defined(OS_MACOSX)
if (download_type == ClientDownloadRequest::MAC_EXECUTABLE ||
download_type == ClientDownloadRequest::INVALID_MAC_ARCHIVE)
download_type == ClientDownloadRequest::MAC_ARCHIVE_FAILED_PARSING)
return true;
#elif defined(OS_ANDROID)
if (download_type == ClientDownloadRequest::ANDROID_APK)
......
......@@ -483,7 +483,7 @@ message ClientDownloadRequest {
INVALID_ZIP = 7;
// A .dmg, .pkg, etc, that Chrome failed to unpack to the point of finding
// Mach O's.
INVALID_MAC_ARCHIVE = 8;
MAC_ARCHIVE_FAILED_PARSING = 8;
// A download request initiated via PPAPI. Typically the requestor is
// a Flash applet.
PPAPI_SAVE_REQUEST = 9;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment