We know browsers disallow active mixed content in pages served using HTTPS. This is because the JavaScript could be modified by an active MitM which would compromise the security of the page. Many browsers will also block images/other passive content from being loaded from an insecure source for a number of reasons.
Why then, is it possible for a site served over HTTPS to redirect to a HTTP URL with a Content-Disposition: attachment
or Content-Type: binary/octet-stream
header that forces a download?
For example this download page is served initially over HTTPS but redirects the user to an insecure download URL. Chrome just blindly automatically downloads the file and presents no information as to its origin. Firefox does show the origin in its download dialog but still allows the download to proceed and doesn't warn the user at all:
Given that a user downloading and running arbitrary code like this (that they believe to be from a secure site) can do much more damage than some injected JavaScript, why do browsers permit this behaviour? Why aren't these downloads forced to be served in a secure manner like included scripts?