{'fraction_non_alphanumeric': 0.03335337601245004, 'fraction_numerical': 0.008683195982032328, 'mean_word_length': 4.693415223519936, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The TV is Smart and Full of Trackers: Towards Understanding the Smart TV Advertising and Tracking Ecosystem

Motivated by the growing popularity of smart TVs, we present a large-scale measurement study of smart TVs by collecting and analyzing their network traffic from two different vantage points. First, we analyze aggregate network traffic of smart TVs in-the-wild, collected from residential gateways of tens of homes and several different smart TV platforms, including Apple, Samsung, Roku, and Chromecast. In addition to accessing video streaming and cloud services, we find that smart TVs frequently connect to well-known as well as platform-specific advertising and tracking services (ATS). Second, we instrument Roku and Amazon Fire TV, two popular smart TV platforms, by setting up a controlled testbed to systematically exercise the top-1000 apps on each platform, and analyze their network traffic at the granularity of the individual apps. We again find that smart TV apps connect to a wide range of ATS, and that the key players of the ATS ecosystems of the two platforms are different from each other and from that of the mobile platform. Third, we evaluate the (in)effectiveness of state-of-the-art DNS-based blocklists in filtering advertising and tracking traffic for smart TVs. We find that personally identifiable information (PII) is exfiltrated to platform-related Internet endpoints and third parties, and that blocklists are generally better at preventing exposure of PII to third parties than to platform-related endpoints. Our work demonstrates the segmentation of the smart TV ATS ecosystem across platforms and its differences from the mobile ATS ecosystem, thus motivating the need for designing privacy-enhancing tools specifically for each smart TV platform.


Introduction
Smart TV adoption has steadily grown over the last few years, with more than 37% of US households with at least one smart TV in 2018 which is a 16% increase over 2017 [1]. The growth in smart TV is driven by two trends. First, over-the top (OTT) video streaming services such as Netflix and Hulu have become quite popular, with more than 60 million and 28 million subscribers in the US, respectively [2]. Second, smart TV solutions are available at relatively affordable prices, with many of the external smart TV boxes/sticks priced less than $50 and built-in smart TVs priced on the order of hundreds of dollars [3]. A diverse set of platforms, each with their own app store, are used by different smart TV products such as tvOS (Apple), Roku (Roku, TCL, Sharp), Android (Sony, Fire TV), Smart-Cast/Cast (Vizio, Chromecast), webOS (LG), etc.
The vast majority of smart TV apps are ad-supported [4]. OTT advertising, which includes smart TV, is expected to increase by 40% to $2 billion in 2018 [5]. Roku and Fire TV are two of the leading smart TV platforms in number of ad requests [6]. Despite their increasing popularity, the advertising and tracking services ("ATS") on smart TV is currently not well understood by users, researchers, and regulators. In this paper, we present a large-scale study of the smart TV advertising and tracking (ATS) ecosystem.
In the Wild Measurements ( §3). First, we analyze the network traffic of smart TV devices in-the-wild. We instrument residential gateways of 41 homes and collect flow-level summary logs of the network traffic generated by 57 smart TVs from 7 different platforms. The comparative analysis of network traffic by different smart TV platforms uncovers similarities and differences in their characteristics. As expected, we find that a substantial fraction of the traffic is related to popular video streaming services such as Netflix and Hulu. More importantly, we find generic as well as platform-specific advertising and tracking services. Although realistic, the in-thewild dataset does not provide app-level visibility, i.e. we cannot determine which apps generate ATS traffic. To address this limitation, we undertake the following major effort.
Controlled Testbed Measurements ( §4). We instrument and systematically study two popular smart TV platforms in a controlled environment. Specifically, we design and implement Rokustic for Roku  for systematically exercising apps and collecting their network traffic. Using our tools, we analyze the top-1000 apps on Roku and Fire TV, w.r.t. the top destinations contacted by those apps, at the granularity of fully qualified domain names (FQDNs), effective second level domains (eSLDs), and organizations. We use "domain (name)" or "endpoint" interchangably in place of FQDN and eSLD. We further distinguish between first-party, third-party, and platform destinations, w.r.t. to the app that contacted them. First, we find that certain platform-specific ATS, such as logs.roku.com for Roku and amazon-adsystem.com for Fire TV, are used by the vast majority of apps. We also observe several third-party ATS, such as doubleclick.net and scorecardresearch.com, which are prevalent across many apps. Second, we find that the same apps across different platforms (Roku vs. Fire TV) have little overlap in terms of the endpoints they contact, which highlights the segmentation of smart TV platforms. Third, we compare the smart TV platforms' ATS ecosystems to that of Android [7], and identify differences in terms of their key players.
Evaluation of DNS-Based Blocklists ( §5). Since it is typically not viable to directly install ad/tracker blocking apps on smart TV platforms, smart TV users have to rely on DNSbased blocking solutions such as Pi-hole [8]. We are interested in evaluating the effectiveness of well-known DNSbased blocklists in blocking advertising and tracking (ATS) domains accessed by different smart TV apps. To that end, we examine and test four blocklists: (1) Pi-hole Default blocklist (PD) [8], (2) Firebog's recommended advertising and tracking lists (TF) [9], (3) Mother of all Ad-Blocking (MoaAB) [10], and (4) StopAd's smart TV specific blocklist (SATV) [11]. Our comparative analysis shows that block rates vary across different blocklists, with Firebog blocking the most and StopAd blocking the least. We further evaluate and discuss the false negatives (FN) and false positives (FP). We find that blocklists miss different ATS (FN), some of which are missed by all of the blocklists, while more aggressive blocklists suffer from FP that result in breaking app functionality. We also identified many instances of PII exfiltration, not only to third party ATS, but also to platform-specific endpoints, most of which seem unrelated to the core functionality of the app. Existing block lists seem more successful at blocking PII exfiltration to third parties than to platform-specific endpoints.
Outline and Contributions. The structure of the rest of the paper is as follows. Section 2 provides background on smart TVs and reviews closely related work. Section 3 presents the in-the-wild measurement and analysis of 57 smart TVs from 7 different platforms in 41 homes. Section 4 presents the systematic testing and analysis of the top-1000 Roku and Fire TV apps. Section 5 evaluates four well-known DNS-based blocklists and show their limitations, including exfiltration of PIIs. Section 6 concludes the paper and outlines directions for future work. The appendix provides additional graphs and details.
In summary, we perform a large-scale measurement study of the smart TV advertising and tracking (ATS) ecosystem. Our work demonstrates the segmentation across smart TV platforms, limitations of current DNS-based blocklists and differences from mobile ATS. This motivates the need for further research on developing privacy-enhancing solutions specifically designed for each smart TV platform. We plan to make our automated testing tools (Rokustic and Firetastic) and collected datasets available to the community.

Background & Related Work
Background on Smart TVs. A smart TV is essentially an Internet-connected TV that has apps for users to stream content, play games, and even browse the web. There are two types of smart TV products in the market: (1) built-in smart TVs, and (2) external smart TV box/stick. On one hand, TV manufacturers such as Samsung and Sony now offer TVs with built-in smart TV functionality. On the other hand, several external box/stick solutions such as Roku (by Roku), Fire TV (by Amazon), Apple TV (by Apple), and Chromecast (by Google) are available to convert a regular TV into a smart TV. Some TV manufacturers have started to integrate external box/stick solutions into their smart TVs. For example, TCL and Sharp offer smart TVs that integrate Roku TV while Insignia and Toshiba offer Fire TV instead within their smart TVs.
There is a diverse set of smart TV platforms, each with its own set of apps that users can install on their TVs. Many smart TVs use an Android-based operating system (e.g. Sony, AirTV, Philips) or a modified version of it (e.g. Fire TV). Regular Android TVs have access to apps from the Google Play Store, while Fire TV has its own app store controlled by Amazon. In both cases, applications for such TVs are built in a manner similar to regular Android applications. Likewise, Apple TV apps are built using technologies and frameworks that are also available for iOS apps, and both types of apps can be downloaded from Apple's App Store.
Some smart TV platforms are fairly distinct as compared to traditional Android or iOS. For example, Samsung smart TV apps are built for their own custom platform called Tizen and are downloadable from the Tizen app store. Likewise, applications for the Roku platform are built using a customized language called BrightScript, and are accessible via the Roku channel store. Yet another line of smart TVs such as LG smart TV and Hybrid broadcast broadband TV (HbbTV) follow a web-based ecosystem where applications are developed using HTML, CSS, and JavaScript. Finally, some smart TV plat-forms do not have app stores of their own, but are only meant to "cast" content from other devices such as smartphones. For instance, Chromecast provides users the ability to stream content from their mobile device or laptop to their TV.
As with mobile apps, smart TV apps can integrate thirdparty libraries and services, often for advertising and tracking purposes. Serving advertisements is one of the main ways for smart TV platforms and app developers to generate revenue [4]. Roku and Fire TV are two of the leading ad-supported smart TV platforms [6]. Roku's advertising revenue exceeded $250 million in 2018 and is expected to more than double by 2020 [12]. Both Roku and Fire TV take 30% cut of the advertising revenue from apps on their platforms [13]. Smart TV advertising ecosystem mirrors many aspects of the vanilla web advertising ecosystem. Most importantly, smart TV advertising uses programmatic mechanisms that allow apps to sell their ad inventory in an automated fashion using behavioral targeting [14,15].
The rapidly growing smart TV advertising and associated tracking ecosystem has already warranted privacy and security investigations into different smart TV platforms. Consumer Reports examined privacy policies of various smart TV platforms including Roku, LG, Sony, and Vizio [16]. They found that privacy policies are often challenging to understand and it is difficult for users to opt out of different types of tracking. For instance, many smart TVs use Automatic Content Recognition (ACR) to track their users' viewing data and use it to serve targeted ads [17]. Vizio paid $2.2 million to settle the charges by the Federal Trade Commission (FTC) that they were using ACR to track users' viewing data without their knowledge or consent [18]. While smart TV platforms now allow users to opt-out of such tracking, it is not straightforward for users to turn it off [19]. Further, even with ACR turned off, users still must agree to a basic privacy policy that asks for the right to collect data about users' location, choice of apps, etc.
Related Work. While the desktop [20][21][22] and mobile [7,23,24] ATS ecosystems have been thoroughly studied, the smart TV ATS ecosystem has not been examined at scale until recently. Concurrently with our work, three other papers also studied the network behavior and privacy implications of smart TVs [25][26][27]. Ren et al. [25] studied a large set of IoT devices, spanning multiple device categories. Their results showed that smart TVs were the category of devices that contacted the largest number of third parties, which further motivates our in-depth study of the smart TV ATS ecosystem. Huang et al. [26] used crowdsourcing to collect network traffic for IoT devices in the wild and showed that smart TVs contact many trackers by matching the contacted domains against the Disconnect blocklist. Finally, and most closely related to our work, Moghaddam et al. [27] also instrumented the Roku and Fire TV platforms to map the ATS endpoints contacted by the top-1000 apps of each platform, as well as the exposure of PII. Our work combines the individual merits of these concurrent works, providing a holistic view of the smart TV ATS ecosystem by analyzing a total of eight different smart TV platforms in-the-wild and in-depth in the lab. We further contribute to this existing literature along two fronts: First, we show that even the same app across different smart TV platforms contact different ATS, which shows the fragmentation of the smart TV ATS ecosystem. Second, we evaluate the effectiveness of different sets of blocklists, including a smart TV specific blocklist, in terms of their ability to prevent ads as well as their adverse effects on app functionality. In addition to blocklist evaluation, we also suggest ways to aid blocklist curation through analysis of app prevalence and PII exposures.
Earlier work in this space include that of Ghiglieri and Tews [28], who studied how broadcasting stations could track viewing behavior of users in the HbbTV platform. In contrast to the rich app-based platforms we study, the HbbTV platform studied in [28] contained only one HbbTV app that uses HTML5-based overlays to provide interactive content. Related to our work, they found that the HbbTV app loaded third-party tracking scripts from Google Analytics. Malkin et al. [29] surveyed 591 U.S. Internet users about their expectations on data collection by smart TVs. They found that users would rather enjoy new technology than worry about privacy, and users thus over rely on existing laws and regulations to protect their data.

Smart TV Traffic in the Wild
Data Collection. To study smart TV traffic characteristics in the wild, we monitor network traffic of 41 homes in a major metropolitan area in the United States. We sniff network traffic  of smart TV devices at the residential gateways using off-theshelf OpenWRT-capable commodity routers. We collect flowlevel summary information for network traffic. For each flow, we collect its start time, FQDN of the external endpoint (using DNS), and the internal device identifier. We identify smart TVs using heuristics that rely on DNS, DHCP, and SSDP traffic and also manually verify the identified smart TVs by contacting users. Our data collection covers a total of 57 smart TVs across 41 homes over the duration of approximately 3 weeks in 2018. Note that we obtained written consent from users, informing them of our data collection and research objectives, in accordance with our institution's IRB guidelines.
Dataset Statistics. Table 1 lists basic statistics of smart TV devices observed in our dataset. Overall, we note 57 smart TVs from 7 different vendors/platforms using a variety of technologies such as Apple TV (tvOS), Samsung Smart TV (Tizen), Google Chromecast (Cast SDK), Roku (standalone TV and HDMI sticks), Vizio (SmartCast based on Chromecast), LG Smart TV (webOS), and Sony Smart TV (Android). These smart TV devices account for substantial traffic both in terms of number and volume of traffic flows. We indeed expect smart TV devices to generate significant traffic because they are typically used for OTT video streaming [30]. First, we note that all smart TV devices generate tens of thousands of traffic flows on average. Chromecast devices generate the highest number of flows (exceeding 200 thousand flows) on average. Samsung, Apple, Roku, and Vizio devices generate nearly 50 thousand flows on average. Second, we note a similar trend for average flow volume. Roku devices generate the highest volume of flow (exceeding 80 GB) on average, with one Roku device generating as much as 283 GB. Except for LG and Sony devices, all smart TV devices generate at least tens of GBs worth of traffic on average. Finally, we also note that smart TV devices typically connect to hundreds of different endpoints on average. As we discuss next, smart TV devices connect to a variety of endpoints for video streaming and related functionality.
Endpoint Analysis. Fig. 1 plots the top-30 FQDNs in terms of flow count for Roku, Apple, Sony, and Samsung smart TV platforms. The plots for the remaining smart TV platforms are in Appendix A. We notice several similarities in the domains accessed by different smart TV devices. First, as expected, we note that popular video streaming services such as Netflix and Hulu are popular across the board. For example, domains such as api-global.netflix.com and vortex.hulu.com appear for different smart TV platforms. Second, we note that cloud/CDN services such as Akamai and AWS (Amazon) also appear for different smart TV platforms. For example, domains such as *.akamai*.net and *.amazonaws.com appear across most smart TVs. Smart TVs likely connect to cloud/CDN services because popular video streaming services such as Netlifx typically rely on third party CDNs [31,32]. Third, we note the prevalence of well-known advertising and tracking services (ATS). For example, *.scorecardresearch. com and *.newrelic.com are well-known third-party tracking services, and pubads.g.doubleclick.net is a well-known thirdparty advertising service.
We notice several platform-specific differences in the domains accessed by different smart TV platforms. For example, giga.logs.roku.com (Roku), time-ios.apple.com (Apple), hh.prod.sonyentertainmentnetwork.com (Sony), and logingestion.samsungacr.com (Samsung) are unique to different types of smart TVs. In addition, we notice platformspecific ATS. For example, the following advertising-related domains are not in the top-30 (and therefore not pictured in Fig. 1), but are unique to different smart TV platforms: p.ads.roku.com (Roku), ads.samsungads.com (Samsung), and us.info.lgsmartad.com (LG).
Organizational Analysis. To understand the role of different parent organizations within each smart TV platform, we map each FQDN to its effective second level domain (eSLD) using Mozilla's Public Suffix List [33,34]. We then use Crunchbase [35] to find the organization name and follow Crunchbase's acquisition and sub-organization information to find the ultimate parent company. For example, hulu.com belongs to the Walt Disney Company and youtube.com belongs to Alphabet.  Takeaway & Limitations. Traffic analysis of different smart TV platforms in the wild highlights interesting similarities and differences. As expected, all devices generate traffic related to popular video streaming services. In addition, they also access advertising and tracking services (ATS), both well-known and platform-specific. While our vantage point at the residential gateway provides a real-world view of how smart TV devices behavior, it lacks granular information beyond flows (e.g., packet-level information) and the specific apps that generate the traffic. Another limitation of in the wild analysis is that our findings may be biased by the viewing habits of users in these 41 households. It is not clear how to normalize our analysis to provide a fair comparison of endpoints accessed by different smart TV platforms. We address these limitations next by systematically analyzing two popular smart TV platforms in a controlled testbed.

Systematic Testing of the Roku and Fire TV Platforms
In this section, we focus on two of the popular smart TV platforms, namely Roku and Amazon Fire TV. Sections 4.1 and 4.2 present our measurement approach for systematically testing approximately 1000 apps in each platform while collecting their network traffic 1 . Our measurement approaches enables us to automatically test a large number of apps. More importantly, it provides visibility into the behaviors of individual apps, which was not possible from the vantage point used for the in-the-wild dataset in the previous section. In Sections 4.3 and 4.4, we summarize and analyze the two datasets, and compare them to each other as well as to the in-the-wild datasets of the previous section, and to the Android ATS ecosystem [7].

Roku Data Collection
In this section, we first present an overview of the Roku platform. Next, we present our app selection method. We then proceed to describe Rokustic-the software tool we wrote for automatically exercising Roku apps. The data resulting from exercising 1044 Roku apps provides insight into what ATS are most prevalent on the Roku platform.
Roku Platform. We start by describing the Roku TV (referred to as Roku for the rest of the paper) platform, which has its own app store that offers more than 8500 apps, called "channels". We will use the terms "apps" and "channels" interchangeably for the rest of the paper. For security purposes, Roku sandboxes each app (apps are not allowed to interact or access the data of other apps) and provides limited access to system resources [36]. Furthermore, Roku apps cannot run in the background. Specifically, app scripts are only executed when the user selects a particular app, and when the user exits, the script is halted, and the system resumes control [37].
To display ads, apps typically rely on the Roku Advertising Framework which is integrated into the Roku SDK [38]. The framework allows developers to use ad servers of their preference and updates automatically without requiring the developer to rebuild the app. Even though such a framework eliminates the need for third party ATS libraries, the development and usage of such libraries is still possible. For example, the Ooyala IQ SDK [39] provides various analytics services that can be integrated into a Roku app. Thus, although the Roku sandboxes apps, such libraries can help ATS servers learn the viewing habits of users by collecting data from multiple apps. In terms of permissions, Roku only protects microphone access with a permission and does not require any permission to access the advertising ID. Users can choose to reset this ID and opt-out of targeted advertising at any time [38]. However, apps and libraries can easily create other IDs or use fingerprinting techniques to continue tracking users even after opt-out.
App Selection. The Roku Channel Store [40] (RCS) provides a web interface for browsing the set of available Roku apps, and allows for "one-click" installation of Roku apps on Roku devices linked to a Roku user account. To the best of our knowledge, Roku does not provide any public documentation on how to query the RCS in a programmatic way. We therefore reverse-engineered the REST API that provides the data to the RCS web interface by inspecting the HTTP(S) requests sent by the browser while manually browsing the RCS. Using this insight, we wrote a script that crawls the RCS for the metadata of all Roku apps. The script first issues an API call to fetch all app categories. Next, for each category, it performs a series of API calls to determine the app IDs of all apps in that category. Finally, for each app ID, an API call is made to fetch the full metadata for that app. At the time of writing, this resulted in a total of 8,515 different Roku apps.
To ensure that we test the most relevant apps, we selected the top 50 apps in 30 out of the total 32 categories. We excluded "Themes" and "Screensavers" since these apps do not show up among the regular apps on the Roku device and therefore cannot be operated using our automation software described below. Since statistics for the number of downloads or installs are not provided by Roku, we based our selection on the "star rating count"-which we interpret as the review count-present in the metadata extracted from the RCS. Note that Roku apps can be labeled with multiple categories, meaning some apps contribute to the top 50 of multiple categories. Furthermore, some categories contain fewer than 50 apps, a handful of apps could not be installed due to incompatibility with the Roku Express (Roku offers a range of more capable devices), and about a dozen of apps had to be discarded due to failure during automation. This places the final count of apps in our dataset at 1044.
Automation (Rokustic). To scale testing of apps, we implement a software system, Rokustic, that automatically installs and exercises a given set of Roku apps.
Setup and Network Traffic capture. We run Rokustic on a Raspberry Pi 3 Model B+ set up to host a standalone network as per the instructions given in [41]. The Pi's wlan0 interface is configured as a wireless access point with DHCP server and NAT, and the Roku Express is connected to this local wireless network. The Pi's eth0 interface connects the Pi and the Roku Express to the WAN. This setup enables us to collect all traffic going in and out of the Roku Express by running tcpdump on the Raspberry Pi's wlan0 interface.
App Exploration. From manual inspection of a few apps (e.g. YouTube and Pluto TV), we found that playable content is often presented in a grid, where each cell is a different video or live TV channel. Generally, the user interface defaults to highlighting one of these cells (e.g., the first recommended video). Pressing "SELECT" on the Roku remote immediately after the app has launched will therefore result in playback of some content. From this insight, we devised a simple algorithm that attempts to cause playback of three different videos for each installed Roku app. Due to lack of space, we only provide an overview below, but we plan to make the tool publicly available. The algorithm utilizes the Roku External Control Protocol (ECP) API [42] to mimic a user's interaction with each Roku app. The ECP turns the Roku into an HTTP-server with a REST-like API. The API includes an endpoint for each key on the physical Roku remote. This allows us to send virtual key presses to the Roku. We combine this with the ECP endpoint that allows for querying the Roku device for its set of installed apps, as well as the endpoint that launches a specific app, to cycle through and exercise all installed apps.
Putting it all together. For each Roku app, the algorithm first starts a packet capture so as to produce a .pcap file for each Roku app, thereby essentially labeling traffic with the app that caused it. Since Roku does not allow apps to execute in the background (see "Roku Platform" earlier in this section), all traffic captured during execution of a single app will belong to that app and the Roku system. The target app is then launched, and the algorithm pauses, waiting for the app to load. A virtual "SELECT" key press is then sent to start video playback, and the algorithm subsequently pauses for five minutes to let the content play. The app is then relaunched by returning to the Roku's home screen and then launching the app again. A different video/live TV channel is then selected by sending a sequence of navigational key presses followed by a "SELECT" key press, and the algorithm waits another five minutes for the content to play. We perform two such relaunches, making the total interaction time with each app approximately 16 minutes (due to sleep timers).

Fire TV Data Collection
In this section, we first briefly describe the Fire TV platform. We then describe Firetastic-our automated methodology for systematically testing and collecting traffic from 1010 Fire TV apps. The dataset reveals properties of ATS for Fire TV devices and its analysis is deferred to Sections 4.3 and 4.4.
Fire TV Platform. Although Fire TV is made by Amazon, its underlying operating system, Fire OS, is a modified version of Android. This allows apps for Fire TV to be developed in a similar fashion to Android apps. Therefore, all third-party libraries that are available for Android apps can also be integrated into Fire TV apps. Similarly, application sandboxing and permissions in Fire TV are analogous to that of Android, and any permission requested by the app is inherited by all libraries that the app includes. This allows third-party libraries to track users across apps using a variety of identifiers, such as Advertising ID, Serial Number, Device ID, and Account Names, etc. We further discuss tracking through PII exposure in Section 5.3.
App Selection. Amazon's app store promotes apps with a curated list of Top Featured apps. Our data collection depends on this list to determine the relevant applications to test for Fire TV. Using the store's web interface, which allows installations of apps in one click, we manually install 1010 apps in batches of 50. Amazon's app store had around 4,000 free apps at the time of writing, thus our dataset covers approximately 25%. Along the way, we ignore some apps that use a local VPN, that could not be installed manually, and utility apps that can change the device settings (which would affect the test environment). As a result, we ignored around 200 apps while collecting 1010 testable applications.
Automation (Firetastic). To scale testing of Fire TV apps, we build a software tool, Firetastic, that integrates the capabilities of two open source tools for Android: an SDK for network traffic collection [43,44] and a tool for input automation [45].
On-Device Network Traffic Collection. Since Fire TV is based on Android, we can use existing Android tools to capture network traffic. Although there are various methods for capturing traffic on Android on the smartTV device itself (e.g. androidtcpdump [46]), most of them require a rooted device. While it is possible to root a Fire TV, it may make applications behave differently if they detect root. Thus, to collect measurements that are representative of an average user, we use a VPN-based traffic interception method that does not require rooting the device. Specifically, we used an open-source VPN-based library [43,44] to intercept all incoming and outgoing network traffic (including decrypting TLS connections) from the Fire TV while labeling each packet with the package name of the application that generated it. In addition, we monitor network traffic from system applications to learn how the device behaves with each different application.
App Exploration. To automatically explore each Fire TV application, we utilize [45], a Python application that sends commands to an Android device via the Android Debug Bridge (ADB) to simulate inputs such as pressing buttons, input text in a search box, or selecting a video to play. It does not require rooting the device and is easily customizable. This tool is ideal for testing Fire TV applications because it treats each application as a tree of possible paths to explore instead of randomly generating events. We configured it to utilize its breadth first search algorithm to explore each application, and ensure various videos and ads would be played. Furthermore, we deduce that developers would minimize the necessary clicks in order to reach the core sections of their applications, especially for playing video content. With some trial and error, we selected the input command interval as three seconds which leaves enough time for applications to handle the command and load the next view during app exploration.
Putting it all together. In summary, Firetastic does the following for each app: (1) it starts the local VPN, (2) explores the app for 15 minutes, (3) stops the local VPN, and (4) extracts the .pcapng files that were generated during testing. We use Firetastic to do testing in parallel with six Fire TV devices. Our test setup is resource-efficient and scalable: we use only one computer to send commands to multiple (6 in our experiments) Fire TV devices, and we are able to collect network traffic data for 1010 apps within a one week period.

Comparing Roku and Fire TV
Overview. We start by summarizing the datasets collected using Rokustic and Firetastic in Table 2. Since these datasets provide app-level granularity, we report the number of FQDNs and URL paths that are contacted by one or multiple apps. For Roku, we find 2191 distinct FQDNs, 699 of which are contacted by more than one app. For Fire TV, we find 1734 distinct FQDNs, 603 of which are contacted by multiple apps. We also find 578 FQDNs that appear in both datasets, 199 of which are contacted by more than one app.
Categorizing Destinations. The app-level visibility also enables us to categorize Internet destinations where packets are sent to as first party, third party, or platform party, by comparing that destination with the app that generated the packet. To this end, we first map FQDNs to eSLDs using Mozilla's Public Suffix List [33,34] and then categorize each eSLD as first party, third party, or platform party as follows: 1. We first tokenize app identifiers and eSLDs. For Fire TV, we tokenize the package names while relying on app and developer names for Roku since its apps do not have package names. 2. We then match the app's tokenized identifier against the tokenized eSLD. In doing so, we ignore common tokens or platform-specific strings like "com", "firetv", "roku" "free", "paid" etc. If the tokens match, we label the eSLD as first party. If the tokens do not match, and if the eSLD  [53][54][55], or if it is blocked by any of the block lists considered in Section 5. We note that both platforms use distinct third party ATS. For example, Fig. 3c shows that SpotX (spotxchange.com), which serves video ads, is a significant player in the Roku ATS space with 17% app penetration, but only maintains 1% app penetration for Fire TV. Even when considering the smaller players, we see little overlap between the two platforms, suggesting these players focus their efforts on a single platform. For example, Kantar Group's insightexpressai.com analytics service has 7% app penetration on the Roku platform, but only 0.01% on the Fire TV platform.
Comparing to Android ATS Ecosystem. Next, we compare the top-20 third party ATS endpoints in our Roku and Fire TV datasets (Figs. 3c and 4c) with those reported for Android [7]. Roku vs. Android. The key third party ATS players in Roku (Fig. 3c) differ substantially from the Android platform: the only overlapping FQDNs are Alphabet's endpoints such as tpc.googlesyndication.com and subdomains of doubleclick.net. While Alphabet has a strong foothold in both Roku and Android ATS ecosystems, it is less significant for Roku (9 out 20 of the top Roku third party ATS FQDNs are Alphabet-owned, vs. 16 out of 20 for Android). Furthermore, Facebook is a key player in the Android ATS ecosystem (graph.facebook.com is the second most popular ATS domain), but has close to zero ATS presence on the Roku platform; while SpotX (*.spotxchange.com) has a strong presence on Roku but is not among the key players for Android. Similarly, comScore's tracking service *.scorecardresearch.com is a key player for Roku, but is absent for Android. In contrast to the top ATS for Android, the set of top third party ATS in Roku is more diverse and includes smaller organizations such as Pixalate (adrta.com), Telaria (*.tremorhub.com), Barons Media (ctv.monarchards.com), and The Trade Desk (insight.adsrvr.org).
Fire TV vs. Android. In contrast to Roku, Fire TV is much more similar to Android: we see an overlap of 9 FQDNs, 7 of which are owned by Alphabet. This is to be expected, given that Fire TV is based off of Android, and thus natively supports the ATS services of Android. For example, the Alphabet-owned analytics service Crashlytics, which is supported on Android, iOS and Unity, is widely in use on both Fire TV and Android, but is completely absent on Roku. In contrast to Roku, Facebook (graph.facebook.com) and Verizon (data.flurry.com) both have a strong presence on both Fire TV and Android. Some of the third party ATS observed for Fire TV, which were not present for Android, include com- Score (*.scorecardresearch.com), Adobe (dpm.demdex.net), and Amazon (applab-sdk.amazon.com).
Parent Organization Analysis. We further analyze the parent organizations for Roku and Fire TV third party ATS endpoints in Fig. 5 using the method described earlier in Section 3. Interestingly, the set of top third party organizations is rather diverse, with only a slight overlap in the shape of Adobe Systems and comScore, possibly suggesting that the remaining organizations focus their efforts on a single platform. Fire TV shows Unity Tech and Facebook, suggesting that the platform has more popular gaming and social applications. On the other hand, Roku has more video content related ads being served from the Trading Desk, Telaria, and RTL Group. Similar to inthe-wild organization analysis in Fig 2, we again note that Alphabet dominates third party ATS on both Roku and Fire TV.

Takeaway.
The key players of the Roku and Fire TV ATS ecosystems differ substantially. For example, SpotX is a relatively large player on Roku, but is almost absent from Fire TV. In contrast, Facebook has almost zero presence on Roku, but has a reasonable foothold on Fire TV. The exception is Alphabet, which has a strong ATS presence on both platforms. The key ATS players on Android have little overlap with Roku but substantial overlap with Fire TV, which is built on top of Android. Building on our findings, we present insights for identifying platform-specific ATS endpoints in Section 5.  Fig. 6. Top-60 common apps (apps present in both testbed datasets) ordered by the number of hostnames that each app contacts. Considering all common apps, there are 597 hostnames which are exclusive to Roku apps, 496 hostnames which are exclusive to Fire TV apps, and 155 hostnames which are contacted by both the Roku and the Fire TV version of the same app.

Common Apps in Roku and Fire TV
Next, we compare the ATS ecosystems of Roku and Fire TV at the app-level by analyzing the traffic generated by the set of apps that appear on both platforms, referred to as common apps. Recall from Table 2 that the datasets collected using Rokustic and Firetastic contain a total of 128 common apps. We identified common apps by fuzzy matching app names since they sometimes vary slightly for each platform (e.g., "TechSmart.tv" on Roku vs. "TechSmart" on Fire TV). We further cross-referenced with the developer's name to validate that the apps were indeed the same (e.g., both TechSmart apps are created by "Future Today"). We examine the overlapping and non-overlapping sets of endpoints contacted by the common apps. The 128 common apps contact a total of 1248 different FQDNs. Out of these, 597 FQDNs are exclusively contacted by Roku apps, 496 are exclusively contacted by Fire TV apps, and only 155 FQDNs are contacted by both Roku and Fire TV apps. These numbers already suggest that the two ecosystems differ substantially even for the common apps. Figure 6 reports overlapping and non-overlapping FQDN for the top-60 common apps (in terms of the number of distinct FQDNs that each app contacts). In general, the set of FQDNs contacted by both the Roku and the Fire TV versions of the same app is much smaller than the set of platformspecific FQDNs. From inspecting the common FQDNs for the apps in Fig. 6, we find that these generally include endpoints that serve content. For example, for Mediterranean Food, the only two common hostnames are subdomains of ifood.tv, which belong to the parent organization behind the app. This makes intuitive sense as the same app presumably offers the same content on both platforms and must therefore access the same servers to download said content. On the other hand, the platform-specific hostnames contain obvious ATS endpoints such as ads.yahoo.com and ads.stickyadstv. com for the Roku version of the app, and aax-us-east.amazonadsystem.com and mobileanalytics.us-east-1.amazonaws.com for the Fire TV version of the app. In conclusion, our analysis of common apps that are present on both platforms reveals (to our surprise) little overlap in the ATS endpoints they access, which further highlights the distinct nature of the ATS ecosystems of the two platforms.

Blocklists for Smart TVs
In this section, we are interested in detecting and mitigating ATS in the smart TV ecosystem, using blocklists. First, we evaluate four well-known DNS-based blocklists and demonstrate their ineffectiveness in blocking traffic towards ATS and preventing PII exfiltration, across different smart TV platforms. Then, we provide insights and directions for improvement of blocklist curation specifically for smart TVs.

Evaluating Popular DNS Blocklists
Note that unlike on-device blocking solutions that are readily available for the desktop and mobile ecosystems [56], it is generally not feasible to install ad/tracker blocking solutions directly on smart TVs. DNS-based blocking solutions such as Pi-hole [8] are typically used to block advertising and tracking traffic from non-traditional devices in a smart home, including smart TVs [57]. To block advertising and tracking traffic, they essentially "blackhole" DNS requests to known advertising and tracking domains. Specifically, they match the domain name in a DNS request against a set of blocklists that are essentially curated hosts files that contain rules for well-known advertising and tracking services. We note that the well-known EasyList [58] contains regular expressions that do fine-grained matching against URLs in HTTP requests. In contrast, the hosts files are limited to coarse-grained matching against domain names in DNS requests. If the domain name is found in one of the blocklists, it is typically mapped to 0.0.0.0 or 127.0.0.1 to prevent outbound traffic to that domain [59].
Setup. We evaluate the following blocklists: 1. Pi-hole Default (PD): We test blocklists included in Pihole's default configuration [60] [11]. This list particularly targets Android based smart TV platforms such as Fire TV. We extract StopAd's list by analyzing its APK using Android Studio's APK Analyzer [61]. StopAd contains a total of about 3K entries.
We applied the aforementioned blocklists to both our in-thewild and testbed datasets, discussed in the previous sections, and we report the results next.
Block Rates. We start our analysis by comparing how much is blocked by different sets of blocklists.  We first systematically quantify visually observable false positives and false negatives of blocklists by interacting with a sample of apps from our testbed datasets and manually coding for presence of ads and app breakage. We sample 10 Roku apps and 10 Fire TV apps, including the top-4 free apps, three apps that are present on both platforms, and an additional three randomly selected apps. We test each app five times: one time without any blocklist and four times where we individually deploy each of the aforementioned blocklists. During each experiment, we attempt to trigger ads by playing multiple videos and/or live TV channels and fast-forwarding through video content, and we take note of any visually observable functionality breakage (due to false positives) and missed ATS (due to false negatives). We differentiate between minor and major functionality breakage as follows: minor breakage when the app's main content remains available but the application suffers from minor user interface glitches or occasional freezes; and major breakage when the app's content becomes completely unavailable or the app fails to launch.
Functionality Breakage vs. Missed ATS. Table 4 summarizes the results of our manual analysis for functionality breakage and missed ads. No missed ads is indicated using a check mark and missed ads is indicated using a cross. No breakage is indicated using a check mark, minor breakage is indicated using a cross, and major breakage is indicated using a bolded  Table 4. Missed ATS and functionality breakage for different blocklists when employed during manual interaction with 10 Roku apps and 10 Fire TV apps. For "No Ads", a checkmark ( ) indicates that no ads were shown during the experiment, a cross () indicates that some ad(s) appeared during the experiment, and a dash (-) indicates that breakage prevented interaction with the app altogether. For "No Breakage", a checkmark ( ) indicates that the app functioned correctly, a cross () indicates minor breakage, and a bold cross () indicates major breakage.
cross. Overall, we find that none of the blocklists are able to block ads from all of the sampled apps while avoiding breakage. In particular, none of the blocklists are able to block ads in YouTube and Pluto TV (available on both Roku and Fire TV). Across different lists, PD seems to achieve the best balance between blocking ads and preserving functionality. For Roku, PD and TF perform similarly. While TF is the only list that blocks ads in Sony Crackle, both lists miss ads in YouTube and Pluto TV. TF majorly breaks three apps while PD only majorly breaks one app. MoaAB is unable to block ads in four apps and majorly breaks only one app. SATV does not cause any breakage but is unable to block ads in six apps.
For Fire TV, PD again seems to be the most effective at blocking ads while avoiding breakage, but is still unable to block ads in one app (Pluto TV) and majorly breaks two apps. TF is also unable to block ads in Pluto TV, but majorly breaks four apps. MoaAB is unable to block ads in three apps and majorly breaks three apps (one minor). SATV is unable to block ads in four apps and majorly breaks one app (two minor).
Takeaway. Unfortunately, all blocklists suffer from a nontrivial amount of visually observable false positives and false negatives. Some blocklists (e.g., PD and TF) are clearly more effective than others. Interestingly, SATV, which is curated specifically for smart TVs, did not perform well.

Beyond Domains
In this section, we look at ATS characteristics beyond just the destination domains. In particular, we observe that the more apps that contact a single destination, the more likely it is for that destination to be an ATS. This is intuitive and consistent with a similar observation previously made in the mobile ecosystem [7]. This observation may also aid blocklist curators in identifying candidate block rules.
We first use simple keywords such as "ad", "ads" and "tracking" to shortlist obvious ATS domains in our datasets. While keyword search is not perfect, this simple approach identified several obvious false negatives, a few of which are shown in Table 5. For example, p.ads.roku.com and adtag.primetime.adobe.com are advertising/tracking related domains which are not blocked by any of the lists. A few domains such as ads.samba.tv are only blocked by the TF block list. Finally, data.ad-score.com is blocked by PD and TF, but not MoaAB and SATV.
We observe that many of these false negatives (i.e., missed ATS domains) are contacted by multiple apps in our testbed datasets. For example, p.ads.roku.com is accessed by more than 100 apps in our Roku testbed dataset. To gain further insight into potential false negatives, we study whether the likelihood of being blocked is impacted by the number of apps that access a particular domain. Figure 7 plots the block rates for the union of the four blocklists as a function of FQDNs' occurrences across apps in our testbed datasets. We note that the block rate of a domain substantially increases as it starts to appear across multiple apps. For example, a domain's block rate almost doubles when it is contacted by multiple apps. Domains that are contacted by multiple different apps are therefore more likely to belong to third party ATS libraries included by smart TV apps.

PII Exposures
In this section, we consider exposure of personally identifiable information (PII) and we evaluate the effectiveness of blocklists in preventing that. We define "PII exposure" as the transmission of any PII from the smart TV device to any Internet destination. We identify PIIs (such as advertising ID and serial number) through each platform's settings menus and packaging. Since trackers are known to encode or hash PIIs [62], we compute the MD5 and SHA1 hashes for each of the PII values. We then search for these PIIs in the HTTP headers and URI.
Some PII exposures may be legitimate, in the sense that the user may have given permission to the app to access the PII and the network; or that the PII sent by the app is needed for the functionality of the app. For example, Roku apps may use PII to enable personalized content in the absence of logins. However, third party (ATS) libraries automatically inherit app permissions and may use PII for tracking unrelated to app functionality. For example, in Fire TV, we observed examples where static PIIs (serial number) are sent alongside dynamic ones (advertising ID), which allows re-linking of users to dynamic PIIs (even after they have been reset).  Fig. 7. Block rates as a function of the number apps that contact an FQDN. For the horizontal axis, "2+" represents the set of FQDNs that are contacted by 2 or more apps. For Roku, the more apps that contact an FQDN, the more likely it is that that FQDN is an ATS, according to the blocklists. The same is not true for Fire TV because platform services start to dominate the set of FQDNs, and platform services are often not blocked.
As a first step for distinguishing between "good" or "bad" PII transmission (which is a problem on its own and out of scope for this paper), we adopt a simple approach similar to [56] that treats data exfiltration to third parties as a higher threat to privacy. We further distinguish between PII sent to first party, third party, and platform services, as defined in Sec. 4.3. PII sent to first parties are generally warranted as they have functional purposes such as personalization of content (e.g., keep track of where the user paused a video or serve content specific to the user's region). On the other hand, PII sent to third parties do not typically have a functional purpose. This extends to cases where the app retrieves its content through a third party CDN as the personalization could be achieved by first sending the PII to the first party server which could then respond to the app with the CDN URL for the content to be retrieved. Table 6 reports the number of PII exposures found in our Roku and Fire TV testbed datasets. Recall from Section 4 that we can analyze HTTP information even for encrypted flows in Fire TV, but can only analyze unencrypted flows in Roku. Thus, we are able to observe more PII exposures for Fire TV than Roku, which results in higher numbers on the right than on the left side of Table 6.
For Roku, we observe that the device's serial number is often exposed to first and third parties. When sent to first parties, this identifier can enable personalization as many Roku apps do not require login. The blocklists seem to capture this functional purpose well: the block rates for serial number are very low (8%), when it is sent to first parties, and much higher (73%) when it is sent to third parties. There are very few exposures of serial number to the platform, none of which is captured by the blocklists. Upon closer inspection, we found  Table 6. Number of Exposures (% Blocked): Number of times that a PII was exposed and the percentage of times that the exposure was successfully blocked by at least one blocklist. We report the total number of PII exposures found in our testbed datasets, and we further distinguish w.r.t. the packet's destination being first party, third party or platform related, as defined in Sec. 4.3. that these platform exposures originate from the flickr app (developed by Roku) and go to rokucom-link.appspot.com. They seem to link the Roku device with the flickr service for analytics purposes as the URI path "/getRegResult?..." encodes the PII alongside Roku as a partner and flickr as the service. In contrast, for Fire TV, blocklists are unable to block third party exposures of more prevalent PIIs such as serial number (only 2.6% blocked) and device ID (35%) while performing well for advertising ID (81%). While exposure of serial number or device ID may be utilized for software updates, we discover that they are multipurpose, as the vast majority of these exposures to Amazon-owned endpoints go to aviary.amazon.com with a URI path of "/GetAds". Furthermore, these two hardwired identifiers are often sent alongside the advertising ID, which allows third parties to associate an old advertising ID (users can reset their advertising ID) to the new value by joining on serial number and device ID.
Leveraging Missed PII Exposures to Improve Blocklists. The unblocked PII exposures indicate another direction for improving blocklist curation for smart TVs. By deploying tools such as Rokustic and Firetastic and searching the network traces for PIIs, blocklist curators can generate candidate rules that can then be examined manually. Using this approach, we identified 38 domains in the Roku dataset and 30 in the Fire TV dataset that receive PII, but were not blocked by any list. These numbers are conservative as we exclude location and account name that are likely to be used for legitimate purposes, such as logging in or serving locationbased content. These domains include obvious ATS such as ads.aimitv.com and ads.ewscloud.com. Another noteworthy mention is hotlist.samba.tv: Samba TV uses Automatic Content Recognition to provide content suggestions on smart TVs, but this comes at the cost of targeted advertising that even propagates onto other devices in the home network [63].

Conclusion & Directions
In this paper, we performed a comprehensive measurement study of the smart TV advertising and tracking services (ATS) ecosystem. While smart TV platforms are becoming increasingly popular, their ATS ecosystems have not yet received as much attention from the privacy community as the ATS ecosystems of the mobile platform and the web. To that end, we analyzed and compared: (i) a realistic but small in-thewild dataset (57 smart TV devices of 7 different platforms, with coarse flow-level information) and (ii) two large testbed datasets (top-1000 apps on Roku and Fire TV, tested systematically, with granular per app and packet-level information).
We showed that smart TVs generate a substantial amount of traffic towards ATS. Our results also revealed that advertising and tracking is platform-specific; even common apps across different platforms tend to contact more platformspecific than common domains. Our evaluation of four sets of state-of-the-art DNS blocklists for smart TVs showed varying block rates, with all lists suffering from both false positives (resulting in functionality breakage) and false negatives (resulting in missed ads and trackers). Even the commercial StopAd designed for smart TVs did not work well. We demonstrated that these blocklists are less effective in blocking PII sent to platform endpoints than to third parties, both of which perform tracking in smart TVs. Finally, we offered two insights to help blocklist curators identify false negatives, i.e., domains that are contacted by multiple apps or domains that collect PII.
In summary, our work establishes that (i) the smart TV ATS ecosystem is fragmented across different smart TV platforms; (ii) the smart TV ATS ecosystem is different from the mobile ATS ecosystem; and (iii) DNS-based blocklists are currently not able to effectively filter ATS for smart TVs. These findings motivate more research to further understand smart TVs and to develop privacy-enhancing solutions specifically designed for each smart TV platform. For example, more research is needed to curate accurate, fine-grained (compared to DNS-based), and platform-specific blocklists. To foster further research along this direction, we plan to make our tools, Rokustic and Firetastic, and datasets from testing the top-1000 Roku and Fire TV apps publicly available.