Why does Google Chrome sometimes warn that a downloaded PDF can harm your computer?

TL;DR: Chrome has a variety of client-side heuristics used to determine a file’s safety. I don’t believe there’s anything you can do to ensure that a file is marked “safe”, but I’ll point at some things that might help.


A good amount of logic goes into determining whether or not that prompt should be shown. Happily, Chromium is open source, so that logic is available for you to peruse. I’m not incredibly familiar with the download code, but the best place to start would almost certainly be ChromeDownloadManagerDelegate::IsDangerousFile. That ends up calling out to download_util::GetFileDangerLevel and download_util::IsExecutableMimeType which seem to be where the checks against mime types and paths live.

Based on a quick read, I’d imagine that the redirects are at least part of the cause, as those aren’t directly related to a user gesture. Clicking directly through to the download is “safer” in this context than clicking on something, and being redirected through a variety of trackers and dispatchers, as the user can’t be expected to follow along.

The heuristic also takes into account whether you’ve been to a particular URL or domain before; that could also have an impact on certain files showing up as “safe” and others not.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)