This repository has been archived by the owner on May 10, 2024. It is now read-only.
Harden favicon loading logic to fix crash when loading certain web pages #3868
Labels
Milestone
Description:
Currently the favicon loaders can load PDF files if the URL response when loading
/favicon.ico
actually returns pdf data. This is a result of SDWebImage being able to decode it and return an "image" as a result instead of throwing an error.There are multiple points of hardening that should happen:
favicon.ico
to the base domain and not the URL. In the case of the example PDF, the url ends up beinghttps://static1.squarespace.com/static/57338e2c04426238cff175c6/t/60c9462f924a473dc95dc850/1623803439283/ListaDeVinos...pdf/favicon.ico
which is incorrect, it should have been attempting to fetchhttps://static1.squarespace.com/favicon.ico
Content-Type: application/pdf
response headers and possibly file header byte checking)Steps to Reproduce
Actual result: Crashes
Expected result: Shouldn't crash
Reproduces how often: Always
Brave Version: Live (1.27.1)
Device details: Depending on the devices memory limitations it may crash while downloading the favicon or when displaying it
The text was updated successfully, but these errors were encountered: