From Syntactic Matching to Taint Tracking and Back: A Comparative Study of Web Tracking Detection Techniques

Stefano Calzavara (Paper author · Università Ca' Foscari Venezia), Samuele Casarin (Paper author · Università Ca' Foscari Venezia & Scuola IMT Alti Studi Lucca), Marco Squarcina (Paper author · TU Wien), Matteo Maffei (Paper author · TU Wien)

Privacy Enhancing Technologies Symposium (PETS) 2026 · Day 1 · Moose

Overview

Web tracking remains one of the most pervasive and challenging privacy issues on the internet. In this insightful presentation from PETS, researchers Stefano Calzavara, Samuele Casarin, Marco Squarcina, and Matteo Maffei delve into a critical comparative study of two fundamental techniques used for detecting stateful web tracking: syntactic matching and taint tracking. The talk illuminates the inherent strengths and weaknesses of these methodologies, providing a much-needed empirical evaluation of their effectiveness in identifying how user identifiers are set, read, and transmitted across the web.

Watch on YouTube · Slides

Visual summary for From Syntactic Matching to Taint Tracking and Back: A Comparative Study of Web Tracking Detection Techniques by Stefano Calzavara, Samuele Casarin, Marco Squarcina, Matteo Maffei
Visual summary for From Syntactic Matching to Taint Tracking and Back: A Comparative Study of Web Tracking Detection Techniques by Stefano Calzavara, Samuele Casarin, Marco Squarcina, Matteo Maffei

Key moments

  1. 0:00 Introduction to stateful web tracking problem
  2. 2:00 Syntactic matching: heuristics-based detection technique
  3. 4:00 Taint tracking: principled information flow approach
  4. 7:00 Novel validation algorithm for confirming true positives
  5. 8:00 Empirical comparison results: precision and false negatives
  6. 10:00 Best solution: combining techniques for significant gain

From Syntactic Matching to Taint Tracking and Back: A Comparative Study of Web Tracking Detection Techniques

Speakers: Stefano Calzavara (Paper author, Università Ca' Foscari Venezia), Samuele Casarin (Paper author, Università Ca' Foscari Venezia & Scuola IMT Alti Studi Lucca), Marco Squarcina (Paper author, TU Wien), Matteo Maffei (Paper author, TU Wien)

Conference: PETS

YouTube: https://www.youtube.com/watch?v=2loj7PBt6OI

Overview

Web tracking remains one of the most pervasive and challenging privacy issues on the internet. In this insightful presentation from PETS, researchers Stefano Calzavara, Samuele Casarin, Marco Squarcina, and Matteo Maffei delve into a critical comparative study of two fundamental techniques used for detecting stateful web tracking: syntactic matching and taint tracking. The talk illuminates the inherent strengths and weaknesses of these methodologies, providing a much-needed empirical evaluation of their effectiveness in identifying how user identifiers are set, read, and transmitted across the web.

The core problem addressed is the difficulty in reliably detecting when identifiers, initially stored client-side, are subsequently read and sent to third-party trackers. This process is complicated by various transformations (e.g., encoding) that identifiers may undergo. The speakers present a rigorous comparison, leveraging a dataset of requests from the Tranco top 10K sites, to quantify false positives and false negatives for each technique. Their findings not only highlight the limitations of current state-of-the-art detection engines but also propose a novel validation algorithm and a hybrid detection strategy that significantly improves accuracy, offering crucial implications for web privacy analysis and the development of future privacy-enhancing technologies.

This research is vital for anyone involved in web privacy, security analysis, or the development of browser extensions and tools designed to protect user data. By dissecting the mechanisms of tracking detection, the authors provide a clearer path forward for building more robust and accurate systems capable of identifying and mitigating the pervasive threat of online surveillance.

Background

▶ Watch: Introduction to stateful web tracking problem (0:00)

The landscape of online privacy is continuously shaped by the persistent challenge of stateful tracking. This traditional form of web tracking operates in a two-step process: initially, a website establishes unique identifiers within the client-side storage mechanisms of a user's browser, such as cookies or local storage. Subsequently, during return visits or interactions, these identifiers are retrieved from storage and transmitted to third-party entities, commonly referred to as trackers, enabling them to uniquely identify and profile the user across different sessions and sites. The prevalence of this privacy problem has spurred the development of numerous detection techniques aimed at uncovering these illicit data flows.

However, the detection of stateful tracking is far from straightforward. A direct, byte-for-byte comparison between client-side storage content and outgoing network requests is often insufficient. Trackers frequently employ various obfuscation and transformation techniques to disguise identifiers before transmission. Common examples include Base64 encoding, URL encoding, or even more complex cryptographic transformations. These manipulations mean that the identifier present in a network request may not syntactically match its original form in storage, making detection a non-trivial task. This complexity is precisely why the effectiveness of proposed detection methods needs rigorous evaluation.

The research presented here focuses on two representative and fundamentally different approaches to tackle this problem:

  1. Syntactic Matching (SM): This technique is based on heuristics and involves detecting the literal or transformed occurrences of identifiers found in client-side storage within the components of HTTP requests. Its primary advantage lies in its relative ease of implementation, often relying on pattern matching and a predefined set of common transformations. However, this heuristic-driven nature is also its main drawback. Syntactic matching struggles with complex, custom transformations, leading to false negatives (failing to detect actual tracking). Conversely, it can also generate false positives if it matches values in network requests that happen to be syntactically similar to identifiers but were not actually read from storage for tracking purposes.
  1. Taint Tracking (TT): Representing a more principled and robust approach, taint tracking involves monitoring the flow of information from designated "sources" to "sinks." In the context of web tracking, storage mechanisms (e.g., document.cookie or other JavaScript sources that access client storage) are considered sources, while network requests (e.g., initiated by fetch or XMLHttpRequest (XHR)) are considered sinks. Taint tracking aims to capture the entire information flow throughout JavaScript execution, offering significantly higher precision in understanding how data propagates. The challenge with taint tracking, however, is its implementation complexity, often requiring modifications to browser engines. Furthermore, while precise, it can still suffer from false positives if intermediate transformations modify the data in a way that, while technically a flow, removes its tracking potential (e.g., a single character from an identifier is transmitted, but not the full identifier). It also faces false negatives due to limitations in its ability to track all possible data types or across certain browser mechanisms like HTTP redirects. This comparative study aims to empirically quantify these strengths and weaknesses, providing a clearer understanding of how well these techniques actually perform in the wild.

Key Findings

▶ Watch: Taint tracking: principled information flow approach (4:00)

The empirical comparison conducted by the researchers revealed critical insights into the precision and coverage of syntactic matching and taint tracking, highlighting their respective strengths and weaknesses:

  • Taint Tracking's Superior Precision: A primary finding is that taint tracking demonstrates significantly higher precision than syntactic matching. The study found that a substantial 27% to 30% of tracking requests identified exclusively by syntactic matching were, in fact, false positives. These were instances where syntactic patterns matched, but no actual information flow from client-side storage to a network sink occurred. In stark contrast, all tracking requests found exclusively by taint tracking were confirmed as true positives, underscoring its ability to accurately identify genuine data exfiltration.
  • False Negatives Across Both Techniques: While taint tracking excelled in precision, both techniques exhibited notable limitations in coverage, leading to false negatives:
  • Syntactic Matching's False Negatives: Syntactic matching missed approximately 17% of actual tracking requests. This deficiency was primarily attributed to its lack of visibility into complex JavaScript logic, meaning it couldn't detect identifiers that underwent transformations not covered by its predefined heuristics. It also failed to recognize tracking where identifiers were processed in ways that didn't result in a direct syntactic match, even after common transformations.
  • Taint Tracking's False Negatives: Surprisingly, taint tracking also missed a significant 28% of tracking requests. These false negatives stemmed from two main categories:
  1. Implementation Limitations: The state-of-the-art taint tracking engine used, FoxHound (a modified Firefox instance), had specific limitations. For instance, it did not support taint tracking over data types other than strings. If an identifier was cast to an integer or another non-string type before transmission, FoxHound would lose track of its taint.
  2. Conceptual Limitations: Beyond implementation specifics, taint tracking inherently struggled with certain scenarios, such as tracking taint flows through HTTP redirects. If an identifier was passed via a redirect mechanism, the taint flow was not preserved, leading to a missed detection.
  • Validation Algorithm for Improved Precision: A significant contribution of this work is the introduction of a validation algorithm specifically designed to enhance the precision of syntactic matching. By applying this algorithm, the researchers were able to filter out many of the false positives generated by raw syntactic matching, leading to a more reliable "confirmed variant" of the technique. This algorithm confirms a syntactic match only if a modified "canary" identifier, introduced into storage, also appears in the corresponding network request.
  • The Power of Hybridization: The most impactful finding points towards a hybrid approach as the optimal solution. By combining the "confirmed variant" of syntactic matching (which benefits from improved precision through validation) with taint tracking, the researchers achieved significant gains in overall detection accuracy. This hybrid method leverages the strengths of both techniques – the broad coverage (after validation) of syntactic matching and the high precision of taint tracking – to minimize both false positives and false negatives more effectively than either technique in isolation. This suggests that a multi-faceted approach is essential for comprehensive web tracking detection.

Technical Deep Dive

▶ Watch: Novel validation algorithm for confirming true positives (7:00)

The core of this research lies in the detailed comparison and methodological improvements to two distinct web tracking detection paradigms: syntactic matching and taint tracking. Understanding their technical underpinnings and the proposed enhancements is crucial for appreciating the study's implications.

Syntactic Matching (SM)

Syntactic matching operates on the principle of identifying patterns. Its implementation in this study represents a generalization and union of existing heuristics found in the literature. The process unfolds in two main steps:

  1. Identifier Generation: The first step involves detecting initial identifiers stored in client-side storage (e.g., document.cookie, localStorage). Once identified, a recursive set of common transformations is applied to these original identifiers. These transformations include, but are not limited to, Base64 encoding, URL encoding, and various forms of hashing or partial obscuration. The goal is to generate a comprehensive list of potential identifier variants that might appear in a network request.
  2. Request Matching: Subsequently, the system parses the components of outgoing network requests (e.g., query parameters, request headers, POST body). It then attempts to match any of the generated identifier variants against these parsed components. For example, if a cookie id=abc is stored, and the system generates id=YWJj (Base64 encoded), it would look for YWJj in query parameters like tracker.com?user=YWJj. A match signifies a potential tracking request.

While conceptually straightforward, the heuristic nature of SM is its Achilles' heel. It can generate false negatives when faced with novel or complex JavaScript-driven transformations that are not part of its predefined heuristic set. Conversely, it can produce false positives if a string in a network request coincidentally matches a transformed identifier variant but was never actually read from storage for tracking purposes.

Taint Tracking (TT)

Taint tracking offers a more robust, principled approach by monitoring the flow of data. The researchers utilized a state-of-the-art engine called FoxHound, which is a heavily modified version of the Firefox browser. This engine allows for granular tracking of information as it moves through the browser's execution environment.

The fundamental operation of taint tracking involves:

  1. Source Identification: Defining "sources" where sensitive information (identifiers) originates. In this context, primary sources include document.cookie and other JavaScript APIs that access client-side storage.
  2. Sink Identification: Defining "sinks" where sensitive information should not legitimately flow without user consent. Network requests, specifically those initiated by fetch() or XMLHttpRequest (XHR), are the primary sinks for tracking.
  3. Information Flow Tracking: FoxHound tracks the "taint" (a marker indicating sensitive data) as it propagates through JavaScript execution. If data read from a source (e.g., document.cookie) is subsequently used in an operation that leads to a sink (e.g., being concatenated into a URL for a fetch request), a taint flow is detected.

A key enhancement implemented by the researchers in FoxHound was byte-level taint tracking. This sophisticated capability allows the system to track the taint on individual bytes of data. This fine-grained control enables differentiation between flows that preserve the "tracking potential" of an identifier and those that do not. For instance, if an identifier ABCD123 is read, and only a single character like A is sent, or if a character A is read and then repeated eight times (AAAAAAAA), byte-level taint tracking can identify that these flows do not constitute a meaningful transmission of the original identifier's entropy, thus reducing false positives that might arise from incidental data flows. This capability is crucial for distinguishing between actual identifier transmission and benign data manipulation.

Despite its precision, taint tracking with FoxHound had limitations, particularly not supporting taint tracking over data types other than strings and failing to track flows through HTTP redirects, leading to its own set of false negatives.

The Comparative Pipeline and Validation Algorithm

To compare these techniques, the researchers devised a meticulous pipeline:

  1. Site List: They started with the Tranco top 10K websites.
  2. Pre-population: A first visit to each site was performed to allow websites to populate client-side storage with identifiers.
  3. Detection Visit: An independent second visit was made to concurrently collect network requests (for SM analysis) and taint flows (for TT analysis). Identifiers were detected using well-known heuristics from literature.
  4. Tracking Request Computation: HTTP requests were processed for syntactic matching, and taint flows for taint tracking, to identify potential tracking requests.
  5. Validation: This crucial final step confirmed or refuted the detected tracking requests, especially those from syntactic matching. The validation algorithm works as follows:
  • For a suspected tracking request (e.g., identified by SM), the original identifier in client storage is modified. This modification involves creating a "canary" – a minimally invasive transformation (e.g., appending a unique string or slightly altering a character) that is unlikely to break the website's functionality but makes the identifier unique.
  • The website is then re-run with this modified client storage.
  • If the "canary" (the modified identifier) subsequently appears in a matching network request, the original request is confirmed as a true positive. If the canary does not appear, the original syntactic match is deemed a false positive. This method is particularly effective at validating whether an identifier was genuinely read from storage and transmitted.

This rigorous methodology, especially the innovative validation algorithm, allowed the researchers to empirically quantify the true positive and false positive rates, leading to the nuanced understanding of each technique's performance and the proposal of a hybrid solution.

Demo / Proof of Concept

▶ Watch: Empirical comparison results: precision and false negatives (8:00)

While the presentation did not feature a live software demonstration in the traditional sense, the entire research methodology and the validation algorithm serve as a sophisticated proof of concept for enhancing the accuracy of web tracking detection. The meticulous pipeline, detailed in the "Technical Deep Dive" section, effectively demonstrates how one can empirically compare and improve these detection techniques.

The canary-based validation algorithm itself is a powerful conceptual and practical proof of concept. By programmatically altering stored identifiers and observing their propagation, the researchers proved a method for definitively confirming whether a syntactically matched string in a network request genuinely originated from client-side storage and was intended for tracking. This technique moves beyond mere pattern matching by introducing an active verification step, establishing a robust mechanism for distinguishing true positives from false positives in heuristic-based detection. The success of this algorithm in refining the precision of syntactic matching underscores its utility as a foundational element for future privacy analysis tools.

Defensive Implications

▶ Watch: Best solution: combining techniques for significant gain (10:00)

The findings of this study carry significant implications for developers of privacy-enhancing technologies (PETs), browser vendors, and security researchers aiming to defend against pervasive web tracking.

Firstly, the research unequivocally demonstrates that relying solely on syntactic matching for web tracking detection is insufficient and prone to significant inaccuracies. The high rate of false positives (27-30%) means that tools based purely on heuristics might over-block or misattribute tracking, leading to user frustration or a false sense of security. Furthermore, its false negatives (17%) imply that many sophisticated tracking mechanisms will simply bypass such defenses. Defenders must acknowledge these limitations and recognize that simple pattern matching is no longer adequate in a dynamic web environment.

Secondly, while taint tracking offers superior precision, its practical implementation challenges and notable false negatives (28%) indicate that even state-of-the-art information flow analysis engines like FoxHound require substantial further development. PET developers considering taint tracking should be aware of current limitations, such as the inability to track non-string data types or flows through HTTP redirects. This highlights a need for continued investment in robust, full-coverage taint tracking engines that can handle the full spectrum of browser operations and data transformations.

Thirdly, the study's most crucial defensive implication is the compelling evidence for a hybrid detection strategy. Combining the validated variant of syntactic matching with taint tracking emerges as the most effective approach to minimize both false positives and false negatives. Defenders should strive to integrate multiple detection methodologies, leveraging the strengths of each. For instance, a system could use validated syntactic matching for its broader (post-validation) coverage and then employ taint tracking for high-precision verification of critical data flows. This multi-layered approach provides a more resilient defense against the evolving tactics of trackers.

Finally, the validation algorithm itself provides a practical technique that can be adopted by developers to refine existing heuristic-based tracking detectors. By implementing a canary-based verification step, developers can significantly improve the precision of their tools, leading to more reliable tracking reports and blocking mechanisms. This method allows for a more confident assertion that a detected "tracking" event is indeed a true positive, thereby increasing the trustworthiness and effectiveness of privacy tools. Ultimately, addressing web tracking effectively requires a sophisticated, adaptive, and hybridized approach that continuously evolves with tracking techniques.

Key Takeaways

  • Syntactic matching is easy but flawed: While simple to implement, syntactic matching suffers from significant false positives (27-30% of its unique detections) and false negatives (missing 17% of actual tracking) due to its heuristic nature and lack of JavaScript logic visibility.
  • Taint tracking offers precision but has limitations: Taint tracking is more precise, with all its unique detections being true positives. However, state-of-the-art engines like FoxHound still produce a notable 28% of false negatives due to implementation issues (e.g., non-string data types) and conceptual gaps (e.g., HTTP redirects).
  • Validation algorithm improves heuristic precision: A novel canary-based validation algorithm can significantly enhance the precision of syntactic matching, confirming true positives and filtering out false positives by actively verifying identifier origins.
  • Hybridization is the optimal solution: The most effective approach for comprehensive web tracking detection is a hybrid strategy that combines the validated variant of syntactic matching with taint tracking, leveraging the strengths of both to minimize overall errors.
  • Current tools need improvement: Existing web tracking detection tools, especially those relying solely on heuristics, are likely inaccurate. There's a strong need for continued research and development to improve taint tracking engines and integrate multi-modal detection strategies.
  • Web tracking detection is complex: The study underscores the intricate nature of web tracking and its detection, necessitating sophisticated, multi-faceted, and empirically validated approaches to effectively protect user privacy.

About the Speaker(s)

The research presented was a collaborative effort by Stefano Calzavara, Samuele Casarin, Marco Squarcina, and Matteo Maffei. Stefano Calzavara and Samuele Casarin are affiliated with the Università Ca' Foscari Venezia, with Samuele Casarin also associated with Scuola IMT Alti Studi Lucca. Marco Squarcina and Matteo Maffei are researchers at TU Wien. Collectively, they represent a group of academic researchers with expertise in computer science, security, and privacy, focusing on areas such as web tracking detection, information flow analysis, and the empirical evaluation of privacy-enhancing technologies. Their work contributes significantly to understanding and mitigating the complex challenges of online privacy.

Reviews

Dr. Zero (Offensive Security Researcher) — MUST SEE

This is what academic security research should look like. No hype, just a brutal empirical takedown of how we currently detect web trackers, quantifying exactly how bad both regex heuristics and dynamic analysis actually are in the wild. They built a slick canary validation trick that privacy extension developers can and should steal tomorrow.

Heather Calloway (CISO) — SOLID

This is academic research evaluating the core detection engines behind web privacy scanners, proving that most heuristic-based tools are fundamentally inaccurate. While your security engineering team doesn't need to rebuild these engines, your privacy counsel and procurement teams need to understand that the tools they use to audit your web footprint are likely feeding them bad data.

→ Top-rated talks at Privacy Enhancing Technologies Symposium (PETS) 2026

All talks from Privacy Enhancing Technologies Symposium (PETS) 2026