{"answers":{"affected":"3 open source packages ship an affected version, including litellm. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40217 exists.","fix":"Upgrade litellm to 1.83.10 or later.","what":"CVE-2026-40217 is a high-severity code injection vulnerability in BerriAI LiteLLM, published on 10 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2026-40217 and fix it if it is affected.\n\nWhat it is: CVE-2026-40217 is a high-severity code injection vulnerability in BerriAI LiteLLM, published on 10 Apr 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40217 exists.\n\nAffected packages and fixed versions:\n- litellm (PyPI): affected from 1.81.8; fixed in 1.83.10\n- litellm (PyPI): affected from 1.81.8; fixed in 1.83.10\n- litellm (PyPI): affected from 1.81.8; fixed in 1.83.10\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40217/ (Markdown: https://insights.sbomify.com/CVE-2026-40217/index.md)","id":"CVE-2026-40217","markdown":"https://insights.sbomify.com/CVE-2026-40217/index.md","name":"CVE-2026-40217","record":{"aliases":["CLEANSTART-2026-IM10707","CLEANSTART-2026-UL91233","ECHO-c6d4-cf5f-a050","GHSA-wxxx-gvqv-xp7p","MINI-377r-r3c8-mhq7","MINI-3vcp-7r7v-gxq6","MINI-5mf2-rwc5-qrh5","MINI-6x4w-cc8c-6xw4","MINI-c8gj-mj24-qpfx","MINI-f7r9-xw6c-prv2","MINI-gcpx-2fm7-c67c","MINI-h97j-rjvr-jv7v","MINI-j48c-h23c-j59g","MINI-pgfq-mvrg-8hc5","MINI-prjc-4w9x-fr27","MINI-r977-hmxh-w444","MINI-v6qx-f2q3-8qqf","MINI-wwwm-p4q4-r55j","PYSEC-2026-2601"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"LiteLLM Python library","requires_auth":"low_privilege","summary":"Remote attackers can execute arbitrary code via bytecode rewriting in the LiteLLM library, requiring immediate upgrades.","user_interaction":"not_required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"litellm","vendor":"litellm"}],"cvss":{"score":8.8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-420","name":"Unprotected Alternate Channel"}],"description":"LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2026-05-19","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":1,"refs":[{"date":"2026-05-19T13:19:42Z","kind":"github_poc","ref":"https://github.com/learner202649/CVE-2026-40217-PoC","stars":0,"title":"The code for personally reproducing the corresponding vulnerability"},{"date":null,"kind":"nuclei","ref":"http/cves/2026/CVE-2026-40217.yaml","stars":null,"title":"LiteLLM \u003c 1.25.0 - Remote Code Execution"}],"tier":"weaponised"},"has_fix":true,"headline":"LiteLLM has a sandbox escape in custom-code guardrail","id":"CVE-2026-40217","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":3,"n_references":1,"next":{"headline":"Denial of service in systemd","id":"CVE-2026-40223"},"packages":[{"ecosystem":"PyPI","fixed":["1.83.10"],"introduced":["1.81.8"],"last_affected":[],"package":"litellm","purl":null,"source":"GHSA-wxxx-gvqv-xp7p"},{"ecosystem":"PyPI","fixed":["1.83.10"],"introduced":["1.81.8"],"last_affected":[],"package":"litellm","purl":"pkg:pypi/litellm","source":"GHSA-wxxx-gvqv-xp7p"},{"ecosystem":"PyPI","fixed":["1.83.10"],"introduced":["1.81.8"],"last_affected":[],"package":"litellm","purl":"pkg:pypi/litellm","source":"PYSEC-2026-2601"}],"prev":{"headline":"Use after free in OpenVPN","id":"CVE-2026-40215"},"products":["LiteLLM"],"published":"2026-04-10","related":[{"cvss_score":9.3,"headline":"BerriAI LiteLLM SQL Injection","id":"CVE-2026-42208","kev_date_added":"2026-05-08","published":"2026-05-08"},{"cvss_score":8.8,"headline":"BerriAI LiteLLM Improper Authentication","id":"CVE-2026-59822","kev_date_added":"2026-09-02","published":"2026-07-08"},{"cvss_score":8.7,"headline":"BerriAI LiteLLM Command Injection","id":"CVE-2026-42271","kev_date_added":"2026-06-08","published":"2026-05-08"},{"cvss_score":9.8,"headline":"Remote Code Execution in BerriAI/litellm","id":"CVE-2024-5751","kev_date_added":null,"published":"2024-06-27"},{"cvss_score":9.8,"headline":"Server-Side Template Injection in BerriAI/litellm","id":"CVE-2024-2952","kev_date_added":null,"published":"2024-04-10"},{"cvss_score":9.5,"headline":"LiteLLM: Authentication Bypass via Host Header Injection","id":"CVE-2026-49468","kev_date_added":null,"published":"2026-06-22"},{"cvss_score":9.4,"headline":"LiteLLM has an authentication bypass via OIDC userinfo cache key collision","id":"CVE-2026-35030","kev_date_added":null,"published":"2026-04-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"attribution","licence":"MIT","name":"Nuclei templates"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-07-15","vendors":["BerriAI"]},"summary":"Remote attackers can execute arbitrary code via bytecode rewriting in the LiteLLM library, requiring immediate upgrades.","url":"https://insights.sbomify.com/CVE-2026-40217/"}