for example, assume I have edited the hosts file with the following line:
127.0.0.1 malicious-site.com
if I happen to have installed a browser developed by people who owns this malicious website.
When I accidentally load a webpage which has a malicious javascript from malicious-site.com, will this browser be able to circumvent the hosts file and still loads that javascript?
EDIT: OK I see this attack model is not very sane, let's imagine a browser exploit in a neutral browser instead.
EDIT: Somehow I discovered that in Chrome/Chromium the browser would not honor hosts under certain circumstances (such as when configured to use a proxy). that's causing the irregular behavior.