Three BerriAI case files on the desk. Three fixes that used something the repository already contained: a value already in scope, a sandboxed class imported two years earlier, a library that existed the whole time. The vendor keeps repairing the file in hand and never the thing that is wrong one directory over.
The Nefarious Plan of BerriAI
The patch did not add the hash. The patch finally used it.
That is the last line of CVE-2026-42208: hashed_token Was a Parameter Name. The Function Trusted the Name.. It describes a fix that used a variable already defined eight lines earlier in the same function.
Read three BerriAI case files in a row and this is what the vendor keeps doing. Every patch uses something the repository already had. The knowledge is not acquired. It is late.
The repo already knew in 2024
In CVE-2026-42203: LiteLLM Patched One of Four Jinja2 Prompt Managers, BerriAI's own co-founder committed the fix for Jinja2 server-side template injection in April 2024. The commit replaced an unsandboxed jinja2.Environment with ImmutableSandboxedEnvironment in litellm/llms/prompt_templates/factory.py.
On April 10, 2024, Ishaan Jaff committed
f9cabf09ff49544d3e677f34e6da26de06af1596to LiteLLM.
Server-side template injection is what happens when user input is rendered as a template by an engine that evaluates expressions. Jinja2 ships two environment classes: one that evaluates everything, and one named ImmutableSandboxedEnvironment that refuses access to the Python attributes an attacker needs to reach os.popen. The co-founder picked the sandbox class in 2024.
Then a developer added a new prompt-management module in July 2025 and imported the unsandboxed one. Then a second module. Then a third. Then a fourth. One of them, dotprompt, is reachable over HTTP from any proxy key. That is the CVE. The sandbox class had been imported in the repo since 2024.
The fix is one import line. The codebase had it in 2024.
Four modules, four __init__ methods, four chances to type the wrong class name, four vulnerabilities sitting inside a repo that already contained the right class name. The co-founder's 2024 patch landed on one line and moved no architectural needle.
The function had the value in scope
CVE-2026-42208 is the same shape in miniature. The SQL injection ran because a function built an f-string query with {token}, the raw caller input. Eight lines earlier in the same branch, the same function had computed hashed_token from the same input. The value was in scope. The query did not use it.
The function used it for the secondary lookup. The function did not use it for the primary lookup.
The patch did not add a hash. It did not add a validation step. It parameterized one query and passed in the local that had been waiting in the function since whoever last refactored. A hash computed for a fallback lookup was the value needed for the primary lookup. One substitution closes the bug. Nobody made it.
The fix shipped as the bug
The third file complicates the pattern and does not weaken it. In CVE-2026-40217: LiteLLM's Sandbox Was 34 Regex Patterns. The Fix Was to Delete the File., BerriAI responded to a private report of unauthenticated RCE on the custom-code guardrail endpoint. The February 24 patch added two things: an admin-auth dependency, and a file named code_validator.py. Sixty-three lines. A list of thirty-four regex patterns. The patterns were applied to the submitted Python source as a string before compile() and exec() ran it.
The forbidden-patterns list is the developer's threat model. The Python interpreter does not read regex.
The February fix for the unauthenticated bug was itself the post-auth bug. For seven weeks between February 24 and April 15, BerriAI shipped a sandbox that a four-move chain defeated: concatenate the forbidden token from string pieces, read str.mro()[1] to get object, use gi_code instead of __code__, call code.replace(co_names=...). None of those tokens appeared in the blocklist. The regex engine reads spelling. The interpreter reads values.
The April 15 patch deleted the file.
Sixty-three lines deleted. Zero new lines that scan source code.
The replacement used compile_restricted from the RestrictedPython package, which walks the parsed program tree and catches forbidden constructs at a layer the attacker cannot rewrite by concatenation. That library was not in the LiteLLM repo in February. It was in the Python ecosystem in February. BerriAI chose to write a sandbox instead of using a sandbox. When the choice failed in public, the vendor took eight days to pick the library that existed the whole time.
The commit log does not say SSTI
Read the commit titles.
In file 3, the patch for the HTTP-reachable Jinja2 manager carries the title:
The April 9 commit was titled fix(proxy): improve input validation on management endpoints.
The three sibling modules got their own commit three weeks later, titled fix(security): sandbox jinja2 in gitlab/arize/bitbucket prompt managers. Same vendor, same primitive, different vocabulary. One title names the vulnerability. The other hides it inside two cosmetic authorisation changes bundled into the same diff.
Defenders read commit logs to decide what to upgrade and when. A line that says improve input validation reads as housekeeping. A line that says sandbox jinja2 reads as an advisory. BerriAI shipped the SSTI fix for its HTTP endpoint under the first kind of title. The CVE landed later. Every proxy running an older build between the silent patch and the public CVE was running an unannounced vulnerability.
Not every fault here is BerriAI's
BerriAI did not write Jinja2. BerriAI did not write RestrictedPython. BerriAI did not design Python's generator-attribute surface or PostgreSQL's pg_sleep type-checking. The three CVEs on file do not turn on a bug in any of those. The upstream primitives behaved as documented. The Python interpreter does what the Python interpreter has done since 3.0. Jinja2 ships a sandboxed class with a different name because the authors expected downstream users to pick between the two. The SQL driver supports parameterized queries because that is what SQL drivers do.
The failure recorded in the three files is every time an author picked the wrong name from a menu the author had open. Environment instead of ImmutableSandboxedEnvironment. {token} instead of {hashed_token}. A regex list instead of an AST walker. The language gave the author both choices. The vendor's codebase had modeled the right choice in at least one place. The next file reached for the wrong one.
That is the charge. Not that BerriAI shipped bad primitives. That BerriAI shipped the right primitive once and did not propagate it, and does not have a process that would.
The next one is already in the repo
Read the three files for what they say about BerriAI's architecture, not the bugs. Each manager class in file 3 holds its own Jinja2 environment. Each caller in file 1 holds its own notion of whether the token it passes has been hashed. Each guardrail in file 2 holds its own idea of what a sandbox is. Every new integration gets its own __init__.
The LiteLLM integration catalogue grows with the LLM tooling ecosystem. Every new prompt source, new guardrail, new credential store, new webhook sink is an occasion for a developer to repeat a primitive one directory over. The first file's SQL query is one of many. The third file lists four Jinja2 managers; the follow-up patch names three. Open the integrations directory and count the modules that import jinja2, build their own template string, call exec, or interpolate a token into a database driver. Every one of them is a candidate for the same shape, because the repository does not share a safe base class across them.
The code that will become a BerriAI CVE in 2027 is already in the repo. It was written against a new integration by a developer who did not read the file two directories over.
The next advisory names a fifth manager
File 3 says the May 2 follow-up patched three sibling managers without a CVE. It also says the integration catalogue will keep growing. The next BerriAI advisory names a fifth Jinja2 prompt manager, or an equivalent callback path that trusts a parameter named like a type, or a new guardrail whose author rolled another source-text filter before compile. The affected range starts before the May 2 patch and ends in the next stable release after the CVE lands. The fix is one import, one parameter swap, or the deletion of a file whose contents were the author's threat model written in a notation the runtime cannot read.
The commit that fixes it will not mention the primitive by name.
You have the answer in your own hand
You have a 2024 patch from your co-founder that imports the sandboxed class. You have a function that computes the value that makes the query safe and then does not use it. You have a seven-week window during which your fix was the bug, and a public disclosure timeline that shows you asked the researcher to refile. You have four parallel modules written against the same library by four developers who did not read each other's imports.
I do not think you are lazy. I think you are shipping integrations faster than you are reading your own repository.
Read the file one directory over. The answer has been in it the whole damn time.