/

CVE-2026-130008

Severity:

HIGH RISK

(8.2)

SQL Injection (CWE-89) in sqlite-mcp Server Tooling

CVE-2026-130008

Received

Vulnerability type

Category:

SQL Injection and Authorization Bypass

CWE:

CWE-89, CWE-863

Impact:

Unauthorized database access and modification

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

sqlite-mcp's default read-only mode can be bypassed through SQL statement handling and caller-controlled table names used in a PRAGMA operation. A client able to reach the server can potentially attach databases, access other SQLite files, or make a protected database writable.

Affected context

The issue affects sqlite-mcp deployments where the server's tools are reachable and the default read-only mode is relied on to restrict database operations. The vulnerable paths are execute_query, which may allow trailing statements after a leading SELECT, and describe_table, which interpolates the supplied table name into PRAGMA table_info. The server listens on all interfaces at :8080 by default and does not provide built-in authentication, so exposure depends on network access and any protections placed in front of it.

Exploit preconditions

  • Attack surface: The sqlite-mcp tool interface, commonly reachable on port 8080
  • Required access: Network reachability to the server; an authenticating proxy or equivalent control can restrict access
  • Trigger point: A client invokes execute_query or describe_table with input that reaches the vulnerable statement handling
  • Why exploitation is possible: Trailing SQL statements may be executed, and caller-controlled table names are interpolated into a PRAGMA statement, allowing ATTACH DATABASE operations despite the intended read-only restriction

Why this happens

The query path does not reliably constrain execution to a single permitted statement, while the table-description path inserts caller-controlled text into SQL syntax. These are SQL injection risks (CWE-89). The read-only mode also fails to enforce the intended access restriction across these operations, which is an authorization enforcement weakness (CWE-863).

Potential impact

  • A client may make a protected database writable despite the default read-only mode.
  • A client could read data from other SQLite database files accessible to the server process.
  • The server may create a SQLite-format file at a path writable by its process.
  • Database integrity or confidentiality could be affected, depending on the server's filesystem permissions and reachable files.

General mitigation guidance

Defensive patterns should ensure that read-only behavior is enforced at every database operation, not just through a connection mode.

  • Restrict query execution to a single, explicitly permitted statement and reject trailing statements.
  • Avoid constructing SQL from caller-controlled identifiers; validate identifiers against an allowlist and use safe quoting where appropriate.
  • Explicitly deny or tightly control database attachment operations.
  • Apply authentication and network access controls, and avoid exposing the tool interface to untrusted clients.
  • Limit the server process's filesystem permissions so it can access only the database files it needs and cannot write to sensitive locations.

How teams detect issues like this

  • Use static analysis and code review to identify SQL assembled through string interpolation, especially in PRAGMA statements and other identifier-bearing operations.
  • Check whether query APIs reject multiple statements and whether read-only policy is enforced for every tool and database operation.
  • Review deployment policies for unauthenticated service endpoints, broad interface binding, and unnecessary filesystem write access.
  • Monitor database activity for unexpected ATTACH DATABASE operations and for creation or access of database files outside approved paths.

Sources

SourceLink
github.comgithub.com/StacklokLabs/sqlite-mcp/commit/1da5a6582a4f9d90c778db5687ddcd0c39d2c1ec
github.comgithub.com/StacklokLabs/sqlite-mcp/commit/3c244d61cc0a9c0cc5e4d74719c1dc83edcfa339
github.comgithub.com/StacklokLabs/sqlite-mcp/pull/112
github.comgithub.com/StacklokLabs/sqlite-mcp/releases/tag/v0.1.2
github.comgithub.com/StacklokLabs/sqlite-mcp/security/advisories/GHSA-q433-mp6c-8v4f

Frequently asked

questions

A client that can reach the sqlite-mcp tool interface may be able to invoke the affected tools. An authenticating proxy or other access control can limit who can do so.

Not necessarily. The server listens on all interfaces at :8080 by default, so network reachability may be sufficient unless network controls or an authenticating proxy restrict access.

Enforce a strict single-statement allowlist, safely validate SQL identifiers, and explicitly prevent attachment operations wherever they are not required. Ensure read-only policy applies consistently to every operation.

Combine SQL construction safeguards with authentication, restricted network exposure, least-privilege filesystem permissions, and code review checks for dynamically constructed SQL.

Find out what's already
exploitable in your codebase.