CVE-2026-134825: Gradio 6.27–6.31 let unauthenticated visitors use the operator's saved Hugging Face token for run-history buckets by sending Host: localhost through the SSR server (fixed 6.32.0)
Gradio, Hugging Face's Python library for AI demo apps, added run history that can be saved to a Hugging Face bucket. From 6.27.0 to before 6.32.0, gradio/history.py fell back to the token saved on the host (hf auth login) whenever a request looked local. With ssr_mode enabled, requests proxied through Gradio's local Node SSR server passed that loopback check, so a remote, unauthenticated visitor sending a forged Host: localhost header could call the run-history endpoints with the operator's token: list buckets, read records and assets, and write buckets under the operator's Hugging Face account. Fixed in 6.32.0, which uses the visitor's own token instead.
What it is
Affected code: gradio/history.py (run history bucket endpoints), Gradio 6.27.0 up to (not including) 6.32.0, per NVD.
The fix (PR #14050, 'Use the visitor's own HF token for run history buckets') stops falling back to the host's saved token based on whether a request appears local, because that depends on reverse proxies, the SSR server or share tunnels. The token is now asked for in the connect dialog and kept in HttpOnly cookies.
Gradio 6.32.0 was released on 12 November 2026; NVD published the CVE (CNA VulnCheck, CWE-290) on 22 November 2026.
How to check
- pip show gradio: versions 6.27.0 to 6.31.x are affected.
- You are exposed if the app runs with SSR mode and the machine has a saved Hugging Face token (hf auth login or HF_TOKEN), and the app is reachable by others (share link, Space, reverse proxy).
- Review your Hugging Face account for unexpected buckets or bucket writes.
How to fix
- Upgrade Gradio to 6.32.0 or later.
- Don't run public Gradio apps on a machine logged in with a broad Hugging Face token; use a fine-grained token scoped to what the app needs.
- If you were exposed, rotate the Hugging Face token.
pip show gradio | grep -i version
pip install -U 'gradio>=6.32.0'