LiteLLM vulnerable to reflected XSS in /sso/debug/callbackGHSA-hhww-mrg2-969h
MEDIUMFix: BerriAI/litellm#27498GHSA-hhww-mrg2-969h is a medium-severity (CVSS 6.8) vulnerability in litellm. A fix is available for litellm — see the affected versions and patch details below.
Real-World Exposure
litellmReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The /sso/debug/callback endpoint reflected identity-provider-controlled fields into an inline <script> block via json.dumps, which escapes JSON string syntax but not HTML context characters such as </script>. An IdP-returned string field containing </script> (for example a user-editable display name) closed the script block and executed attacker JavaScript in the proxy's origin.
Impact
Reflected XSS on the LiteLLM proxy origin. The route required no authentication, so an attacker with an account on the configured IdP whose claims pass such strings through verbatim could complete the SSO flow themselves and deliver the resulting callback URL to a logged-in proxy admin. Scripts executing in the proxy origin can read the dashboard session cookie and act with the victim's privileges, up to full admin account takeover.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | litellm | ≥ 1.65.5&&< 1.85.0 | 1.85.0pip install --upgrade 'litellm==1.85.0' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for litellm, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update litellm to 1.85.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-hhww-mrg2-969h is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-hhww-mrg2-969h in your dependencies?
Find it across PyPI, including transitive dependencies.