WARNING: Trac is retired as of June 12, 2020 and this wiki page has been moved to Tor Project's GitLab at https://gitlab.torproject.org \ Please view this page on Tor Project's GitLab for getting the most up to date information \ \
Cloudflare CAPTCHA Monitoring
The Cloudflare CAPTCHA Monitoring project aims to track how often Cloudflare fronted webpages return CAPTCHAs to Tor clients. The project aims to achieve this by fetching webpages via both Tor and other mainstream web browsers and comparing the results. The tests are repeated periodically to find the patterns over time. Collected metadata, metrics, and results are analyzed and displayed on a dashboard to understand how Cloudflare manipulates internet traffic and affects people's access to the internet.
The codebase is in development right now, and it is currently located in this GitHub repository.
You also find the documentation in this Read the Docs page.
The data collected so far can be found in this dashboard. The data is not in a downloadable format right now, but the link will be added here once it is available.
By design, Cloudflare is developed to alter the traffic between the web servers and internet users. Cloudflare modifies the internet traffic to protect the Cloudflare fronted web servers from various attacks from users with malicious intentions. Even though this seems like a practice with good faith on the surface to protect servers, it harms millions of users more than doing good. Cloudflare makes decisions to block or not to block users based on multiple factors such as visitor's IP address, resources requested, request payload and frequency, and customer-defined firewall rules [#ref_1 (1)]. They don't share the specifics of their decision-making mechanism since it keeps changing over time, and it is not open-source. However, this doesn't stop us from experimenting with the algorithm and understanding how it decides to block/not block users.
Cloudflare mentions that IP address based rules have the highest hierarchy, and it is followed by Firewall Rules, Zone(URL) Lockdown, User Agent Blocking, and Web Application Firewall [#ref_2 (2)]. Thus, Cloudflare clearly states in their documentation that they do consider the user's IP addresses and their web browser's User Agent while deciding to block a user. Unfortunately, Cloudflare algorithms trigger all red flags when these two parameters (IP address and user agent) are matching to a typical Tor user. This is an easy thing to do for Cloudflare because Tor Browser uses the one fingerprint for all philosophy, and the list of Tor exit nodes is publicly available. The Cloudflare CTO himself, explains that they fetch the list of Tor exit nodes and assign a reputation to the nodes here in trac ticket:18361#comment:23 to block certain users.
Currently, there are a few research projects (like Khattak et al. and Singh et al.) on the Tor user blocking practices, but there is no public tool and/or database collecting data regularly on Cloudflare's Tor user blocking practices, to the best of my knowledge. Thus, this project aims to develop tools to monitor this issue and create a database for public usage. Eventually, once there is enough data accumulated, this tool is aimed to function as a data source for the Tor Metrics project. It was also observed that a lot of users struggle with reliably reproducing the Cloudflare behavior to report in their tickets since there are too many variables involving the process. Thus, this project can be used as a standardized toolset to reproduce Cloudflare's behavior since many of the variables are controlled within the project. The collected data might serve as a reference point to the measurements done by the individual users.
=== Expected long-term impact ===
- Creating an up to date and reliable data source for further research on the topic
- Integrating the collected data to Tor Metrics
- Reducing and relaxing the Cloudflare's CAPTCHA policies
- Helping Tor users browse the internet without sacrificing privacy and getting discriminated
- Having Cloudflare fronted websites (captcha.wtf and exit11.online) to simulate various configurations that can be done by the Cloudflare users
- Periodically fetching these websites via Tor and other mainstream web browsers that are not using Tor
- Recording if a CAPTCHA is returned during the website fetches and other additional predefined [#metrics metrics]
- Visualizing the results in a dashboard (dashboard.captcha.wtf) and analyzing the collected data
- Tracking and making the dataset & the results publicly available
Here is a diagram that explains the approach in detail: \ \ ![https://trac.torproject.org/projects/tor/raw-attachment/wiki/doc/CAPTCHAMonitor/CAPTCHA_Monitoring_Project_Diagram.png, width=600px](https://trac.torproject.org/projects/tor/raw-attachment/wiki/doc/CAPTCHAMonitor/CAPTCHA_Monitoring_Project_Diagram.png, width=600px)
== Metrics to track == #metrics Here are some of the questions that the project will try to answer by tracking related metrics to these questions. Some of these questions are trying to find answers to the questions asked and issues reported by the community.
- Does Cloudflare treat IPv4 and IPv6 addresses differently? [ticket:33010#comment:2]
- How does the HTTP request headers affect Cloudflare's decision-making mechanism? [ticket:33010#comment:4] a. Is there a difference between using the actual Tor Browser itself and tor-browser-selenium in terms of the HTTP headers? b. How does Cloudflare react differently if the browser doesn't support alt-svc headers? [ticket:32915]
- What kind of per browser session tracking and blocking is actually happening? [ticket:18361]
- How does having pre-existing cookies for other websites affect Cloudflare's behavior? [ticket:18361#comment:7], [ticket:23840#comment:26]
- How do different security levels of Cloudflare [#ref_3 (3)] affect the blocking mechanism? [ticket:33010#comment:5] a. Do some of the Cloudflare security levels block users immediately without presenting a CAPTCHA challenge at all?
- How does the time of the day affect the Cloudflare's blocking mechanism? Does it matter the day of the week or the time of the day? [ticket:33010#comment:15]
- How often does Cloudflare's blocking mechanism change/update itself?
- How do specific exit nodes get affected by Cloudflare's blocking practices? a. Does the size/age/location of the exit node play a role? [ticket:33010#comment:15] b. Is it always the same Tor exit nodes that get blocked?
- How well does Cloudflare keep track of the new or old Tor exit nodes? a. How frequently Cloudflare updates its Tor exit node list?
- What fraction of the Tor exit nodes get affected by Cloudflare's blocking practices? [ticket:33010], [ticket:23840#comment:22]
- What is the chance of a Tor client getting affected by Cloudflare's blocking practices when choosing a Tor exit node? [ticket:33010]
- Is there a difference between websites that load resources from third-party resources and websites that contain all resources on the origin server? [ticket:33010#comment:6] a. How do users of websites get affected if the main website is not fronted by Cloudflare, but some of the resources are fetched from a Cloudflare fronted web server? [ticket:33010#comment:6], [ticket:15450]
- Is there a difference if the origin server has an SSL certificate or not? a. Does the blocking change if the SSL certificate is issued by Cloudflare or by another entity?
- If browsers that should not face CAPTCHA face CAPTCHA, why does this happen?
- How do the observed patterns in the results change over time? [ticket:33010]
- Is whether you get a CAPTCHA much more probabilistic and transient? [ticket:33010]
Related trac tickets
The original ticket initiated this project can be found here: #33010 (moved)
- #18361 (moved) - Issues with corporate censorship and mass surveillance
- #23840 (moved) - Google's reCAPTCHA fails 100%
- #24351 - Block Global Active Adversary Cloudflare; The Great Cloudwall
- #31404 (moved) - Unsolvable reCAPTCHAs
- #32915 (moved) - Cloudflare alt-svc failures cause spurious "DNS resolution error" in Tor Browser
- Create Cloudflare fronted websites \
- IPv4 and IPv6 only domains (as suggested by ticket:33010#comment:2)
- captcha.wtf -> IPv4 only
- exit11.online -> IPv6 only
- Build a simple website fetcher to collect data \
- Check for the existance of the "Cloudflare" string in the returned website (as suggested by ticket:33010#comment:25)
- Create a simple dashboard for displaying collected data \
- Make the dataset downloadable \
- Have a working minimum viable product \
- Integrate Tor Stem \
- Integrate more web browsers \
- Integrate older versions of the web browsers as well \
- Integrate Cloudflare API not to change Cloudflare settings (of the websites) manually \
-  Optimize the data storage format \
- Write tests \
- Enhance the available visualizations on the dashboard \
- Submit a report the Tor Research Safety Board \
- Brainstorm the integration with OONI people \
- Brainstorm the integration with Tor Metrics people \
- Create an API for people to fetch data easily \
- Create an API for running the system on the user-provided websites \
GeKo & arma are the mentors of this project, and currently, I'm (woswos) the only developer of this project. I develop this project as a part of the Google Summer of Code program.
If you have any questions, concerns, feedback, etc. you can reach me on the #tor-dev or #tor-project channels on IRC. My IRC handle is woswos, and if you need help with connecting to IRC, you can follow this tutorial.
You can also email me at <barkin(at)nyu(dot)edu>
Contributing and Reporting Bugs
I use the trac tickets to keep track of the issues and the project. You can use ticket #33010 (moved) and its child tickets to follow the development and share your contributions and bugs. You will need to use the project's GitHub repository for code contributions.
[=#ref_1 (1)] https://web.archive.org/web/20200328165212/https://support.cloudflare.com/hc/en-us/articles/205177068-How-does-Cloudflare-work- \ [=#ref_2 (2)] https://web.archive.org/web/20200328143759/https://support.cloudflare.com/hc/en-us/articles/115002059131-Understanding-your-site-protection-options. \ [=#ref_3 (3)] https://web.archive.org/web/20200328183738/https://support.cloudflare.com/hc/en-us/articles/200170056-Understanding-the-Cloudflare-Security-Level