Skip to content
Path traversal Write-up Intermediate

Bypass 2 factor authentication on any website using Authy

The Authy two-factor authentication API and several client libraries failed to properly encode user-supplied tokens, allowing path traversal. An attacker could bypass two-factor authentication by submitting a crafted token that caused the verification endpoint to return a success status without validating the token.

sakurity.com

Published on sakurity.com

The first part defines Format Injection and explains interesting but low severity bug in Duo Web SDK.

The author, on sakurity.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

Impact

An attacker could bypass two-factor authentication on websites using vulnerable Authy SDKs, but only certain libraries (Node.JS by Daniel Barnes, Authy.NET by Devin Martin, and Authy OpenVPN) were affected.

What the attacker needed

Victim uses Authy 2FA; attacker knows victim's Authy ID; vulnerable Authy SDK or custom integration

The fix

The path_traversal module in rack-protection was patched, and Authy libraries were updated to verify the response body for a specific token validity string.

How it was found

  1. The attacker enters '../sms' in the SMS token field.
  2. The client app encodes it as '..%2fsms' and makes an API call to Authy.
  3. Path_traversal middleware decodes the path and removes the directory in front of '/..'.
  4. Authy API sees the modified path and sends another SMS to the victim, responding with 200 status.
  5. All Authy SDK libraries consider 200 status as a successful response and let the attacker in.

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 to logging in, usually a code sent to your phone. This report shows that some software libraries used to talk to Authy's 2FA service did not safely handle the code you type in. By entering a special string instead of a real code, an attacker could trick the service into saying the code was correct, letting them log in without the victim's phone.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.