Listen to the Whispers: Web Timing Attacks that Actually Work
Unknown
Black Hat USA 2024 · Day 1 · Briefing
Overview
In "Listen to the Whispers: Web Timing Attacks that Actually Work," the speaker delves into the often-misunderstood realm of web timing attacks, an attack class notorious for its theoretical potency yet practical elusiveness. The talk addresses a fundamental "timing divide" – the vast chasm between what appears possible in academic research or controlled lab environments and what genuinely works against real-world web applications. The speaker, whose personal circumstances involved the unexpected early birth of his daughter, delivered this presentation virtually, bringing a candid and personal perspective to a decade-long avoidance of this challenging research area.

Key moments
- 0:00 Introduction and speaker's personal circumstance
- 0:50 The 'research trap' of web timing attacks
- 1:59 Theoretical goal: password reset token hijacking
- 2:15 Replicating theoretical timing attack write-ups
- 2:55 Exposing artificial sleep in lab timing attack demos
- 3:30 Introducing the 'Timing Divide' concept
Listen to the Whispers: Web Timing Attacks that Actually Work
Speakers: Unknown
Conference: Black Hat USA
YouTube: https://www.youtube.com/watch?v=LDy7-xBvsfo
Overview
In "Listen to the Whispers: Web Timing Attacks that Actually Work," the speaker delves into the often-misunderstood realm of web timing attacks, an attack class notorious for its theoretical potency yet practical elusiveness. The talk addresses a fundamental "timing divide" – the vast chasm between what appears possible in academic research or controlled lab environments and what genuinely works against real-world web applications. The speaker, whose personal circumstances involved the unexpected early birth of his daughter, delivered this presentation virtually, bringing a candid and personal perspective to a decade-long avoidance of this challenging research area.
This presentation is crucial for security professionals, developers, and researchers grappling with the complexities of side-channel attacks in web contexts. It dissects the common pitfalls and misconceptions surrounding timing attacks, challenging the notion that subtle time differences can reliably leak sensitive information across noisy networks and complex server infrastructures. By sharing his own rigorous, and ultimately frustrating, attempts to weaponize these attacks, the speaker provides invaluable insights into why many theoretical timing attacks simply fail to materialize into practical exploits.
Background
▶ Watch: Introduction and speaker's personal circumstance (0:00)
Timing attacks are a class of side-channel attacks that exploit variations in the time taken for a system to respond to different inputs. The core premise is that operations involving sensitive data might execute in slightly different durations depending on the characteristics of the data being processed. For instance, comparing two strings might take longer if they share a common prefix than if they differ from the first character. An attacker, by precisely measuring these minute time differences, could theoretically infer information about secret data, such as passwords, encryption keys, or, as explored in this talk, password reset tokens.
For years, timing attacks have occupied a unique and often frustrating position in the cybersecurity landscape. They are lauded in academic circles for their elegance and the fundamental cryptographic and architectural weaknesses they expose, yet they are rarely seen exploited in the wild. This paradox has led to a perception that timing attacks are "research traps" – intellectually stimulating but practically infeasible. The speaker, having personally avoided this "trap" for a decade, finally embarked on a quest to bridge this theoretical-practical divide, driven by a specific, high-impact goal: to exploit a timing vulnerability to guess a password reset token.
The theoretical scenario is compelling: imagine an application comparing a user-provided password reset token with one stored in a database. If the comparison function is not constant-time – meaning its execution time varies based on the input – an attacker could send a series of guesses. A guess with a correct first character might take infinitesimally longer than one with an incorrect first character. By iterating through possible characters for each position, measuring response times, and statistically analyzing the results, an attacker could progressively reconstruct the entire secret token, character by character. Such an attack, if successful, could lead to account hijacking on "nearly any website."
This theoretical promise motivated the speaker to investigate further, particularly after encountering a write-up detailing a timing attack on a real website. However, upon attempting to replicate this attack, a critical realization emerged: the write-up, despite its claims, was "completely theoretical," lacking any actual proof of concept (PoC) to validate its real-world applicability. This experience laid the groundwork for the speaker's deeper dive into the practical limitations of web timing attacks, setting the stage for his exploration of the "timing divide."
Key Findings
▶ Watch: Theoretical goal: password reset token hijacking (1:59)
The central and most impactful finding of this research is the stark reality of the timing divide. This concept encapsulates the significant disparity between the theoretical potential of timing attacks and their actual viability in real-world web environments. The speaker's extensive efforts demonstrated that while the underlying cryptographic principles and algorithmic variations that enable timing attacks are sound, the practical noise and complexity of modern web infrastructure effectively obscure these subtle timing differences, rendering most attacks infeasible.
Specifically, the key findings included:
- The Falsity of Theoretical PoCs: Many published write-ups and academic papers on timing attacks are purely theoretical, lacking a functional proof of concept. The speaker's attempt to replicate a seemingly real-world timing attack on a password reset token revealed that the original claim was unsubstantiated by practical exploitation. This highlights a critical flaw in how some security research is presented, potentially overstating the practical threat.
- Artificiality in Lab Environments: When the speaker sought out existing labs designed to demonstrate timing attacks, he found that while these labs did show the attack working "really well," this success was often due to artificial manipulation. Upon inspecting the source code of one such lab, it was discovered that the string comparison function had an "artificial sleep statement" injected. This deliberate delay made the timing differences large enough to be easily measurable, but it bore no resemblance to how real-world, optimized string comparisons behave. This finding underscores that even seemingly successful demonstrations can be misleading, failing to represent genuine vulnerabilities.
- Failure of High-Precision Local Benchmarking: As a final, exhaustive effort, the speaker resorted to creating a highly controlled local benchmark environment, taking "tens of millions of measurements." This setup eliminated network latency, server load variations, and other external noise, providing the most ideal conditions for detecting subtle timing differences. Crucially, even under these highly optimized, "cheat as much as possible" conditions, the attack still "failed." This profound result indicated that the inherent timing differences in typical, non-constant-time string comparisons, even without any network or system noise, are often too minuscule to be reliably exploited by character-by-character inference.
- The "Timing Divide" as a Unique Phenomenon: The speaker concludes that "no other web attack class has this kind of massive dramatic split between the theoretical and the practical." This emphasizes that unlike SQL injection or Cross-Site Scripting, where theoretical vulnerabilities often translate directly into practical exploits, timing attacks are uniquely hampered by the environmental factors of the web. The noise introduced by network latency, operating system scheduling, database operations, caching mechanisms, and various other components of a modern web stack effectively drowns out the subtle whispers of timing differences, making them indistinguishable from random fluctuations.
These findings collectively present a sobering perspective on web timing attacks, shifting the focus from their theoretical danger to their practical impotence in most real-world scenarios.
Technical Deep Dive
▶ Watch: Replicating theoretical timing attack write-ups (2:15)
The technical core of the investigation revolved around a specific type of timing attack: inferring a secret password reset token character by character through observing minute variations in server response times during a string comparison operation. The underlying principle relies on the common implementation of string comparison functions (e.g., strcmp in C-like languages or similar logic in higher-level languages). These functions typically compare strings byte by byte, character by character, from left to right. If a mismatch is found, the comparison terminates early.
Consider a secret token SECRET123 and an attacker guessing S. The comparison S vs SECRET123 would involve checking S (match), and then the comparison ends because the guessed string is shorter. Now, consider a guess SE. The comparison SE vs SECRET123 would check S (match), then E (match), and then end. Theoretically, the operation SE takes slightly longer than S because it performs one more character comparison. If the attacker guesses SX, the comparison checks S (match), then X (mismatch), and terminates. This would ideally take the same time as SE, but critically, longer than S. An attacker could then iterate through all possible characters for the second position (e.g., SA, SB, SC, ... SE, ... SZ) and identify the one that causes a statistically significant increase in response time, thereby revealing the correct character. This process would be repeated for each subsequent character of the token.
The speaker initially approached this problem with the belief that this differential timing could be reliably measured. His attempts involved:
- Replicating Existing Write-ups: The first step was to validate a published timing attack on a real website. This involved sending a series of crafted requests, each containing a slightly different guess for the password reset token, and precisely measuring the time taken for the server to respond. The expectation was to observe a measurable increase in response time for each correct character prefix. However, this attempt failed, revealing that the original write-up was entirely theoretical, lacking a functional PoC. This immediately highlighted the gap between academic theory and practical application.
- Building a Vulnerable System: To control variables, the speaker then constructed his own vulnerable system, specifically designed to exhibit the non-constant-time string comparison behavior. Despite this controlled environment, the attack still "would not work." This indicated that even with a known vulnerability, the inherent challenges of measurement in a networked environment were too great.
- Investigating Lab Demonstrations: The speaker then turned to publicly available labs that purported to demonstrate successful timing attacks. One particular lab showed the attack working "really well," which immediately raised suspicion. Upon reviewing the lab's source code, a critical discovery was made: the string comparison function was artificially manipulated to inject a
sleepstatement. Thissleepcall, explicitly designed to introduce a measurable delay, made the timing differences orders of magnitude larger than what would naturally occur in a production system. This confirmed that the "success" in the lab was not due to the inherent exploitability of a timing difference but rather to a deliberate, unrealistic enhancement. This finding is crucial as it demonstrates how easy it is to create a "working" PoC that misrepresents real-world conditions.
- Local Benchmarking with Extreme Precision: Recognizing the overwhelming noise in network-based measurements, the speaker's final, most rigorous attempt involved a local benchmark. This setup eliminated network latency, which is often the dominant factor in web request timings. By running the vulnerable code and the attack logic on the same machine, and taking "tens of millions of measurements," the goal was to achieve the highest possible precision in timing. Even under these ideal, highly controlled conditions, where external noise was minimized to an absolute minimum, the attack "still failed." This was the most definitive proof of the "timing divide." The actual time difference introduced by a single character comparison in a typical string function is often in the order of nanoseconds or low microseconds. These differences are so minuscule that they are easily masked by even the slightest variations in CPU cache hits/misses, operating system scheduler interrupts, or other low-level system events, let alone the complexities of a full web stack.
The technical takeaway is that while non-constant-time string comparisons are a theoretical vulnerability, the practical observability of these minute timing differences is extremely difficult in the context of a modern web application. The sheer volume of "noise" from the network, server-side processing, database lookups, operating system scheduling, and even hardware-level variations (like CPU cache behavior) effectively acts as a powerful obfuscator, making it nearly impossible to consistently isolate and measure the specific timing signals required for a successful timing attack.
Demo / Proof of Concept
▶ Watch: Exposing artificial sleep in lab timing attack demos (2:55)
The transcript explicitly details the speaker's extensive, but ultimately unsuccessful, attempts to develop a robust and practical Proof of Concept (PoC) for web timing attacks in realistic environments. Rather than presenting a successful demonstration, the talk serves as a narrative of why such demonstrations are so challenging to achieve outside of artificially constructed scenarios.
The speaker attempted to:
- Replicate an existing write-up, only to find it was "completely theoretical" with no working PoC.
- Build his own vulnerable system, which also failed to yield a working attack.
- Investigate an existing lab demonstration, discovering that its success was contingent on an "artificial sleep statement" injected into the string comparison function, rendering it unrealistic.
- Conduct a highly controlled local benchmark with "tens of millions of measurements," which still "failed" to reliably demonstrate the attack.
Therefore, this talk does not feature a successful demo or a transferable PoC for web timing attacks that "actually work" in the wild, but rather demonstrates the significant hurdles in creating one. The core message is that the absence of a practical PoC in realistic settings is the key finding.
Defensive Implications
▶ Watch: Introducing the 'Timing Divide' concept (3:30)
Given the speaker's findings, the defensive implications for web applications are nuanced. While the research strongly suggests that many theoretical web timing attacks are practically infeasible due to the "timing divide," it does not entirely dismiss the underlying principles.
Defenders should consider the following:
- Prioritize Constant-Time Comparisons for Highly Sensitive Operations: Even if practical exploitation is difficult, using constant-time comparison functions for critical operations, especially those involving cryptographic secrets (like API keys, encryption keys, or authentication tokens), remains a best practice. This mitigates the theoretical vulnerability at its source, regardless of the noise environment. Many modern cryptographic libraries and frameworks provide constant-time implementations for such comparisons (e.g.,
hash_equals()in PHP,crypto.timingSafeEqual()in Node.js). While the speaker's research focused on password reset tokens, the principle extends to any secret data. - Avoid Introducing Artificial Delays: The discovery that some "working" lab demonstrations rely on "artificial sleep statements" is a critical cautionary tale. Developers should never intentionally introduce delays into comparison functions as a misguided attempt at "security by obscurity" or for any other reason, as this would directly create the measurable timing differences that attackers seek.
- Understand the Role of Environmental Noise: Defenders can take some comfort in the fact that the inherent noise of a complex web infrastructure (network latency, server load, database access times, OS scheduling) provides a significant natural defense against subtle timing attacks. This isn't a strategy to rely on, but it explains why these attacks are rarely seen in the wild.
- Focus on Proven Vulnerabilities: The talk implicitly encourages security teams to allocate resources primarily to addressing attack classes that have a clear and demonstrable path to exploitation in real-world scenarios, such as SQL injection, XSS, CSRF, and authentication bypasses. While timing attacks are intellectually interesting, their practical impact is often negligible compared to more straightforward vulnerabilities.
- Be Skeptical of Theoretical Claims: Security professionals should exercise healthy skepticism when encountering claims of timing vulnerabilities, particularly if they are not accompanied by a robust, non-artificial proof of concept that works in a realistic environment. This research provides a strong basis for questioning the practical exploitability of such claims.
- Monitor for Abnormal Response Times (Long-Term Anomaly Detection): While specific character-by-character inference is difficult, unusually long response times for certain requests, particularly those involving authentication or token validation, could theoretically indicate some form of resource exhaustion or a very high-noise timing attack. However, this is more likely to signal other issues like DoS or inefficient code rather than a successful timing attack. The practical difficulty of distinguishing a timing signal from legitimate system noise makes this a low-priority defensive measure.
In summary, while timing attacks are fascinating from a theoretical standpoint, the speaker's research suggests that for most web applications, the "whispers" of timing differences are too faint to be heard amidst the roar of the internet. The best defense remains sound coding practices, particularly constant-time comparisons for sensitive data, rather than relying on the inherent difficulty of exploitation.
Key Takeaways
- The "Timing Divide" is Real: There's a significant gap between theoretical timing attack concepts and their practical application against real-world web applications.
- Most Timing Attacks Are Not Practical: Despite academic interest, many web timing attacks, particularly those relying on subtle differences in string comparison times, are not reliably exploitable in noisy, distributed web environments.
- Artificiality in Demos: Many "successful" lab demonstrations of timing attacks rely on artificially injected delays (e.g.,
sleepstatements) that do not reflect genuine vulnerabilities in production systems. - Noise Obscures Signals: Network latency, server load, database operations, and other system noise effectively drown out the minuscule timing differences that timing attacks attempt to exploit.
- Local Benchmarks Also Fail: Even under ideal, highly controlled local benchmarking conditions with millions of measurements, the inherent timing differences of non-constant-time comparisons were often too small to be reliably detected for exploitation.
- Constant-Time is Still Best Practice: While practical exploitation is difficult, implementing constant-time comparison functions for sensitive data remains a fundamental security best practice to eliminate the theoretical vulnerability at its source.
About the Speaker(s)
The speaker for "Listen to the Whispers: Web Timing Attacks that Actually Work" is not explicitly named in the provided metadata or transcript. However, the speaker is a dedicated security researcher with at least a decade of experience in the field, having personally avoided the "research trap" of timing attacks for that period before deciding to tackle the challenge head-on. The speaker is also a new parent, having delivered the talk virtually from home due to the early birth of his baby daughter the day before the conference. This personal context underscores his commitment to sharing his findings despite significant personal events. His research demonstrates a rigorous, skeptical, and persistent approach to investigating complex security problems, willing to challenge common assumptions and delve deep into the practical realities of attack methodologies.