CVE Decoded #7: CVE-2026–77304 (llm-council-core)
The llm-council-core tool's file selector treated .env, .npmrc and .yarnrc files as ordinary text and included their contents in prompts sent to third-party LLM providers. A developer running verify() on a repository with such files committed could therefore leak database passwords, API keys and registry tokens to those providers.
medium.com
Published on medium.com
Oscp
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
llm-council-core is an open-source Python project, distributed on PyPI, that implements a multi-LLM deliberation system: a "council" of AI models that review code together. The author notes it was originally inspired by Andrej Karpathy. The council works in three stages:
- Fan-Out: the code is sent simultaneously to multiple LLM providers (OpenAI, Anthropic, Google, etc.) for independent analysis.
- Peer Review: each model reviews and ranks the other models' responses anonymously.
- Chairman Synthesis: a designated "chairman" model compiles everything into a final, consensus-driven verdict.
The feature at the centre of the CVE is the verify() function, often used through the council-verify or llm-council gate CLI commands. It is a CI/CD quality gate: it takes a snapshot of the code pinned to a specific git commit, bundles the files into prompts, sends them to the council, and returns a hard pass/fail verdict with a confidence score. Developers wire it into GitHub Actions, pre-commit hooks and deployment pipelines to catch bugs, security flaws and code quality issues before merging.
Before verify() can ask a model to review code, it has to decide which files to read. Not every file in a project is source code, so llm-council kept a collection of "text-like" file extensions and filenames in a constants module, effectively a whitelist of file types it considered safe and useful to read.
Setup
The report's basic details list the affected software as llm-council-core before 0.22.0, 0.39.0. The attack steps describe the vulnerable range as any version from 0.22.0 to 0.38.x, installed and configured with the user's preferred LLM providers. The fix landed in v0.39.0.
The precondition is a project in which a .env, .npmrc or .yarnrc file has been committed to git. Because verify() reads from git snapshots, only committed files were at risk: a .env that was properly gitignored and never committed was not affected by this CVE. The report notes that many teams, especially those with private repositories, commit .env.example, .npmrc or .yarnrc files with real tokens, assuming that a private repository means nobody will see them.
No attacker account or special tooling is needed. The developer runs the tool normally, either locally against a git commit or through a CI pipeline.
Finding it
The problem was in the file selector's whitelist. The constants module held a set of "text-like" extensions and filenames:
TEXT_EXTENSIONS = {".py",".js",".ts",".md",".txt",".json",".yaml",".yml",".toml",".cfg",".ini",".env", ".npmrc", ".yarnrc", }
.env files are text files, technically, but they are not source code. They are where developers store the passwords and API keys their application needs to run, something like this:
DATABASE_URL=postgres://admin:s3cretP@[redacted]:5432/productionOPENAI_API_KEY=sk-proj-8a7f3b…STRIPE_SECRET_KEY=sk_live_4eC39H…AWS_SECRET_ACCESS_KEY=[redacted]=super-secret-do-not-share
The report describes this file as the crown jewels: the first thing listed in every .gitignore template, and something security training says never to commit, never to share and never to send anywhere. The file selector saw .env and treated it as a text file the AI reviewer would want to see. .npmrc, which stores private npm registry tokens, and .yarnrc, which can contain authentication tokens for Yarn package registries, were on the same list.

