GHSA-Q433-MP6C-8V4F

Vulnerability from github – Published: 2026-11-19 22:25 – Updated: 2026-11-19 22:25
VLAI
Summary
sqlite-mcp: Read-only mode bypass via statement chaining and SQL injection in describe_table
Details

Summary

In read-only mode (the default), a client that can call the MCP tools can write to the database the server is meant to expose read-only, read other SQLite files, and create new SQLite files anywhere the server process can write. There are two ways in: statement chaining through execute_query, and SQL injection through describe_table.

Details

  • Statement chaining in execute_query. The only check was that the query starts with SELECT. The modernc.org/sqlite driver runs every ;-separated statement in one call, so anything after SELECT 1; ran unchecked.
  • SQL injection in describe_table. The table_name argument was interpolated into PRAGMA table_info(%s) with no guard.
  • Escaping read-only mode. Through either path, ATTACH DATABASE opens a file read-write regardless of the main connection's mode=ro. Attaching the protected database itself made it writable. Attaching another path read that file, or created it if it did not exist.

Read-write mode is not affected beyond its intended capabilities, apart from ATTACH reaching files other than the configured database.

Impact

  • Modify the database that read-only mode is meant to protect.
  • Read any SQLite database file the server process can read.
  • Create new SQLite-format files anywhere the server process can write, or write to existing SQLite or empty files. Existing non-empty files that are not SQLite databases are refused and left unchanged.

The server has no built-in authentication and, by default, listens on :8080 on all interfaces. Unless it is deployed behind an authenticating proxy, anyone who can reach that port can exploit this.

Patches

Fixed in v0.1.2:

  • ATTACH is disabled in the engine (SQLITE_LIMIT_ATTACHED set to 0) on every connection that runs a statement.
  • Read-only connections set query_only.
  • execute_query rejects input that contains more than one statement.
  • describe_table passes the table name as a bound parameter.

Workarounds

Upgrade to v0.1.2. If you cannot upgrade, don't expose the server to untrusted clients: keep it on a loopback or private interface, or run it behind an authenticating proxy such as ToolHive. Mount only the database you intend to expose, read-only at the filesystem or container level.

Credits

Reported by @bebold6133.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/StacklokLabs/sqlite-mcp"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.1.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-130008"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-863",
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-19T22:25:53Z",
    "nvd_published_at": "2026-11-18T17:17:38Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nIn read-only mode (the default), a client that can call the MCP tools can write to the database the server is meant to expose read-only, read other SQLite files, and create new SQLite files anywhere the server process can write. There are two ways in: statement chaining through `execute_query`, and SQL injection through `describe_table`.\n\n### Details\n\n- **Statement chaining in `execute_query`.** The only check was that the query starts with `SELECT`. The `modernc.org/sqlite` driver runs every `;`-separated statement in one call, so anything after `SELECT 1;` ran unchecked.\n- **SQL injection in `describe_table`.** The `table_name` argument was interpolated into `PRAGMA table_info(%s)` with no guard.\n- **Escaping read-only mode.** Through either path, `ATTACH DATABASE` opens a file read-write regardless of the main connection\u0027s `mode=ro`. Attaching the protected database itself made it writable. Attaching another path read that file, or created it if it did not exist.\n\nRead-write mode is not affected beyond its intended capabilities, apart from `ATTACH` reaching files other than the configured database.\n\n### Impact\n\n- Modify the database that read-only mode is meant to protect.\n- Read any SQLite database file the server process can read.\n- Create new SQLite-format files anywhere the server process can write, or write to existing SQLite or empty files. Existing non-empty files that are not SQLite databases are refused and left unchanged.\n\nThe server has no built-in authentication and, by default, listens on `:8080` on all interfaces. Unless it is deployed behind an authenticating proxy, anyone who can reach that port can exploit this.\n\n### Patches\n\nFixed in **v0.1.2**:\n\n- `ATTACH` is disabled in the engine (`SQLITE_LIMIT_ATTACHED` set to 0) on every connection that runs a statement.\n- Read-only connections set `query_only`.\n- `execute_query` rejects input that contains more than one statement.\n- `describe_table` passes the table name as a bound parameter.\n\n### Workarounds\n\nUpgrade to v0.1.2. If you cannot upgrade, don\u0027t expose the server to untrusted clients: keep it on a loopback or private interface, or run it behind an authenticating proxy such as ToolHive. Mount only the database you intend to expose, read-only at the filesystem or container level.\n\n### Credits\n\nReported by @bebold6133.",
  "id": "GHSA-q433-mp6c-8v4f",
  "modified": "2026-11-19T22:25:53Z",
  "published": "2026-11-19T22:25:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/StacklokLabs/sqlite-mcp/security/advisories/GHSA-q433-mp6c-8v4f"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-130008"
    },
    {
      "type": "WEB",
      "url": "https://github.com/StacklokLabs/sqlite-mcp/pull/112"
    },
    {
      "type": "WEB",
      "url": "https://github.com/StacklokLabs/sqlite-mcp/commit/1da5a6582a4f9d90c778db5687ddcd0c39d2c1ec"
    },
    {
      "type": "WEB",
      "url": "https://github.com/StacklokLabs/sqlite-mcp/commit/3c244d61cc0a9c0cc5e4d74719c1dc83edcfa339"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/StacklokLabs/sqlite-mcp"
    },
    {
      "type": "WEB",
      "url": "https://github.com/StacklokLabs/sqlite-mcp/releases/tag/v0.1.2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "sqlite-mcp: Read-only mode bypass via statement chaining and SQL injection in describe_table"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…