CVE-2026-27167
MEDIUM 5.9CVSS 3.1Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
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.
- Published
- 27 Feb 2026
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-522CWE-798
- Also known as
- GHSA-h3h8-3v2v-rg7mPYSEC-2026-63
- Sources
- NVDJSONOSV GHSA-h3h8-3v2v-rg7mJSONOSV PYSEC-2026-63JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| OSV | PyPA | CVSS 3.1 | MEDIUM 5.9 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | NONE 0.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | NONE 0.0 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | gradio_project | gradiocpe:2.3:a:gradio_project:gradio:*:*:*:*:*:python:*:* |
>= 4.16.0, < 6.6.0 | 6.6.0 |
| OSV | PyPI | gradio | >= 4.16.0, < 6.6.0 | 6.6.0 |
References
- https://github.com/gradio-app/gradio/security/advisories/GHSA-h3h8-3v2v-rg7m · Exploit, Vendor Advisory, WEB, EVIDENCE
- https://nvd.nist.gov/vuln/detail/CVE-2026-27167 · ADVISORY
- https://github.com/gradio-app/gradio/commit/dfee0da06d0aa94b3c2684131e7898d5d5c1911e · WEB
- https://github.com/gradio-app/gradio · PACKAGE
- https://github.com/gradio-app/gradio/releases/tag/gradio@6.6.0 · WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2026-63.yaml · WEB
History
- 25 Nov 2026 21:01 UTC · NVD: first stored (published 27 Feb 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 27 Feb 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 1 Mar 2026)