The matching was also broader than the exact names. Any file whose name started with .env matched the text-file check, so variants such as .env.example were shipped off too. The report explains why that matters: developers copy .env.example to .env, fill in real values and forget to scrub the example file, or leave real default values in the example "for convenience".
Exploitation
This is not a hack in the traditional sense. There is no attacker sending a malicious payload; the damage happens through normal, intended use of the tool.
Step 1: install and configure
The developer installs llm-council-core (any version from 0.22.0 to 0.38.x) and configures it with their preferred LLM providers.
Step 2: run verify()
The developer runs verify() on their project, either through a CI pipeline or locally targeting a git commit. verify() takes a snapshot of the project, pinned to a specific git commit SHA.
Step 3: the file selector queries the snapshot
The file selector queries every file in the git snapshot and checks whether each file's name or extension matches TEXT_EXTENSIONS. Committed .env, .npmrc and .yarnrc files match.
Step 4: contents are read and assembled into a prompt
The tool reads the contents of those files from the git snapshot, via git show <sha>:<path>, and assembles them into a prompt string alongside the actual source code.
Step 5: the prompt leaves the network
The prompt, now containing database passwords, API keys and registry tokens, is transmitted over HTTPS to one or more external LLM API endpoints (OpenAI, Anthropic, Google, etc.).
Step 6: the provider holds the secrets
Depending on the provider's data retention policies, the database passwords, API keys and registry tokens may be logged, cached or stored in training pipelines.
The developer never sees a warning. The tool works exactly as designed, the output looks normal, and there is no error or red flag. The secrets ride along quietly in the prompt payload.
Root cause
The core issue was the absence of any secret-path filtering. The file selector in the verify() pipeline looked roughly like this:
import osfrom llm_council.verification.constants import TEXT_EXTENSIONSdef collect_files(snapshot_dir: str) -> list[str]:"""Walk the snapshot and collect all text-like files for LLM review."""collected = []for root, dirs, files in os.walk(snapshot_dir):for filename in files:filepath = os.path.join(root, filename)if filepath.endswith(tuple(TEXT_EXTENSIONS)):collected.append(filepath)return collected
There was exactly one gate: does the file match TEXT_EXTENSIONS? If yes, it went into the prompt. No denylist, no sensitive-path check, no content inspection. If yes, it went into the prompt.
The report classifies the weakness as Exposure of Sensitive Information to an Unauthorized Actor (CWE-200).
Impact
The CVE scored 5.3 Medium (CVSS v3.1). The report considers that score about right but notes the consequences can be much worse than "medium" suggests. The score reflects that exploitation requires the developer to actively run the tool; it is not remotely triggerable. The downstream damage from leaked credentials, however, can be catastrophic: unauthorised database access, drained cloud billing accounts and hijacked package registries.
The exposure is limited to files that were actually committed to the repository, because verify() reads from git snapshots. Anyone who ran verify() against a repository containing a committed .env, .npmrc or .yarnrc should assume those credentials were read by a third party.
Fix
Version 0.39.0 introduced three changes.
- A compiled-in, non-overridable secret-path denylist:
TEXT_EXTENSIONS = {".py",".js",".ts",".md",".txt",".json",".yaml",".yml",".toml",".cfg",".ini",}SENSITIVE_FILE_NAMES = frozenset({".env",".[redacted]",".env.development",".env.production",".env.staging",".env.test",".env.example",".env.sample",".npmrc",".yarnrc",".yarnrc.yml","id_rsa","id_ed25519","id_ecdsa",})SENSITIVE_EXTENSIONS = (".pem",".key",".cert",".pfx",".p12",)
- A unified file selector that every candidate file must pass through, enforcing the denylist:
import osfrom llm_council.verification.constants import (TEXT_EXTENSIONS,SENSITIVE_FILE_NAMES,SENSITIVE_EXTENSIONS,)def should_include_file(filepath: str) -> bool:"""Single gate that every candidate file must pass through."""filename = os.path.basename(filepath).lower()if filename in SENSITIVE_FILE_NAMES:return Falseif filepath.endswith(tuple(SENSITIVE_EXTENSIONS)):return Falseif not filepath.endswith(tuple(TEXT_EXTENSIONS)):return Falsereturn Truedef collect_files(snapshot_dir: str) -> list[str]:"""Walk the snapshot and collect files, routing every path through the unified selector."""collected = []for root, dirs, files in os.walk(snapshot_dir):for filename in files:filepath = os.path.join(root, filename)if should_include_file(filepath):collected.append(filepath)return collected
- Boundary validation on
snapshot_idat therun_verificationentry point, so the parameter cannot be manipulated to point outside the expected snapshot directory. The report describes this as closing a secondary path-traversal vector:
def run_verification(snapshot_id: str, **kwargs):if not snapshot_id.isalnum() or len(snapshot_id) > 64:raise ValueError(f"Invalid snapshot_id: {snapshot_id!r}")snapshot_dir = os.path.join(SNAPSHOTS_ROOT, snapshot_id)if not os.path.realpath(snapshot_dir).startswith(os.path.realpath(SNAPSHOTS_ROOT)):raise ValueError("snapshot_id escapes snapshot root")files = collect_files(snapshot_dir)
The heart of the fix, stripped to its essence, is this diff:
- - a/src/llm_council/verification/constants.py@@ -15,9 +15,6 @@".toml",".cfg",".ini",- ".env",- ".npmrc",- ".yarnrc",}++SENSITIVE_FILE_NAMES = frozenset({+ ".env", ".[redacted]", ".env.development", ".env.production",+ ".env.staging", ".env.test", ".env.example", ".env.sample",+ ".npmrc", ".yarnrc", ".yarnrc.yml",+ "id_rsa", "id_ed25519", "id_ecdsa",+})++SENSITIVE_EXTENSIONS = (".pem", ".key", ".cert", ".pfx", ".p12")
For anyone who ran the tool on a repository with committed .env files, the report gives an action checklist:
- Update
llm-council-coreimmediately:pip install upgrade llm-council-core>=0.39.0. - Rotate every credential stored in
.env,.npmrcor.yarnrcin any project whereverify()was run: database passwords, API keys, cloud access keys, JWT secrets. Assume they have been read by a third party. - Audit CI/CD logs to see how many times
verify()was invoked and against which repositories. Each invocation against a repository with a.envfile was a potential leak. - Check the LLM provider's data policies. Some providers log prompts for debugging or training; contact them if confirmation is needed that leaked data has been purged.
- Add
.envto.gitignoreif it is not already there. Sinceverify()works on git snapshots, it can only read committed files, so an uncommitted.envwas never at risk from this specific CVE. Keeping it out of version control remains a critical safety net regardless.
Variants to test
- Other secret-bearing dotfiles in a collector's whitelist. Look for tools that enumerate files by extension or name and then send them off-box. A positive result is a whitelist entry such as
.npmrc,.yarnrc,.pypirc,.netrcor a cloud credentials file that reaches an external endpoint. - Prefix matching on sensitive names. The report says any file whose name started with
.envmatched the text-file check. Test whether.env.example,.env.sample,.[redacted]and similar templates are collected. A positive result is a template file with real or default values appearing in the outbound payload. - Key material by extension. The fix denylists
.pem,.key,.cert,.pfxand.p12, and names such asid_rsa,id_ed25519andid_ecdsa. Test whether a collector includes these. A positive result is a private key or certificate file in the prompt or upload. - Path traversal through snapshot or job identifiers. The fix validates
snapshot_idas alphanumeric, at most 64 characters, and confined to the snapshot root. Test similar identifiers with../sequences or absolute paths. A positive result is a read outside the intended directory. - Content inspection gaps. The fix relies on names and extensions only. Test a secret stored under an innocuous name, such as a
.txtor.jsonfile containing a token. A positive result is that file being collected. - Retention on the receiving side. Where a tool sends prompts to a third-party API, check the provider's logging and training policies. A positive result is confirmation that prompts are retained, which turns any collection bug into durable exposure.
Takeaways
The report draws three lessons. First, "text file" is not a security classification: sensitivity is a property of a file's content and purpose, not its format, and any tool that collects files needs both an allowlist and a denylist. Second, the most dangerous bugs do not look like bugs: there was no crash, no error and no exploit payload, and the seamless happy path was itself the attack path. Third, LLM tooling is a new attack surface: any tool that reads a codebase and sends it to an external API is a potential data exfiltration vector, even when it is "just" asking for a code review.
What happened, in plain words
A free tool called llm-council-core helps programmers check their code. You point it at a project, it copies the project's files, and it sends those copies to several artificial intelligence services (the same kind of AI that powers chat assistants) so they can read the code and tell you whether it is good or bad.
The problem: the tool also copied a file called .env, which is where programmers keep their passwords and secret keys, and sent that file to the AI services too. Nobody attacked the tool. It did exactly what it was built to do. It just did too much, silently, with no warning.
This article walks through the whole story: what the tool is, what a .env file is, why it ended up in the package sent to the AI, what the fix looks like, and what to do if you ever ran the tool on a project that had such a file saved in its history.

