Scraping leaky browsers for fun and passwords
Stefaan Truijen (Planet Talent), Adrian Toma (.NET Developer)
BruCON 0x08 · Day 1
Overview
This talk, "Scraping leaky browsers for fun and passwords," delivered by Stefaan Truijen and Adrian Toma at BruCON, delves into the pervasive and often underestimated vulnerability of web browsers to RAM scraping attacks. The speakers present compelling evidence that major web browsers (Google Chrome, Mozilla Firefox, and Internet Explorer/Microsoft Edge) routinely store sensitive user credentials, such as usernames and passwords, in plaintext memory for extended periods. This persistence makes them ripe targets for malware or malicious processes that can access a system's memory.

Key moments
- 2:40 Target breach and the rise of RAM scraping
- 6:00 Acquiring memory dumps and targeting browser credentials
- 13:50 Automated testing strategy for browser memory leaks
- 16:50 Shocking browser vulnerability: Chrome 33%, IE 4%, Firefox 9%
- 19:50 Potential solutions: Memory zeroing, SGX, and secure coding
- 24:40 Vendor responses: Microsoft patches, Google/Firefox dismiss
- 33:00 Live demo: Volatility plugin extracting credentials
- 38:00 LastPass plugin vulnerabilities and future outlook
Scraping Leaky Browsers for Fun and Passwords
Speakers: Stefaan Truijen (Planet Talent); Adrian Toma (.NET Developer)
Conference: BruCON
YouTube: https://www.youtube.com/watch?v=RInjKewZ6Q0
Overview
This talk, "Scraping leaky browsers for fun and passwords," delivered by Stefaan Truijen and Adrian Toma at BruCON, delves into the pervasive and often underestimated vulnerability of web browsers to RAM scraping attacks. The speakers present compelling evidence that major web browsers (Google Chrome, Mozilla Firefox, and Internet Explorer/Microsoft Edge) routinely store sensitive user credentials, such as usernames and passwords, in plaintext memory for extended periods. This persistence makes them ripe targets for malware or malicious processes that can access a system's memory.
The core of the presentation highlights a critical disconnect between the perceived security of modern web browsing, bolstered by technologies like HTTPS, and the reality of endpoint vulnerabilities. While network traffic is increasingly encrypted, the data on the user's machine remains exposed in memory, creating a lucrative target for attackers. Truijen and Toma not only quantify this widespread problem but also demonstrate a practical Volatility Framework plugin developed by Adrian Toma that can reliably extract these credentials from memory dumps.
This research is significant because it challenges the assumptions of both users and browser vendors regarding in-memory data protection. The findings underscore that even with advanced operating systems and browser security features, a fundamental flaw in memory management practices leaves users' most sensitive authentication data vulnerable. The talk serves as a stark reminder that security must be holistic, extending beyond network encryption to encompass the integrity and confidentiality of data within the endpoint's memory.
Background
▶ Watch: Target breach and the rise of RAM scraping (2:40)
The concept of RAM scraping is not new, having existed in academic circles for years, but it gained widespread notoriety in the security landscape following the infamous Target data breach in 2013. In that incident, attackers compromised Point-of-Sale (POS) systems—often running embedded Windows XP—and used memory scrapers to steal credit card track data from approximately 40 million (later revised to 70 million) customers. This attack demonstrated the devastating potential of targeting data while it is being processed on an endpoint, rather than in transit.
Traditionally, attackers focused on intercepting data over networks. However, the widespread adoption of end-to-end encryption and protocols like HTTPS has significantly hardened network communications. As Stefaan Truijen explains, this shift forced attackers to become more creative, moving their attack vector closer to the source: the user's device. If data is encrypted before transmission, the logical point of attack is before encryption or while the data is in plaintext memory on the client-side system. This strategy bypasses the robust encryption that protects data in transit, as the sensitive information must exist in an unencrypted state at some point for processing.
The prevalence of RAM scraping is further evidenced by a trend of major data breaches, many of which are attributed to this technique. Beyond Target, other high-profile incidents mentioned include Staples and Neiman Marcus, indicating that this isn't an isolated problem confined to legacy POS systems but a persistent threat across various computing environments. The problem persists because, despite advances in operating system security and browser features, the fundamental challenge of managing sensitive data in volatile memory without adequate protection remains largely unaddressed by many vendors. Browsers, designed for performance and convenience, often retain data in memory longer than necessary or fail to properly zero out memory regions after sensitive data has been processed, creating "leaky" conditions that attackers can exploit.
Key Findings
▶ Watch: Automated testing strategy for browser memory leaks (13:50)
The research presented by Stefaan Truijen and Adrian Toma uncovered several critical findings regarding the vulnerability of major web browsers to RAM scraping:
- Universal Vulnerability: All three major browsers tested—Google Chrome, Mozilla Firefox, and Internet Explorer (and by extension, Microsoft Edge)—were found to be vulnerable to memory scraping attacks. This indicates a systemic issue rather than an isolated flaw in a single browser.
- Alarmingly Low Protection Ratios: The speakers introduced a "protection ratio" to quantify browser security against RAM scraping. This ratio represents the percentage of test cases where no usernames or passwords were found in memory. The results were concerning:
- Google Chrome: 33% protected (meaning a 67% chance of finding credentials).
- Internet Explorer: 4% protected (meaning a 96% chance of finding credentials).
- Mozilla Firefox: 9% protected (meaning a 91% chance of finding credentials).
These figures demonstrate that, in the majority of real-world scenarios, a malicious actor with memory access could successfully extract credentials.
- Surprising Efficacy of Private Mode: Contrary to initial assumptions, using private or incognito mode offered a significant, albeit not complete, increase in protection for Chrome. Chrome's protection ratio jumped from 33% to 61% in private mode. While Internet Explorer and Firefox also showed slight improvements in private mode, Chrome's gain was substantial, suggesting more robust memory handling in its private browsing context.
- Limited Impact of Delayed Dumps: The researchers tested the effect of waiting five minutes before creating a memory dump. This scenario aimed to see if garbage collection or other background processes would clear sensitive data. While there was a slight improvement in protection for IE and Firefox, and a marginal one for Chrome, the browsers remained highly vulnerable. This indicates that sensitive data persists in memory far longer than it should, even after user interaction has ceased.
- Multi-process Architecture Challenges: The expectation that Chrome's multi-process architecture would offer superior protection was challenged. Experiments showed that repeatedly opening and closing tabs in Chrome actually increased the number of password occurrences in memory, suggesting that its process isolation and memory management do not inherently mitigate this specific threat.
- Divergent Vendor Responses:
- Microsoft: Acknowledged the issue, committed to a patch (released in October/November, leading to an official CVE for the vulnerability), and credited the researchers. This positive response indicates a recognition of RAM scraping as a legitimate threat.
- Google (Chrome): Dismissed the findings, arguing that if an attacker has the ability to read process memory, the system is already compromised, and thus it's not a browser-specific vulnerability. They also noted duplicate tickets reporting the same issue were closed.
- Mozilla (Firefox): Echoed Google's stance, comparing memory reading to a keylogger, which they argued browsers cannot inherently protect against. They also failed to address why plaintext passwords persist in memory for several minutes after use.
- LastPass Vulnerability: External research cited by Truijen revealed that even popular password managers like LastPass are susceptible. The researcher found the LastPass master password and other stored plaintext passwords consistently in memory, highlighting that the problem extends beyond native browser functionality to third-party security tools.
These findings collectively paint a grim picture of in-memory security for web browsers, demonstrating that a well-understood attack vector continues to pose a significant risk to user data.
Technical Deep Dive
▶ Watch: Potential solutions: Memory zeroing, SGX, and secure coding (19:50)
The technical foundation of this research lies in understanding how sensitive data is managed in memory and how attackers can exploit this. Stefaan Truijen outlined the fundamental steps of a memory scraping attack and his methodology for proving browser vulnerability, while Adrian Toma detailed the development of a specialized Volatility Framework plugin to automate credential extraction.
Attack Methodology:
- Memory Acquisition: The first step for an attacker is to acquire a dump of the target process's memory. Truijen demonstrated that this is surprisingly straightforward, even for a limited-rights user, using standard Windows API functions:
OpenProcess(): Obtains a handle to the target browser process.ReadProcessMemory(): Reads data from the target process's virtual memory space.CloseProcessHandle(): Releases the process handle.
This means that any executable running on a target machine, even with low privileges, can potentially dump the memory of a co-located browser process. For automated testing, the researchers utilized ProcDump, a Sysinternals utility, for its speed and efficiency in creating memory dumps.
- Targeting and Data Extraction: The primary target is the memory space of browser processes. Once a memory dump is obtained, the challenge is to sift through gigabytes of raw data to find sensitive strings like usernames and passwords. This involves:
- String Extraction: Identifying all readable strings within the memory dump.
- Pattern Matching: Applying regular expressions or specific patterns (e.g.,
email=,password=, common form field names) to identify potential credentials. The research observed that some credentials appeared as plain text, while others followed specific patterns, making them discoverable.
Three Attack Scenarios:
The research was structured around three primary scenarios where a memory scraper could be effective:
- Pre-Encryption Leakage: This is the most direct attack. Before a browser encrypts login data (e.g., for HTTPS transmission) and sends it to a server, the username and password must exist in plaintext in memory. A memory scraper that can capture this data during this brief window (a "race condition") will succeed.
- Post-Encryption Leakage: Even after data is encrypted and sent, browsers might exhibit memory leaks. If the browser allocates memory for the plaintext password, encrypts it, but then fails to properly free or zero out the original plaintext memory region, the sensitive data persists. An attacker could then retrieve this "stale" data.
- Persistent Password Storage: Browsers offer features like "remember my password." While these databases are often encrypted, the master password or the decrypted credentials might reside in memory at some point. An attacker could target this internal password database or its decryption key.
Automation Strategy:
To conduct a statistically relevant number of tests, the researchers devised an automated testing environment:
- Virtual Machine Setup: A clean Windows 7 Professional virtual machine was used for each test run to ensure isolation and reproducibility. The VM setup also facilitated parallelization of tests.
- User Interaction Automation: To simulate realistic user behavior (e.g., logging into Facebook, Twitter, LinkedIn, Instagram, Gmail thousands of times), the researchers leveraged JUnit for test orchestration and Selenium for browser automation. Selenium allowed for programmatic control of browser actions, such as navigating to websites, entering credentials into forms, and triggering login events.
- Memory Dumping: As mentioned, ProcDump was used for fast and efficient memory acquisition from the browser processes.
- Data Analysis: Custom scripts were developed to parse the raw memory dumps, apply pattern matching, and analyze the results to determine the presence of credentials and calculate protection ratios.
Volatility Framework Plugin (Adrian Toma's Contribution):
Adrian Toma's significant contribution was the development of a Volatility Framework plugin. Volatility is an open-source, Python-based memory forensics framework widely used for extracting digital artifacts from RAM dumps across various operating systems.
- Rationale: Volatility was chosen for its open-source nature, Python's speed for scripting, and its multi-platform support (Windows, macOS, Linux), making the plugin versatile. It's a standard tool for digital forensics.
- Target Environment: The plugin was developed for a Windows 7 32-bit machine, matching the testing environment.
- Memory Acquisition for Plugin: For the plugin's demonstration, Adrian used Belkasoft RAM Capture to quickly generate live memory dumps.
- Plugin Logic:
- The plugin takes a full memory dump as input, not just a specific process's memory.
- It identifies all running processes, filtering specifically for known browser executables (e.g.,
IE Explorer.exe). - For each identified browser process, it scans the entire allocated memory space.
- It applies predefined criteria (patterns like
add email=,add password=, or justemail=,password=) to search for sensitive data. - Any identified credentials are stored and presented to the user.
- Future Work: Adrian expressed plans to improve the plugin with a "generic search" capability, using fewer, broader patterns to increase the likelihood of finding various types of credentials. The code was also planned for release on GitHub to encourage community contributions.
This detailed technical approach allowed the researchers to move beyond theoretical discussions to provide concrete, reproducible evidence of browser memory vulnerabilities and a practical tool for detecting them.
Demo / Proof of Concept
▶ Watch: Vendor responses: Microsoft patches, Google/Firefox dismiss (24:40)
Adrian Toma provided a compelling live demonstration of his Volatility Framework plugin, showcasing its effectiveness in rapidly identifying and extracting credentials from a memory dump. The demo was a crucial part of validating the research findings in a practical, real-world context.
The demonstration involved the following steps:
- Memory Dump Creation: Adrian started with a pre-existing memory dump of a machine where he had logged into Facebook using Internet Explorer. To keep the demo fast, a smaller 1 gigabyte (GB) memory dump was used. He showed a simple batch script that utilized
ramcapture.exe(presumably from Belkasoft RAM Capture, as mentioned earlier) to acquire the dump. - Plugin Execution: A second batch script was then executed to run the Volatility plugin. This script included:
- The
volatility.pycommand to invoke the framework. - The path to the memory dump file.
- The specified profile for the target operating system, in this case,
Win7SP1x86(Windows 7 Service Pack 1, 32-bit). - The name of Adrian's custom plugin.
- A filter to narrow the search to Internet Explorer processes (
IE Explorer.exe). - The
--verboseparameter to display detailed output of the plugin's operations.
- Credential Extraction: Within approximately 24 seconds, the plugin successfully processed the 1GB dump. The verbose output clearly showed the plugin identifying Internet Explorer processes, parsing their memory, and applying the defined patterns. Crucially, the plugin located and displayed the plaintext username and password for the Facebook login that had been performed on the machine. The output highlighted the identified credentials, demonstrating the direct and immediate threat posed by memory scraping.
This live proof of concept effectively confirmed that sensitive data, such as usernames and passwords, can be quickly and reliably extracted from browser memory using readily available tools and custom scripts. It underscored that the vulnerabilities are not theoretical but practically exploitable, reinforcing the urgency of addressing these memory management issues. Adrian also mentioned that the plugin's code would be submitted to GitHub, inviting community feedback and improvements, particularly for developing a more generic search capability.
Defensive Implications
▶ Watch: LastPass plugin vulnerabilities and future outlook (38:00)
The findings from "Scraping leaky browsers for fun and passwords" carry significant defensive implications for both browser vendors and end-users. The core problem—sensitive data persisting in plaintext memory—demands a multi-faceted approach to mitigation.
For Browser Vendors and Developers:
- Zeroing Out Memory: The most direct solution is to ensure that memory regions containing sensitive data (like passwords) are explicitly zeroed out immediately after use, rather than merely being freed. When memory is freed, its contents remain until overwritten by new data, creating a window of vulnerability. While this might incur a slight performance hit, the security benefit of preventing plaintext credential leakage far outweighs the cost.
- Rigorous Code Auditing for Memory Leaks: Browser code should be thoroughly audited for memory allocation and deallocation practices. Any code that allocates memory for sensitive data and fails to free it or reuse it securely constitutes a leak. Tools like VeriFast (developed at the University of Leuven, as mentioned by Stefaan) can assist developers by allowing them to annotate code and automatically verify the absence of memory leaks, thereby ensuring more secure memory management.
- Adoption of Protected Module Architectures (PMA): Hardware-level security features offer a more robust defense. Technologies like Intel SGX (Software Guard Extensions), or other Protected Module Architectures (PMAs), can encrypt memory and enforce strict access controls. This means that even if an attacker gains kernel-level access, they would only see encrypted data in memory. While SGX has its own development hurdles (e.g., requiring Intel-signed software) and is still evolving, such hardware enclaves represent a promising future direction for protecting sensitive in-memory data.
- Re-evaluating Performance vs. Security Trade-offs: The speakers highlighted that browser vendors often prioritize speed and performance, even if it means holding onto memory longer or not zeroing it out to avoid minor overheads. This talk suggests that the market's emphasis on milliseconds of performance gain may come at a significant security cost. Vendors need to re-evaluate this balance and consider the security implications of their memory management strategies.
- Refining Multi-process Architectures: While multi-process architectures like Chrome's are designed to isolate tabs and processes, the research indicated that simply having multiple processes does not inherently solve the memory scraping problem; in some cases, it exacerbated it. Browser developers need to ensure that inter-process communication and shared memory handling for sensitive data are designed with memory confidentiality in mind.
- Secure Handling of "Remember Me" Passwords: Browsers should implement mechanisms to flush remembered passwords from memory immediately after they are used for authentication, rather than allowing them to persist. If a user has opted for a browser to remember credentials, these should ideally be retrieved from encrypted storage only when needed and then promptly removed from volatile memory.
For Users:
- Understand Endpoint Risk: Users must understand that even with HTTPS, their data is vulnerable on their own machine. A compromised operating system can expose credentials regardless of network encryption.
- Use Unique, Strong Passwords and 2FA: The fundamental defense against credential reuse is to use unique, complex passwords for every service. Enabling Two-Factor Authentication (2FA) wherever possible adds a crucial layer of security, making stolen passwords less useful to attackers.
- Be Wary of Password Managers: While password managers like LastPass are generally recommended, the research indicates that even they can be vulnerable to memory scraping if their master password or decrypted credentials are found in plaintext memory. Users should choose reputable password managers, keep them updated, and understand their inherent risks.
- Keep Software Updated: Regularly updating operating systems and browsers is crucial, as patches (like Microsoft's CVE-related fix) can mitigate known vulnerabilities, even if they don't fully solve the underlying problem.
- Consider Private/Incognito Mode: While not a panacea, the research showed that private browsing modes (especially in Chrome) can offer a degree of enhanced protection against memory scraping. For highly sensitive transactions, this might be a slightly safer option.
- Practice Good Endpoint Hygiene: Use reputable antivirus/anti-malware solutions, be cautious about opening suspicious attachments or clicking malicious links, and avoid running unknown executables. Preventing malware from gaining a foothold on the system is the first line of defense against memory scraping.
In summary, defending against memory scraping requires a concerted effort. Browser vendors must implement more secure memory management practices and leverage hardware-level protections, while users must adopt robust security habits and understand the persistent threat to their in-memory data.
Key Takeaways
- Pervasive Vulnerability: All major web browsers (Google Chrome, Mozilla Firefox, Internet Explorer/Edge) are significantly vulnerable to RAM scraping attacks, allowing plaintext usernames and passwords to be extracted from memory.
- Alarming Protection Ratios: The quantified protection ratios are extremely low: Chrome (33%), Firefox (9%), and Internet Explorer (4%), indicating a high probability of credential exposure in most scenarios.
- Private Mode Offers Partial Relief: Chrome's private mode surprisingly increases its protection ratio to 61%, offering a notable, though incomplete, enhancement against memory scraping, while other browsers show minor improvements.
- Persistence of Sensitive Data: Passwords and usernames remain in browser memory for extended periods (minutes) even after logout, tab closure, or navigation, making "delayed dump" attacks feasible.
- Divergent Vendor Responses: Microsoft acknowledged the issue, issued a CVE, and released a patch. Google and Mozilla, however, largely dismissed the problem, attributing it to prior system compromise rather than a browser-specific vulnerability.
- Hardware-Level Solutions are Future: Protected Module Architectures (e.g., Intel SGX) offer promising hardware-based solutions to encrypt memory and enforce access control, preventing unauthorized reading of sensitive data.
- Practical Exploitation Demonstrated: The developed Volatility Framework plugin provides a concrete, multi-platform tool for forensic analysts and attackers to efficiently extract credentials from memory dumps.
About the Speaker(s)
Stefaan Truijen is a computer scientist specializing in security. He studied Computer Science at the University of Louisville, where he focused on security and completed his Master's thesis on the topic of memory scraping web browsers. His research in this area formed the foundation of this talk. At the time of the presentation, he was employed by Planet Talent.
Adrian Toma is a developer with a strong background in informatics and security. He holds a Bachelor's degree in Digital Informatics and a second Bachelor's degree obtained through evening courses in security. He works as a .NET Developer. Adrian was responsible for developing the practical Volatility Framework plugin demonstrated in the talk, which automates the process of finding sensitive data in browser memory dumps.