June 13, 2022·6 min read·engineeringrubysecurityauthenticationrubygems

RubyGems starts a staged MFA policy for widely downloaded gems

RubyGems begins warning maintainers about a forthcoming MFA requirement. The rollout uses download thresholds and distinguishes interactive authentication from the API credentials used by automation.

A package maintainer's account can authorize code that many other applications will later install. The consequences of losing that account therefore extend beyond the maintainer's own projects. RubyGems' new authentication policy begins with widely downloaded gems, making the reach of a package part of the decision about which accounts must receive stronger protection first.

Betty Li's June 13 announcement begins the recommendation phase. Owners of gems with more than 165 million downloads will see warnings in the command-line tool and website when MFA is absent. The announcement schedules enforcement for August 15 for owners of gems with more than 180 million downloads. Today begins notification, rather than immediate blocking under the future threshold.

I find Ruby approachable for larger object-oriented programs, but an application's dependencies make it part of a wider publishing system. Protecting that system's author accounts is an engineering requirement with downstream consequences. A readable library can still become an unsafe dependency if an unauthorized person gains the ability to publish its next release.

The recommendation and requirement use different thresholds

The announcement describes the initial cohort as at least the top one hundred packages, but defines the warnings through a numerical download threshold. That distinction matters when interpreting the scope. The policy is not simply a permanently fixed list of one hundred package names.

The MFA rollout RFC, started in January, explains the intended separation. A recommendation threshold precedes the requirement threshold. Warning a maintainer earlier gives an account time to configure authentication before sensitive actions become subject to enforcement.

The RFC models these as separate policy questions. One determines whether to display a recommendation. Another determines whether MFA is required and whether sensitive behaviour should be blocked. Keeping those decisions separate lets the service introduce communication before turning the requirement on.

The announced email schedule follows the same approach. Affected maintainers will receive reminders one month before enforcement and again one week before it. The dates belong to a transition process. They should not be read as evidence that an account without MFA is already prevented from publishing today under the August policy.

This is also a distinction between a warning and a failed operation. The RFC's recommendation phase leaves command-specific behaviour unaffected. Its enforcement phase blocks specified sensitive requests when an affected account has not configured MFA. A message on the command line can therefore represent different policy states, depending on the phase and its meaning.

The policy applies to owners' accounts

Downloads identify the gem whose reach triggers the policy, but MFA belongs to the owner's account. A package cannot itself answer a second-factor challenge. Its maintainers have to configure the account that authenticates operations on the service.

That relationship explains the supply-chain motivation. An attacker who obtains a publishing identity may be able to act through permissions the real maintainer already possesses. Stronger authentication aims to reduce the chance that possession of the password alone gives the attacker that identity.

The RFC describes the existing second factor as time-based one-time passwords. It also discusses other authentication work as development in progress. Today's policy does not require claiming that every proposed authentication method or API-key improvement is already available. Its immediate published requirement is about enabling an acceptable MFA level for the relevant owner accounts.

The announcement recommends UI and API, while accepting UI and gem signin as well. These names describe different scopes of authentication enforcement. The RFC acknowledges that requiring a second factor across API use is more difficult for automated scripts, which is why API credentials receive separate attention in its design.

Automation changes where the challenge belongs

An interactive maintainer can respond to a challenge while signing in or publishing. An automated release process cannot assume a human is waiting at every invocation. The RFC treats that operational constraint as a reason to improve API keys alongside the rollout, rather than ignoring automation or treating every credential as equally safe.

One proposed improvement scopes a key to a specific gem. A credential for one package then need not carry the same potential reach as a general owner credential. The RFC also specifies invalidation associated with removing the user as an owner of the scoped gem. These are proposed permission constraints on the credential, distinct from verifying the person who creates or uses it.

Another proposal adds expiration. The document discusses selectable validity periods and marking an expired key invalid. It also raises the question of expiring existing credentials, recognizing that changing them can break workflows. Staggering those expirations is proposed to avoid forcing every affected user through the same transition at once.

These ideas address different properties of a key. Scope limits which package an authorized request can affect. Expiration limits the time during which the credential is valid. Neither is identical to a second-factor challenge, but both can reduce risks in workflows where a challenge on every API request is impractical.

I consider that distinction essential to evaluating the plan. Saying that an account has MFA does not fully describe the authority of its automation credentials. The RFC makes room to discuss those credentials as their own design problem, with permissions and lifetimes that can be constrained.

Publishing friction is part of the design problem

The RFC also considers allowing multiple gem uploads with one command and one one-time-password entry. Its stated motivation is the burden on maintainers who publish several gems. Repeated challenges can become a substantial part of a release workflow even when each individual challenge is simple.

That feature remains proposed in the RFC. The June announcement does not claim that all of its publishing changes have shipped. The important point is the design connection. Stronger authentication creates interactions that maintainers have to perform, so reducing unnecessary repetition can make the stronger control more practical to keep enabled.

The same reasoning applies to the notification phase. A maintainer needs to know which account is affected and what to configure before a blocking request appears during a release. The policy's warnings and reminders make that transition explicit. They are part of adoption, not evidence that the underlying security objective can be met through warnings alone.

The RFC identifies support demand and user resistance as drawbacks. Those are operational costs of requiring a new authentication step across existing workflows. A staged rollout lets the project concentrate that transition on an initial cohort while leaving wider expansion to subsequent policy work.

Signing does not replace account authentication

The RFC discusses gem signing as an alternative raised by maintainers. It excludes signing from this proposal because signing does not prevent an account takeover. That distinction should remain specific. Verifying a package and controlling access to an owner's registry account are separate responsibilities, even when a complete distribution system may need both.

Stronger passwords are also discussed. The RFC notes that reuse and leaks can still expose credentials, so password quality alone does not remove the account-takeover concern. MFA adds another verification requirement to the authentication process. It should not be described as repairing every way malicious code can enter a package.

For example, a registry authorization error is a different failure from someone signing in with a stolen password. A policy designed for the second case needs server authorization to remain correct as well. This is a reason to describe the control through its mechanism and intended threat, without making a general claim that enabling it certifies package contents.

The announced next step is enforcement

The June notice gives affected owners a concrete interval to prepare. Warnings begin now above 165 million downloads. Enforcement is scheduled for August 15 above 180 million, with the two acceptable authentication levels identified in the announcement. Those are the operative dates and thresholds in the current communication.

Broader rollout remains an intention, with future changes to be communicated in advance. The RFC's additional API-key work supplies useful rationale but should retain its proposal status. The immediate change is a staged account-authentication policy, with publishing automation recognized as a separate credential problem that requires limits on authority as well as a usable authentication flow.

The RFC identifies sign-in, pushing and yanking gems, and adding or removing owners as sensitive command workflows. This scope includes changing who may publish, not merely publishing a new version. Protecting an ownership change matters because it can alter the set of identities trusted for subsequent releases.