NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-7206: sqlite-mcp has an Injection issue

mediumCVSS 4.0 5.5 · 3.1 7.3GHSA-4j28-22qp-rjcf

sqlite-mcp up to 0.1.0 has an injection flaw in `extract_to_json` in `src/entry.py`. The `output_filename` argument went straight into `open()`, so a caller could write the JSON export to any path. The same function also built its SQL from an unchecked `table_name`. A public exploit exists. No patched release is listed, but a fix commit exists.

Published Apr 28, 2026 · Updated May 6, 2026 · Analysis Oct 29, 2026

What an attacker can do

extract_to_json is an MCP tool that queries a SQLite table and writes the rows to a JSON file. Before the fix it appended .json to output_filename and opened that path as given. A value such as ../../../../tmp/evil wrote the file wherever it resolved. The advisory classifies the flaw as injection (SQL injection through output_filename), but the fix commit addresses the path in output_filename and the table name in the query.

The same commit validates table_name with isidentifier() and bracket-quotes it, because the query was SELECT * FROM {table_name};. That tells you the query text was also built from caller input.

Any client that can call the MCP tool can use the flaw. That includes an AI agent steered by prompt injection. The advisory calls it remote with no privileges, and says the exploit is public. The practical results are writing JSON files into directories the server can write to, and reading data from tables the caller should not reach. The file content is database rows, so overwriting a config or script is limited by the JSON format. The CVSS scores rate the impact as low across the board.

Who is affected

sqlite-mcp (pip) version 0.1.0 and earlier, the extract_to_json function in src/entry.py.

pip show sqlite-mcp

Also check your MCP client configuration for entries that start this server and which database it opens.

sqlite-mcp

Ecosystem
PyPI
Affected
<= 0.1.0
Fixed in
No patched version yet
Check
pip show sqlite-mcp

How to fix it

No patched version is listed. The fix is commit a5580cb992f4f6c308c9ffe6442b2e76709db548 in the project's repository. It strips directory parts from output_filename with os.path.basename(). It writes into the database's directory and rejects paths that escape it. It also checks table_name with isidentifier() and bracket-quotes it. Apply the commit or install from a source that includes it, and watch the project for a tagged release above 0.1.0.

The sources give no other workaround. Until then, limit which clients can reach the server, point it at a database that holds nothing sensitive and run it under an account with minimal write access.

How to tell if you were hit

Review MCP tool-call logs for extract_to_json calls whose output_filename contains .., a slash or an absolute path, and whose table_name contains quotes, brackets, semicolons or spaces. On disk, look for unexpected .json files outside the database directory, written by the user account running the server. The advisory gives no log signature.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A security flaw has been discovered in dubydu sqlite-mcp up to 0.1.0. The affected element is the function extract_to_json of the file src/entry.py. Performing a manipulation of the argument output_filename results in sql injection. Remote exploitation of the attack is possible. The exploit has been released to the public and may be used for attacks. The patch is named a5580cb992f4f6c308c9ffe6442b2e76709db548. Applying a patch is the recommended action to fix this issue.

Questions

Is there a patched sqlite-mcp release for CVE-2026-7206?

The advisory data lists no patched version. A fix commit, a5580cb992f4f6c308c9ffe6442b2e76709db548, exists in the repository.

Is this really SQL injection?

The advisory labels it injection through output_filename. The fix commit changes the output path handling and also adds an identifier check on table_name, which fed the SQL query.

Can an AI agent trigger it?

Yes, in principle. The flaw sits in the arguments of an MCP tool, so any client or agent that can call extract_to_json can pass crafted values.

Is a public exploit available?

The advisory says the exploit has been released to the public. No source reports attacks in the wild.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries