Web browsers can be breached in one or more of the following ways:
- Operating system is breached and malware is reading/modifying the browser memory space in privilege mode 
- Operating system has a malware running as a background process, which is reading/modifying the browser memory space in privilege mode
- Main browser executable can be hacked
- Browser components may be hacked
- Browser plugins can be hacked
- Browser network communications could be intercepted outside the machine 
The browser may not be aware of any of the breaches above and may show user a safe connection is made.
Whenever a browser communicates with a website, the website, as part of that communication, collects some information about the browser (in order to process the formatting of the page to be delivered, if nothing else). If malicious code has been inserted into the website's content, or in a worst-case scenario, if that website that has been specifically designed to host malicious code, then vulnerabilities specific to a particular browser can allow this malicious code to run processes within the browser application in unintended ways (and remember, one of the bits of information that a website collects from a browser communication is the browser's identity- allowing specific vulnerabilities to be exploited). Once an attacker is able to run processes on the visitor's machine, then exploiting known security vulnerabilities can allow the attacker to gain privileged access (if the browser isn't already running with privileged access) to the "infected" system in order to perform an even greater variety of malicious processes and activities, on the machine or even the victim's whole network.
Breaches of web browser security are usually for the purpose of bypassing protections to display pop-up advertising collecting personally identifiable information (PII) for either Internet marketing or identity theft, website tracking or web analytics about a user against their will using tools such as web bugs, Clickjacking, Likejacking (where Facebook's like button is targeted), HTTP cookies, zombie cookies or Flash cookies (Local Shared Objects or LSOs); installing adware, viruses, spyware such as Trojan horses (to gain access to users' personal computers via cracking) or other malware including online banking theft using man-in-the-browser attacks.
Vulnerabilities in the web browser software itself can be minimized by keeping browser software updated, but will not be sufficient if the underlying operating system is compromised, for example, by a rootkit. Some subcomponents of browsers such as scripting, add-ons, and cookies are particularly vulnerable ("the confused deputy problem") and also need to be addressed.
Following the principle of defence in depth, a fully patched and correctly configured browser may not be sufficient to ensure that browser-related security issues cannot occur. For example, a rootkit can capture keystrokes while someone logs into a banking website, or carry out a man-in-the-middle attack by modifying network traffic to and from a web browser. DNS hijacking or DNS spoofing may be used to return false positives for mistyped website names, or to subvert search results for popular search engines. Malware such as RSPlug simply modifies a system's configuration to point at rogue DNS servers.
Browsers can use more secure methods of network communication to help prevent some of these attacks:
- DNS: DNSSec and DNSCrypt, for example with non-default DNS servers such as Google Public DNS or OpenDNS.
- HTTP: HTTP Secure and SPDY with digitally signed public key certificates or Extended Validation Certificates.
Perimeter defenses, typically through firewalls and the use of filtering proxy servers that block malicious websites and perform antivirus scans of any file downloads, are commonly implemented as a best practice in large organizations to block malicious network traffic before it reaches a browser.
The topic of browser security has grown to the point of spawning the creation of entire organizations, such as The Browser Exploitation Framework Project, creating platforms to collect tools to breach browser security, ostensibly in order to test browsers and network systems for vulnerabilities.
Plugins and extensions
Although not part of the browser per se, browser plugins and extensions extend the attack surface, exposing vulnerabilities in Adobe Flash Player, Adobe (Acrobat) Reader, Java plugin, and ActiveX that are commonly exploited. Malware may also be implemented as a browser extension, such as a browser helper object in the case of Internet Explorer. Browsers like Google Chrome and Mozilla Firefox can block—or warn users of—insecure plugins.
Conversely, extensions may be used to harden the security configuration. US-CERT recommends to block Flash using NoScript. Charlie Miller recommended "not to install Flash" at the computer security conference CanSecWest. Several other security experts also recommend to either not install Adobe Flash Player or to block it.
An August 2009 study by the Social Science Research Network found that 50% of websites using Flash were also employing flash cookies, yet privacy policies rarely disclosed them, and user controls for privacy preferences were lacking. Most browsers' cache and history delete functions do not affect Flash Player's writing Local Shared Objects to its own cache, and the user community is much less aware of the existence and function of Flash cookies than HTTP cookies. Thus, users having deleted HTTP cookies and purged browser history files and caches may believe that they have purged all tracking data from their computers when in fact Flash browsing history remains. As well as manual removal, the BetterPrivacy addon for Firefox can remove Flash cookies. Adblock Plus can be used to filter out specific threats and Flashblock can be used to give an option before allowing content on otherwise trusted sites.
A hardware-based solution which runs a non-writable, read-only file system and web browser based on the LiveCD approach. Brian Krebs recommends the use of a LiveCD to be protected from organized cybercrime. The first such hardware browser was the ZeusGard Secure Hardware Browser which was released in late 2013. Each time the bootable media is started the browser starts in a known clean and secure operating environment. Data is never stored on the device and the media cannot be overwritten, so it’s clean each time it boots.
Browsing the Internet as a least-privilege user account (i.e. without administrator privileges) limits the ability of a security exploit in a web browser from compromising the whole operating system.
Internet Explorer 7 added "protected mode", a technology that hardens the browser through the application of a security sandboxing feature of Windows Vista called Mandatory Integrity Control. Google Chrome provides a sandbox to limit web page access to the operating system.
- Web application security
- Internet safety
- Filter bubble
- Frame injection
- Identity driven networking
- Network security policy
- Maone, Giorgio. "NoScript :: Add-ons for Firefox". Mozilla Add-ons. Mozilla Foundation.
- NC (Social Science Research Network). "BetterPrivacy :: Add-ons for Firefox". Mozilla Add-ons. Mozilla Foundation.
- Keizer, Greg. Firefox 3.5 Vulnerability Confirmed. Retrieved 19 November 2010.
- Messmer, Ellen and NetworkWorld. "Google Chrome Tops 'Dirty Dozen' Vulnerable Apps List". Retrieved 19 November 2010.
- Skinner, Carrie-Ann. Opera Plugs "Severe" Browser Hole. Retrieved 19 November 2010.
- Bradly, Tony. "It's Time to Finally Drop Internet Explorer 6" . Retrieved 19 November 2010.
- "Browser". Mashable. Retrieved 2 September 2011.
- Smith, Dave. "The Yontoo Trojan: New Mac OS X Malware Infects Google Chrome, Firefox And Safari Browsers Via Adware". IBT Media Inc. Retrieved March 21, 2013.
- Goodin, Dan. "MySQL.com breach leaves visitors exposed to malware". Retrieved 26 September 2011.
- Clinton Wong. "HTTP Transactions". O'Reilly.
- "9 Ways to Know Your PC is Infected with Malware".
- "Symantec Security Response Whitepapers".
- Palant, Wladimir. "Adblock Plus :: Add-ons for Firefox". Mozilla Add-ons. Mozilla Foundation.
- "Facebook privacy probed over 'like,' invitations". CBC News. September 23, 2010. Retrieved August 24, 2011.
- Albanesius, Chloe (August 19, 2011). "German Agencies Banned From Using Facebook, 'Like' Button". PC Magazine. Retrieved August 24, 2011.
- McCullagh, Declan (June 2, 2010). "Facebook 'Like' button draws privacy scrutiny". CNET News. Retrieved December 19, 2011.
- Roosendaal, Arnold (November 30, 2010). "Facebook Tracks and Traces Everyone: Like This!". Retrieved September 27, 2011.
- State of Vermont. "Web Browser Attacks". Retrieved April 11, 2012.
- "Windows Rootkit Overview". Symantec. Retrieved 2013-04-20.
- "Cross Site Scripting Attack". Retrieved May 20, 2013.
- Lenny Zeltser. "Mitigating Attacks on the Web Browser and Add-Ons". Retrieved May 20, 2013.
- Dan Goodin. "Two new attacks on SSL decrypt authentication cookies". Retrieved May 20, 2013.
- "How to Create a Rule That Will Block or Log Browser Helper Objects in Symantec Endpoint Protection". Symantec.com. Retrieved 12 April 2012.
- "Securing Your Web Browser". Archived from the original on 26 March 2010. Retrieved 2010-03-27.
- "Pwn2Own 2010: interview with Charlie Miller". 2010-03-01. Retrieved 2010-03-27.
- "Expert says Adobe Flash policy is risky". 2009-11-12. Retrieved 2010-03-27.
- "Soltani, Ashkan, Canty, Shannon, Mayo, Quentin, Thomas, Lauren and Hoofnagle, Chris Jay: Flash Cookies and Privacy". 2009-08-10. Retrieved 2009-08-18.
- "Local Shared Objects -- "Flash Cookies"". Electronic Privacy Information Center. 2005-07-21. Archived from the original on 16 April 2010. Retrieved 2010-03-08.
- Chee, Philip. "Flashblock :: Add-ons for Firefox". Mozilla Add-ons. Mozilla Foundation.
- "Using a Least-Privileged User Account". Microsoft. Retrieved 2013-04-20.
- "How to Stop an ActiveX control from running in Internet Explorer". Microsoft. Retrieved 2014-11-22.
- "Internet Explorer security zones registry entries for advanced users". Microsoft. Retrieved 2014-11-22.
- "Out-of-date ActiveX control blocking". Microsoft. Retrieved 2014-11-22.
- "Internet Explorer Add-on Management and Crash Detection". Microsoft. Retrieved 2014-11-22.
- "How to Manage Internet Explorer Add-ons in Windows XP Service Pack 2". Microsoft. Retrieved 2014-11-22.
- Matthew Conover. "Analysis of the Windows Vista Security Model". Symantec Corporation. Retrieved 2007-10-08.
- "Browser Security: Lessons from Google Chrome".
- "Report malicious software (URL) to Google".
- "Google Safe Browsing".
- "5 Ways to Secure Your Web Browser". ZoneAlarm.
- "Adblock Plus Will Soon Block Fewer Ads — SiliconFilter". Siliconfilter.com. Retrieved 2013-04-20.