{"id":"CVE-2026-59821","aliases":["CVE-2026-59821","GHSA-72m8-9m7m-h278","PYSEC-2026-3478"],"related":[],"kind":"vulnerability","state":"published","title":"LiteLLM: Custom Code Guardrails production endpoints bypass code safety checks","summary":"LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. Prior to 1.82.0-stable, LiteLLM's Custom Code Guardrails production create and update paths did not apply the same sandboxing and validation used by the test endpoint, allowing a privileged user with access to create or update guardrails to submit custom Python code that executed in the LiteLLM proxy environment and could expose secrets available to the process. This issue is fixed in version 1.82.0-stable.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. Prior to 1.82.0-stable, LiteLLM's Custom Code Guardrails production create and update paths did not apply the same sandboxing and validation used by the test endpoint, allowing a privileged user with access to create or update guardrails to submit custom Python code that executed in the LiteLLM proxy environment and could expose secrets available to the process. This issue is fixed in version 1.82.0-stable.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nLiteLLM's Custom Code Guardrails production create/update paths did not apply the same sandboxing and validation used by the test endpoint.\n\nA privileged user with access to create or update guardrails could submit custom Python code that executed in the LiteLLM proxy environment. In deployments without a configured master key, callers could be treated as proxy administrators, making this reachable without intended administrative authorization.\n\nThis could allow arbitrary code execution in the LiteLLM proxy container and exposure of secrets available to the process.\n\n### Patches\n\nThe issue is fixed in `1.82.0-stable`.\n\nLiteLLM recommend upgrading to `1.82.0-stable` or later.\n\n### Workarounds\n\nIf upgrading is not immediately possible:\n\n1. Restrict access to `POST /guardrails` and `PUT /guardrails/{guardrail_id}` to trusted administrators only.\n2. Ensure `LITELLM_MASTER_KEY` is configured.\n3. Avoid enabling Custom Code Guardrails for untrusted users.","format":"markdown","source":"ghsa"},{"lang":"es","text":"LiteLLM es un servidor proxy (Pasarela de IA) para llamar a las API de LLM en formato OpenAI (o nativo). Antes de la versión 1.82.0-stable, las rutas de creación y actualización de producción de las barreras de seguridad de código personalizado de LiteLLM no aplicaban el mismo sandboxing y validación utilizados por el punto final de prueba, lo que permitía a un usuario privilegiado con acceso para crear o actualizar barreras de seguridad enviar código Python personalizado que se ejecutaba en el entorno proxy de LiteLLM y podía exponer secretos disponibles para el proceso. Este problema está solucionado en la versión 1.82.0-stable.","source":"nvd"}],"published":"2026-07-08T19:14:13.265Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","score":2.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N","rating":"LOW"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"< 1.82.0-stable","status":"affected"}],"vendor":"BerriAI","product":"litellm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.82.0"}],"ecosystem":"PyPI","package":"litellm","purl":"pkg:pypi/litellm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.82.0"},{"status":"affected","version":"1.82.0"}],"vendor":"litellm","product":"litellm","cpe":"cpe:2.3:a:litellm:litellm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.82.0"}],"ecosystem":"PyPI","package":"litellm","purl":"pkg:pypi/litellm","source":"pysec"}],"references":[{"url":"https://github.com/BerriAI/litellm/security/advisories/GHSA-72m8-9m7m-h278","tags":["mitigation","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/BerriAI/litellm/commit/e50b4486d0f7aa0497185a1ebcdd2c91f1769eba","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/BerriAI/litellm/releases/tag/v1.82.0-stable","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59821","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/BerriAI/litellm","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/litellm","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-72m8-9m7m-h278","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-07-09T14:38:04.002Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59821","url":"https://www.cve.org/CVERecord?id=CVE-2026-59821","licence":"CVE Terms of Use","modified":"2026-07-09T14:38:09.991Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-72m8-9m7m-h278","url":"https://github.com/advisories/GHSA-72m8-9m7m-h278","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:10.829Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59821","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59821","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3478","url":"https://osv.dev/vulnerability/PYSEC-2026-3478","licence":"CC-BY-4.0","modified":"2026-07-23T15:00:14.016Z"}],"updatedAt":"2026-11-25T22:59:27.423Z","epss":{"score":0.00729,"percentile":0.55428,"date":"2026-12-01T12:00:22.000Z"}}