CVE-2026-27167
Description
A flaw was found in Gradio. When Gradio applications run outside of Hugging Face Spaces and use OAuth components, they automatically enable "mocked" OAuth routes. A remote attacker can exploit this by visiting the /login/huggingface endpoint, which causes the server to retrieve its Hugging Face (HF) access token and store it in the visitor's session cookie. Since the session cookie is signed with a hardcoded secret, the attacker can easily decode the payload and steal the server owner's HF token, leading to information disclosure.
Statement
This vulnerability in Gradio applications, specifically affecting ansible-chatbot-service in Ansible Services, allows a remote attacker to obtain the server owner's Hugging Face access token. This occurs when network-accessible Gradio applications utilize OAuth components outside of Hugging Face Spaces, leading to the automatic enablement of "mocked" OAuth routes. The session cookie, containing the token, is signed with a hardcoded secret, making it trivially decodable.
Mitigation
To mitigate this issue, restrict network access to Gradio applications that utilize OAuth components and are deployed outside of Hugging Face Spaces. Implement firewall rules or a reverse proxy to limit exposure of the application's `/login/huggingface` endpoint to trusted networks only. If feasible, avoid using OAuth components in self-hosted Gradio deployments until a version with a proper fix is available.
Understanding the Weakness (CWE)
Access Control
Technical Impact: Bypass Protection Mechanism
If hard-coded passwords are used, it is almost certain that malicious users will gain access to the account in question. Any user of the product that hard-codes passwords may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.
Integrity,Confidentiality,Availability,Access Control,Other
Technical Impact: Read Application Data; Gain Privileges or Assume Identity; Execute Unauthorized Code or Commands; Other
This weakness can lead to the exposure of resources or functionality to unintended actors, possibly providing attackers with sensitive information or even execute arbitrary code. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the product will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
Frequently Asked Questions
Not sure what something means? Check out our Security Glossary.
Want to get errata notifications? Sign up here.