Some words you will meet, explained once
Before the story, a handful of everyday ideas. Each one comes back later, so keep them nearby.
- Code / source code: the written instructions that make a program work. Think of a recipe written in a language a computer understands.
- Open source: software whose code is published for anyone to read, use and improve, usually for free. Like a recipe book anyone can copy from.
- Python: a popular programming language. It reads a bit like English, which is why many beginners start with it.
- PyPI: the main online shop or library where Python programs are published so others can download and install them. Think of an app store, but for pieces of code.
- Library / package: a bundle of ready-made code that other programs can borrow instead of writing everything from scratch. Like buying a ready-made cake mix instead of measuring flour.
- LLM (Large Language Model): the technology behind AI chat assistants. It has read an enormous amount of text and can answer questions or review writing. "Provider" means the company that runs the LLM, for example OpenAI, Anthropic or Google.
- API: a way for one program to talk to another over the internet. Think of a restaurant's service window: you hand over an order, the kitchen prepares it, you get a dish back. You never enter the kitchen yourself.
- Prompt: the text you send to an AI model. It is the question, or in this case the code plus instructions, that the model reads before answering.
.envfile: a small text file where a program keeps its passwords, API keys and other secrets so it can log in to other services. Think of a sticky note with the safe combination on it, kept next to the safe.- API key: a long secret string that proves a program is allowed to use a paid service. Like a membership card number: whoever has it can spend your money.
- Token: here, a secret string used for logging in to a service, for example a package registry. Similar idea to a password.
- Git: a system that records every change made to a project's files, so you can go back in time. Think of a very detailed diary of a folder.
- Commit: one saved entry in that diary. Each commit has a unique fingerprint called a SHA, a long string of letters and numbers.
- Snapshot: a frozen copy of the project at one particular commit. Like photocopying the whole folder at one moment.
- CI/CD pipeline: an automatic assembly line that builds and tests software whenever someone changes it. GitHub Actions is one such service.
- CLI: command line interface, a way to run a program by typing its name in a text window instead of clicking buttons.
- HTTPS: the secure, encrypted version of the web protocol. It stops strangers on the network from reading what is sent, but it does not stop the receiver from reading it.
- CVE: a public catalogue number given to a known security flaw, so everyone can refer to the same issue. Like a case number at a police station.
- CVSS: a score from 0 to 10 that estimates how serious a flaw is. Higher is worse.
- CWE-200: a label for a whole family of flaws meaning "sensitive information was shown to someone who should not have seen it".
- Path traversal: tricking a program into reading a file outside the folder it was supposed to stay in, usually by putting
../in a name.../means "go up one folder". - Denylist / allowlist: a list of things to refuse, versus a list of things to permit. A bouncer with a guest list versus a bouncer with a list of banned people.
- Credential rotation: replacing a password or key with a new one, so the old one stops working. Like changing the locks after losing your keys.
What llm-council-core is
The project is an open-source Python package, published on PyPI, that runs a "council" of AI models over your code. The author of the write-up notes it was originally inspired by Andrej Karpathy.
The council works in three stages:
- Fan-Out: your code is sent at the same time to several AI providers (OpenAI, Anthropic, Google and others) so each one can analyse it independently.
- Peer Review: each model reads and ranks the other models' answers, without knowing which model wrote which.
- Chairman Synthesis: one designated "chairman" model combines everything into a single final verdict.
A useful comparison: imagine you are a teacher grading essays. You want a second opinion, so you photocopy each essay and mail a copy to three different tutors. Each tutor grades independently, then they compare notes, and a head tutor writes the final mark. That is the council, but for code instead of essays.
The feature at the centre of this story is a function called verify(), often used through the council-verify or llm-council gate commands. A function is a named block of code that does a job when called; think of it as a labelled button. verify() is a quality gate: it takes a snapshot of your code pinned to one specific git commit, bundles the files into prompts, sends them to the council, and returns a hard pass or fail with a confidence score. Developers connect it to GitHub Actions, pre-commit hooks (checks that run automatically before a change is saved) and deployment pipelines, so bugs and security problems are caught before the code is merged into the main project.
Before verify() can ask a model to review anything, it has to decide which files to read. Not every file in a project is source code: there are images, compiled programs, fonts. So the project kept a list of "text-like" file extensions and filenames in a constants module. A constants module is simply a file that stores fixed values used elsewhere in the program. This list worked as an allowlist: file types the tool considered safe and useful to read.
The setup: versions and the one condition that matters
The report's basic details list the affected software as llm-council-core before 0.22.0, 0.39.0. The attack steps describe the vulnerable range as any version from 0.22.0 to 0.38.x, installed and configured with the user's preferred AI providers. The fix arrived in version 0.39.0.
There is one precondition: the project must have a .env, .npmrc or .yarnrc file committed to git. Because verify() reads from git snapshots, only files that were actually saved in the project's history were at risk. A .env that was properly listed in .gitignore (a file that tells git which files to ignore) and never committed was not affected by this CVE.
The report notes that many teams, especially those with private repositories, commit .env.example, .npmrc or .yarnrc files containing real tokens, assuming that a private repository means nobody will ever see them.
No attacker account and no special tooling are needed. The developer runs the tool normally, either locally against a git commit or through a CI pipeline.
Finding it: the list that let secrets through
The problem was in the file selector's allowlist. The constants module held a set of "text-like" extensions and filenames:
TEXT_EXTENSIONS = {".py",".js",".ts",".md",".txt",".json",".yaml",".yml",".toml",".cfg",".ini",".env", ".npmrc", ".yarnrc", }
Line by line:
TEXT_EXTENSIONS = { ... }creates a named collection calledTEXT_EXTENSIONS. The curly braces hold a set, which is just a bag of values with no order.".py",".js",".ts"and so on are file endings..pymeans a Python file,.jsa JavaScript file,.mda Markdown document,.jsonand.yamland.tomlare configuration formats,.txtis plain text.".env",".npmrc"and".yarnrc"are the dangerous entries. They are not source code. They are files that hold secrets.
The tool's logic was: if a file ends with one of these, it is text, so send it to the AI. .env files are text files, technically, but they are not code. They are where developers store the passwords and API keys their application needs in order to run. Something like this:
DATABASE_URL=postgres://admin:s3cretP@[redacted]:5432/productionOPENAI_API_KEY=sk-proj-8a7f3b…STRIPE_SECRET_KEY=sk_live_4eC39H…AWS_SECRET_ACCESS_KEY=[redacted]=super-secret-do-not-share
What each line means:
DATABASE_URL=...is the address and login for a database, the place where an application stores its data. It contains a username (admin) and a password (s3cretP@ssw0rd). Anyone with this line can open the database.OPENAI_API_KEY=...is the membership card that lets a program use OpenAI's paid service. Whoever holds it can spend the owner's money.STRIPE_SECRET_KEY=...is the equivalent for Stripe, a service that handles online payments. Leaking it can mean someone else can move money.AWS_SECRET_ACCESS_KEY=...is a key for Amazon Web Services, a cloud provider where companies rent computers. With it, an outsider can use, change or delete those rented machines.JWT_SIGNING_SECRET=...is the secret used to stamp login passes as genuine. If someone else knows it, they can forge passes and pretend to be any user.
The report calls this file the crown jewels: the first thing listed in every .gitignore template, and something security training says never to commit, never to share and never to send anywhere. The file selector saw .env and treated it as a text file the AI reviewer would want to see. .npmrc, which stores private npm registry tokens, and .yarnrc, which can contain authentication tokens for Yarn package registries, were on the same list. A package registry is the online library where code packages are published; a token for it lets someone download private packages or publish new ones in your name.
The matching was also broader than the exact names. Any file whose name started with .env matched the text-file check, so variants such as .env.example were shipped off too. The report explains why that matters: developers copy .env.example to .env, fill in real values and forget to clean the example file, or leave real default values in the example "for convenience".
Exploitation: how the secrets left the building
This is not a hack in the traditional sense. There is no attacker sending a malicious payload; the damage happens through normal, intended use of the tool.
Step 1: install and configure
The developer installs llm-council-core (any version from 0.22.0 to 0.38.x) and configures it with their preferred AI providers. This is the ordinary setup step, the same as installing any app and signing in.
Step 2: run verify()
The developer runs verify() on their project, either through a CI pipeline or locally targeting a git commit. verify() takes a snapshot of the project, pinned to a specific git commit SHA. The SHA matters because it fixes exactly which version of the files is read: the one saved in the project's history, not whatever is lying around on the developer's disk.
Step 3: the file selector queries the snapshot
The file selector looks at every file in the git snapshot and checks whether each file's name or extension matches TEXT_EXTENSIONS. Committed .env, .npmrc and .yarnrc files match. This is the moment the mistake happens: the tool is doing its job, but its job description includes the safe.
Step 4: contents are read and assembled into a prompt
The tool reads the contents of those files from the git snapshot, via git show <sha>:<path>, and assembles them into a prompt string alongside the actual source code. git show is a git command that prints a file as it existed at a given commit; <sha> is the commit fingerprint and <path> is the file's location in the project. The result is one long piece of text: your real code, plus your passwords, ready to be sent.
Step 5: the prompt leaves the network
The prompt, now containing database passwords, API keys and registry tokens, is transmitted over HTTPS to one or more external AI API endpoints (OpenAI, Anthropic, Google and others). HTTPS protects the message while it travels, like an armoured van, but the company at the other end still opens the box and reads what is inside.
Step 6: the provider holds the secrets
Depending on the provider's data retention policies, the database passwords, API keys and registry tokens may be logged, cached or stored in training pipelines. Retention policy means how long a company keeps what you send it. Training pipeline means the process of feeding text to an AI so it learns from it; text used there can stick around for a very long time.
The developer never sees a warning. The tool works exactly as designed, the output looks normal, and there is no error or red flag. The secrets ride along quietly in the prompt payload. Payload simply means the actual content being carried, as opposed to the envelope around it.
Root cause: one gate, and it was the wrong gate
The core issue was the absence of any secret-path filtering. The file selector in the verify() pipeline looked roughly like this:
import osfrom llm_council.verification.constants import TEXT_EXTENSIONSdef collect_files(snapshot_dir: str) -> list[str]:"""Walk the snapshot and collect all text-like files for LLM review."""collected = []for root, dirs, files in os.walk(snapshot_dir):for filename in files:filepath = os.path.join(root, filename)if filepath.endswith(tuple(TEXT_EXTENSIONS)):collected.append(filepath)return collected
Line by line:
import osloads Python's built-in toolbox for working with files and folders.from llm_council.verification.constants import TEXT_EXTENSIONSfetches the allowlist from the constants module, the same list we saw above.def collect_files(snapshot_dir: str) -> list[str]:defines a function namedcollect_files. It receives a folder path (snapshot_dir) and promises to return a list of text strings (list[str]), one per file found.- The triple-quoted line is a docstring, a note for humans describing what the function does: walk the snapshot and collect all text-like files for AI review.
collected = []starts an empty list, the basket where found files will go.for root, dirs, files in os.walk(snapshot_dir):walks through every folder inside the snapshot, one at a time.os.walkis like a person opening every drawer in a filing cabinet.for filename in files:goes through each file in the current folder.filepath = os.path.join(root, filename)builds the full path by gluing the folder and the filename together.if filepath.endswith(tuple(TEXT_EXTENSIONS)):is the single check. It asks: does this path end with one of the allowed endings?tuple(...)just converts the set into a form theendswithcheck accepts.collected.append(filepath)adds the file to the basket if the check passed.return collectedhands the basket back to the caller.
There was exactly one gate: does the file match TEXT_EXTENSIONS? If yes, it went into the prompt. No denylist, no sensitive-path check, no content inspection. If yes, it went into the prompt. A denylist would have been a second list saying "never these", and there was none.
The report classifies the weakness as Exposure of Sensitive Information to an Unauthorized Actor (CWE-200). In plain words: information that should have stayed private was handed to someone who was never meant to see it.
Impact: why a 5.3 still hurts
The CVE scored 5.3 Medium (CVSS v3.1). The report considers that score about right but notes the consequences can be much worse than "medium" suggests. The score reflects that exploitation requires the developer to actively run the tool; it is not remotely triggerable, meaning no stranger on the internet can fire it off from afar. The downstream damage from leaked credentials, however, can be catastrophic: unauthorised database access, drained cloud billing accounts and hijacked package registries.
The exposure is limited to files that were actually committed to the repository, because verify() reads from git snapshots. Anyone who ran verify() against a repository containing a committed .env, .npmrc or .yarnrc should assume those credentials were read by a third party.
Fix: what version 0.39.0 changed
Version 0.39.0 introduced three changes.
1. A denylist of secret files
A compiled-in, non-overridable secret-path denylist was added, and the sensitive names were removed from the text allowlist:
TEXT_EXTENSIONS = {".py",".js",".ts",".md",".txt",".json",".yaml",".yml",".toml",".cfg",".ini",}SENSITIVE_FILE_NAMES = frozenset({".env",".[redacted]",".env.development",".env.production",".env.staging",".env.test",".env.example",".env.sample",".npmrc",".yarnrc",".yarnrc.yml","id_rsa","id_ed25519","id_ecdsa",})SENSITIVE_EXTENSIONS = (".pem",".key",".cert",".pfx",".p12",)
Line by line:
TEXT_EXTENSIONSis now the same list as before, minus.env,.npmrcand.yarnrc. The dangerous entries are gone from the "please read this" list.SENSITIVE_FILE_NAMES = frozenset({ ... })creates a second list, this time of names to refuse.frozensetis a set that cannot be changed after it is created.- The names inside cover every common
.envvariant (.local,.development,.production,.staging,.test,.example,.sample), the two package registry files, andid_rsa,id_ed25519andid_ecdsa, which are the standard names of SSH private keys. An SSH key is the digital equivalent of a house key that lets you log in to servers without a password. SENSITIVE_EXTENSIONS = (".pem",".key",".cert",".pfx",".p12",)is a third list, of file endings that usually mean certificates or private keys. A certificate is a digital identity document;.pem,.key,.pfxand.p12are common containers for keys and certificates.
2. One gate that every file must pass
A unified file selector was introduced, and every candidate file must pass through it, enforcing the denylist:
import osfrom llm_council.verification.constants import (TEXT_EXTENSIONS,SENSITIVE_FILE_NAMES,SENSITIVE_EXTENSIONS,)def should_include_file(filepath: str) -> bool:"""Single gate that every candidate file must pass through."""filename = os.path.basename(filepath).lower()if filename in SENSITIVE_FILE_NAMES:return Falseif filepath.endswith(tuple(SENSITIVE_EXTENSIONS)):return Falseif not filepath.endswith(tuple(TEXT_EXTENSIONS)):return Falsereturn Truedef collect_files(snapshot_dir: str) -> list[str]:"""Walk the snapshot and collect files, routing every path through the unified selector."""collected = []for root, dirs, files in os.walk(snapshot_dir):for filename in files:filepath = os.path.join(root, filename)if should_include_file(filepath):collected.append(filepath)return collected
Line by line:
- The imports now bring in all three lists: the allowlist and the two denylists.
def should_include_file(filepath: str) -> bool:defines a small function that answers one yes or no question about a single file.boolmeans the answer isTrueorFalse.filename = os.path.basename(filepath).lower()takes just the file's name, without the folders in front of it, and lowercases it. Lowercasing means.ENVand.envare treated the same, so a change of capital letters cannot sneak past.if filename in SENSITIVE_FILE_NAMES: return Falseis the first refusal: if the name is on the secret list, the file is dropped immediately.if filepath.endswith(tuple(SENSITIVE_EXTENSIONS)): return Falseis the second refusal: if the file ends like a key or certificate, drop it.if not filepath.endswith(tuple(TEXT_EXTENSIONS)): return Falseis the third check: if the file is not on the allowlist, drop it. Thenotflips the question, so this line means "if it is not an allowed type, refuse".return Trueis reached only if the file survived all three checks, so it is allowed.- The second function,
collect_files, is the same walk as before, but the single old check is replaced byif should_include_file(filepath):. Every file now goes through the same gate, in the same order, so there is no second path that could skip a check.
3. Checking the snapshot name
Boundary validation was added on snapshot_id at the run_verification entry point, so the parameter cannot be manipulated to point outside the expected snapshot folder. The report describes this as closing a secondary path-traversal vector:
def run_verification(snapshot_id: str, **kwargs):if not snapshot_id.isalnum() or len(snapshot_id) > 64:raise ValueError(f"Invalid snapshot_id: {snapshot_id!r}")snapshot_dir = os.path.join(SNAPSHOTS_ROOT, snapshot_id)if not os.path.realpath(snapshot_dir).startswith(os.path.realpath(SNAPSHOTS_ROOT)):raise ValueError("snapshot_id escapes snapshot root")files = collect_files(snapshot_dir)
Line by line:
def run_verification(snapshot_id: str, **kwargs):defines the entry point, the function a user's program calls to start a verification. It receives asnapshot_id, the name of the snapshot to use, plus any extra settings in**kwargs.if not snapshot_id.isalnum() or len(snapshot_id) > 64:checks two things at once: the name must contain only letters and numbers (isalnum), and it must be at most 64 characters long. A name with slashes or dots in it is refused here.raise ValueError(f"Invalid snapshot_id: {snapshot_id!r}")stops the program with a clear error if the name failed the check. Thef"..."part inserts the bad name into the message, and!rshows it in a safe, quoted form.snapshot_dir = os.path.join(SNAPSHOTS_ROOT, snapshot_id)builds the full folder path by joining the fixed root folder with the checked name.if not os.path.realpath(snapshot_dir).startswith(os.path.realpath(SNAPSHOTS_ROOT)):is the belt-and-braces check.os.path.realpathresolves any..or shortcuts into the true final path, andstartswithasks whether that true path still begins with the snapshot root. If it does not, the name has escaped the folder.raise ValueError("snapshot_id escapes snapshot root")stops the program in that case.files = collect_files(snapshot_dir)finally collects the files, only after the folder has been proven safe.
The diff that matters
The heart of the fix, stripped to its essence, is this diff. A diff is a side-by-side view of what changed: lines starting with - were removed, lines starting with + were added.
- - a/src/llm_council/verification/constants.py@@ -15,9 +15,6 @@".toml",".cfg",".ini",- ".env",- ".npmrc",- ".yarnrc",}++SENSITIVE_FILE_NAMES = frozenset({+ ".env", ".[redacted]", ".env.development", ".env.production",+ ".env.staging", ".env.test", ".env.example", ".env.sample",+ ".npmrc", ".yarnrc", ".yarnrc.yml",+ "id_rsa", "id_ed25519", "id_ecdsa",+})++SENSITIVE_EXTENSIONS = (".pem", ".key", ".cert", ".pfx", ".p12")
What it shows: the three dangerous names are removed from the allowlist, and a new denylist is added with every .env variant, the registry files, the SSH key names and the key and certificate endings. The same names that used to be invited in are now explicitly turned away.
What to do if you ran the tool
For anyone who ran the tool on a repository with committed .env files, the report gives an action checklist:
- Update
llm-council-coreimmediately:pip install upgrade llm-council-core>=0.39.0.pipis Python's installer, the tool that fetches packages from PyPI;>=0.39.0means "version 0.39.0 or newer". - Rotate every credential stored in
.env,.npmrcor.yarnrcin any project whereverify()was run: database passwords, API keys, cloud access keys, JWT secrets. Assume they have been read by a third party. Rotating means creating new ones and switching the application over, so the old ones are useless to anyone who copied them. - Audit CI/CD logs to see how many times
verify()was invoked and against which repositories. Each invocation against a repository with a.envfile was a potential leak. Logs are the automatic diary that systems keep of what happened and when. - Check the AI provider's data policies. Some providers log prompts for debugging or training; contact them if confirmation is needed that leaked data has been purged.
- Add
.envto.gitignoreif it is not already there. Sinceverify()works on git snapshots, it can only read committed files, so an uncommitted.envwas never at risk from this specific CVE. Keeping it out of version control remains a critical safety net regardless.
Variants to test
- Other secret-bearing dotfiles in a collector's allowlist. Look for tools that list files by extension or name and then send them off the machine. A positive result is an allowlist entry such as
.npmrc,.yarnrc,.pypirc,.netrcor a cloud credentials file that reaches an external endpoint. A dotfile is a file whose name starts with a dot, often used for configuration. - Prefix matching on sensitive names. The report says any file whose name started with
.envmatched the text-file check. Test whether.env.example,.env.sample,.[redacted]and similar templates are collected. A positive result is a template file with real or default values appearing in the outbound payload. - Key material by extension. The fix denylists
.pem,.key,.cert,.pfxand.p12, and names such asid_rsa,id_ed25519andid_ecdsa. Test whether a collector includes these. A positive result is a private key or certificate file in the prompt or upload. - Path traversal through snapshot or job identifiers. The fix validates
snapshot_idas alphanumeric, at most 64 characters, and confined to the snapshot root. Test similar identifiers with../sequences or absolute paths. A positive result is a read outside the intended folder. - Content inspection gaps. The fix relies on names and extensions only. Test a secret stored under an innocuous name, such as a
.txtor.jsonfile containing a token. A positive result is that file being collected. - Retention on the receiving side. Where a tool sends prompts to a third-party API, check the provider's logging and training policies. A positive result is confirmation that prompts are retained, which turns any collection bug into lasting exposure.
Takeaways
The report draws three lessons.
First, "text file" is not a security classification. Sensitivity is a property of a file's content and purpose, not its format, and any tool that collects files needs both an allowlist and a denylist. A shopping list and a bank statement are both paper; only one should be handed to a stranger.
Second, the most dangerous bugs do not look like bugs. There was no crash, no error and no exploit payload, and the seamless happy path was itself the attack path. When everything works perfectly, nobody goes looking for a fix.
Third, AI tooling is a new attack surface. Any tool that reads a codebase and sends it to an external API is a potential data exfiltration vector, even when it is "just" asking for a code review. Exfiltration means data leaving a place it was supposed to stay.
Glossary
- API: a way for one program to talk to another over the internet, like a service window where you hand over an order and receive a result.
- API key: a long secret string that proves a program may use a paid service; whoever holds it can spend the owner's money.
- Allowlist: a list of things that are permitted.
- Certificate: a digital identity document used to prove who a server or person is.
- CI/CD pipeline: an automatic assembly line that builds and tests software whenever it changes.
- CLI: command line interface, running a program by typing its name in a text window.
- Commit: one saved entry in a git project's history, identified by a fingerprint called a SHA.
- Constants module: a file in a program that stores fixed values used elsewhere.
- Credential: any secret used to prove identity, such as a password, key or token.
- Credential rotation: replacing a secret with a new one so the old one stops working.
- CVE: a public catalogue number for a known security flaw.
- CVSS: a score from 0 to 10 estimating how serious a flaw is.
- CWE-200: the label for flaws where sensitive information is exposed to someone not meant to see it.
- Denylist: a list of things that are refused.
- Diff: a view of what changed between two versions of a file, with removed lines marked
-and added lines marked+. - Dotfile: a file whose name starts with a dot, usually configuration.
.envfile: a small text file holding a program's passwords, API keys and other secrets.- Exfiltration: data leaving a place where it was supposed to stay.
- Fan-Out: the first council stage, sending code to several AI providers at once.
- Function: a named block of code that performs a job when called.
- Git: a system that records every change to a project's files so you can go back in time.
.gitignore: a file telling git which files it should never record.- HTTPS: the encrypted version of the web protocol; it protects data in transit but not from the receiver.
- Library / package: a bundle of ready-made code other programs can borrow.
- LLM (Large Language Model): the technology behind AI assistants that read and write text.
- Logs: the automatic diary systems keep of what happened and when.
- Open source: software whose code is published for anyone to read, use and improve.
- Package registry: the online library where code packages are published and downloaded.
- Path traversal: tricking a program into reading files outside its intended folder, usually with
../. - Payload: the actual content being carried, as opposed to the envelope around it.
- pip: Python's installer, which fetches packages from PyPI.
- Prompt: the text sent to an AI model, including the question and any material it should read.
- PyPI: the main online library where Python packages are published.
- Python: a popular programming language that reads a bit like English.
- Retention policy: how long a company keeps the data you send it.
- SHA: the long fingerprint that identifies one git commit.
- Snapshot: a frozen copy of a project at one particular commit.
- SSH private key: a digital house key that lets you log in to servers without a password.
- Token: a secret string used to log in to a service, similar in effect to a password.
- Training pipeline: the process of feeding text to an AI so it learns from it, where text can persist for a long time.
verify(): the llm-council-core function that snapshots code, sends it to the AI council and returns a pass or fail verdict.