Gradio apps vulnerable to timing attacks to guess password
Gradio apps with password protection were vulnerable to timing attacks because string comparisons terminated early on mismatch, allowing attackers to guess passwords character by character. Without rate limiting, an attacker could brute-force millions of guesses to find the correct username and password.
gradio-app/gradio
Originally disclosed on huntr
Impact
This security policy is with regards to a timing attack that allows users of Gradio apps to potentially guess the password of password-protected Gradio apps. This relies on the fact that string comparisons in Python terminate early, as soon as there is a string mismatch. Because Gradio apps are, by default, not rate-limited, a user could brute-force millions of guesses to figure out the correct username and password.
Patches
Yes, the problem has been patched in Gradio version 4.19.2 or higher. We have no knowledge of this exploit being used against users of Gradio applications, but we encourage all users to upgrade to Gradio 4.19.2 or higher.
Fixed in: https://github.com/gradio-app/gradio/commit/e329f1fd38935213fe0e73962e8cbd5d3af6e87b
From the GitHub Advisory Database (GHSA-hmx6-r76c-85g9, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the password comparison used a non-constant-time string comparison that exits early on the first mismatched character, leaking information through timing differences.
Impact
An attacker could potentially guess the password of password-protected Gradio apps by brute-forcing millions of guesses, as the apps are not rate-limited by default.
What the attacker needed
Password-protected Gradio app; no rate limiting (default)
The fix
The problem was fixed in Gradio version 4.19.2 or higher.
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 report has not been written yet. The Original tab links to the source.
When you check a password, the computer compares your guess to the real password one character at a time. If it stops as soon as it finds a wrong character, the time it takes reveals how many characters were correct. By measuring these tiny time differences, an attacker can guess the password piece by piece. This is called a timing attack.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.