Kuboid
Open Luck·Kuboid.in
Black Hat2023
Open in YouTube ↗

I Was Tasked with Enrolling Millions of Developers in 2FA

Black Hat1,867 views37:31about 2 years ago

This talk details the strategic and operational challenges of implementing mandatory two-factor authentication (2FA) for millions of users on a large-scale software development platform. It highlights the importance of balancing security requirements with user experience to prevent account lockouts and maintain platform accessibility. The speaker demonstrates how data-driven decision-making and cross-functional collaboration can effectively mitigate the risks associated with account takeover (ATO) and supply chain compromise. The presentation provides a framework for managing large-scale security rollouts while minimizing friction for developers.

The Hidden Cost of Mandatory 2FA: Lessons from Scaling Security at GitHub

TLDR: Implementing mandatory 2FA across millions of developer accounts is a massive operational challenge that requires balancing security with user accessibility. This talk breaks down how GitHub used data-driven decision-making and cross-functional collaboration to reduce account takeover risks without triggering mass user lockouts. For security teams, the key takeaway is that security measures must be designed with the user's workflow in mind to avoid creating self-inflicted denial-of-service scenarios.

Security professionals often treat 2FA as a binary switch. You either have it on, or you are vulnerable to A07:2021-Identification and Authentication Failures. But when you are responsible for a platform with millions of active developers, the reality is far more complex. A poorly implemented security policy does not just annoy users; it creates a massive support burden and can actually drive developers away from your platform. The recent push to secure the software supply chain has made this a front-and-center issue for every major registry, including npm, RubyGems, and PyPI.

The Mechanics of a Large-Scale Rollout

The primary threat vector here is account takeover (ATO), where a compromised developer account is used to inject malicious code into widely used packages. While the technical fix is simple—enforce 2FA—the operational execution is where most organizations fail.

GitHub’s approach was not to flip a switch for everyone at once. Instead, they treated the rollout like a controlled experiment. They identified that the biggest risk to their support infrastructure was not the security implementation itself, but the inevitable wave of "I lost my phone and can't log in" tickets. By analyzing their own support data, they identified a 42% reduction in 2FA-related support tickets after implementing a more intuitive configuration flow. This is a critical metric for any security team: if your security controls increase your ticket volume by 500%, your blue team will eventually be forced to roll back those controls under pressure from the business.

Data-Driven Friction Reduction

One of the most interesting technical aspects of this rollout was the use of a "2FA verification flow" that triggers 28 days after enrollment. This is a clever way to handle the "set it and forget it" problem. Many users enable 2FA, lose their backup codes, and then get locked out months later when they switch devices. By forcing a periodic verification, the platform ensures that the user still has access to their second factor.

If a user fails this verification, they are prompted to reconfigure their settings. This is only possible if they are coming from a "verified device" with an existing, authenticated session. This logic effectively creates a safety net. It allows the platform to maintain a high security bar while providing a path for users to recover their accounts without needing manual intervention from support staff.

Real-World Applicability for Pentesters

For those of us on the offensive side, this research highlights why we should stop looking for "perfect" security and start looking for "usable" security. When you are testing an application, look for the friction points in the authentication flow. If an application forces 2FA but provides no clear path for recovery, or if the recovery process is overly complex, you have found a potential denial-of-service vulnerability.

During a red team engagement, the goal is often to gain access to a developer's account. If you can identify that a platform has a weak or non-existent 2FA enforcement policy, that is your primary target. Conversely, if you are working with a client to improve their security, suggest that they look at their own support ticket data. If they see a spike in account recovery requests, they are likely over-indexing on security at the expense of usability.

The Defensive Perspective

Defenders need to stop viewing security as a static wall. The most effective security programs are those that evolve based on user behavior. If your users are constantly bypassing your controls, the problem is not the users; it is the controls.

GitHub’s success here was not due to a new, fancy cryptographic algorithm. It was due to the boring, difficult work of:

  1. Defining clear operating principles: Establishing that security is a right, not a privilege, and that it must be accessible.
  2. Involving cross-functional teams: Bringing in PR, Legal, and Support early to ensure the rollout didn't become a PR disaster.
  3. Iterating based on data: Using ticket volume as a proxy for user friction and adjusting the rollout pace accordingly.

Security is ultimately a human problem. If you want to move the needle on 2FA adoption, you have to make the secure path the easiest path. If you make it hard, developers will find a way around it, and you will be left with a false sense of security while your attack surface remains wide open.

Talk Type
talk
Difficulty
intermediate
Category
policy
Has Demo Has Code Tool Released


Black Hat USA 2023

118 talks · 2023
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in