CVE-2026-27167

Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret

Published Feb 27, 2026 CVSS 3.1 · 0 Low EPSS < 1% KEV · Not listed
Description
Gradio is an open-source Python package designed for quick prototyping. Starting in version 4.16.0 and prior to version 6.6.0, Gradio applications running outside of Hugging Face Spaces automatically enable "mocked" OAuth routes when OAuth components (e.g. `gr.LoginButton`) are used. When a user visits `/login/huggingface`, the server retrieves its own Hugging Face access token via `huggingface_hub.get_token()` and stores it in the visitor's session cookie. If the application is network-accessible, any remote attacker can trigger this flow to steal the server owner's HF token. The session cookie is signed with a hardcoded secret derived from the string `"-v4"`, making the payload trivially decodable. Version 6.6.0 fixes the issue.

Analysis

AI-generated

Technical impact

Gradio applications built with versions starting at 4.16.0 through 6.5.0 expose a flaw when OAuth components such as gr.LoginButton are employed outside of Hugging Face Spaces. By visiting the special /login/huggingface route, the server automatically retrieves its own Hugging Face access token and stores it inside the visitor’s session cookie. The session cookie is signed with a hardcoded secret derived from the string "-v4", which means the cookie can be decoded trivially. An attacker who can reach the application over the network can trigger this flow and capture the server’s credentials, compromising the entire Hugging Face integration. This is a classic case of improper secret management and storage of sensitive data in client-side cookies.

Affected Systems

The vulnerability affects the Gradio package distributed by gradio-app. Any deployment of Gradio version 4.16.0 up to and including 6.5.0 that is exposed to external network traffic and uses OAuth UI components is impacted. Gradio 6.6.0 and later versions contain the fix and are not affected.

Risk and Exploitability

Detailed severity is not provided, but the potential to exfiltrate server credentials makes the impact high. The EPSS score indicates that current public exploitation probability is very low (<1%). The vulnerability is not listed in CISA’s KEV catalog, suggesting it has not been actively exploited in the wild yet. The likely attack vector is a remote, unauthenticated user accessing the exposed /login/huggingface endpoint, which then results in credential theft. Exploitation requires only network connectivity to the vulnerable service and the presence of OAuth components in the code.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Gradio to version 6.6.0 or newer to apply the vendor fix that removes the mocked OAuth flow and uses a proper session secret.
  • If an upgrade cannot be performed immediately, disable or remove OAuth components such as gr.LoginButton from the application code to eliminate the vulnerable route.
  • Restrict access to the Gradio application by placing it behind authentication, firewall rules, or an internal network so that external attackers cannot trigger the /login/huggingface endpoint.

Generated by OpenCVE AI on April 16, 2026 at 15:13 UTC.

Tracking

Sign in to view the affected projects.

Exploits

Explore public exploit intelligence with OpenCVE Pro.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-h3h8-3v2v-rg7m Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
History
Type Values Removed Values Added
First Time appeared Gradio Project
Gradio Project gradio
CPEs cpe:2.3:a:gradio_project:gradio:*:*:*:*:*:python:*:*
Vendors & Products Gradio Project
Gradio Project gradio
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Gradio-app
Gradio-app gradio
Vendors & Products Gradio-app
Gradio-app gradio
References
Metrics threat_severity

None

threat_severity

Low

Type Values Removed Values Added
Description Gradio is an open-source Python package designed for quick prototyping. Starting in version 4.16.0 and prior to version 6.6.0, Gradio applications running outside of Hugging Face Spaces automatically enable "mocked" OAuth routes when OAuth components (e.g. `gr.LoginButton`) are used. When a user visits `/login/huggingface`, the server retrieves its own Hugging Face access token via `huggingface_hub.get_token()` and stores it in the visitor's session cookie. If the application is network-accessible, any remote attacker can trigger this flow to steal the server owner's HF token. The session cookie is signed with a hardcoded secret derived from the string `"-v4"`, making the payload trivially decodable. Version 6.6.0 fixes the issue.
Title Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
Weaknesses CWE-522
CWE-798
References
Metrics cvssV3_1

{'score': 0, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N'}

Weaknesses
  • CWE-522

    Insufficiently Protected Credentials

  • CWE-798

    Use of Hard-coded Credentials

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Mar 2, 2026, 10:02 PM
Reserved
Feb 18, 2026, 12:18 AM
Status
Analyzed
Published
Feb 27, 2026, 10:16 PM
Modified
Jun 17, 2026, 10:26 AM
Severity
Low
Public date
Feb 27, 2026, 9:40 PM