Skip to content
Write-up Intermediate

Leveraging Duo Security’s Default Configuration to Bypass SSH Two-Factor Auth

The default configuration of Duo Security's Unix login module fails open when the Duo API host is unreachable, allowing an attacker who can disrupt DNS resolution to bypass two-factor authentication and log in with only a username and password.

appsecconsulting.com

Published on appsecconsulting.com

Few things are more frustrating as an attacker than running up against widely implemented two-factor authentication (2FA). Even with valid credentials, without a valid two-factor authentication code or push acknowledgement, logging in to a protected service and abusing its capabilities or harvesting information isn’t…

The author, on appsecconsulting.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The default configuration of the Duo Unix login module uses a fail-open mode, so when the Duo API host is unreachable, authentication succeeds without the second factor.

Impact

An attacker with network position to intercept DNS could bypass 2FA and log in with only valid credentials, but this depends on being able to disrupt communication between the server and Duo API hosts.

What the attacker needed

Network position to intercept DNS; valid username and password; Duo Unix default configuration

The fix

Add 'failmode = secure' to the login_duo.conf file so that SSH logins fail if Duo cannot reach the API host.

How it was found

  1. Set up an Ubuntu server with Duo Unix login module for SSH 2FA.
  2. On an attacker machine, edit the ettercap DNS spoof file to point all Duo API hostnames to the attacker's IP.
  3. Start Ettercap with ARP poisoning and DNS spoofing against the victim.
  4. Attempt SSH login to the victim server; Duo cannot reach the API host and fails open, allowing login with only username and password.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Two-factor authentication (2FA) adds a second step, like a phone push, after your password. This report shows that if the server cannot reach the 2FA service, the default setup lets you in without that second step. An attacker who can block or redirect the server's connection to the 2FA service can then log in with just a stolen password.

Similar reports

Same bug class and techniques, clearest first.