AAK-ASTROMCP-SQLI-CVE-2026-7591-001: astro-mcp-server SQL injection (CVE-2026-7591, npm 1.1.1 or earlier)
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/supply_chain.py- Auto-fixable
- No.
- SARIF name
AstroMcpSqlInjection
What it detects
TimBroddin/astro-mcp-server <=1.1.1 builds SQL queries from request.params.arguments via string concatenation in src/index.ts (the MCP-tool query-construction path). CVE-2026-7591 (NVD 2026-05-01, CWE-89): no upstream patch released as of the AAK ship date — the latest npm publish (1.1.1) is the same version flagged as the vulnerable ceiling. Two detector arms: a pin-check on package.json / package-lock / yarn.lock / pnpm-lock fires whenever the package is present (because every published version is vulnerable), and a TS / JS source detector fires when files importing the package build queries via string concatenation or untagged template literals. Tagged-template SQL helpers (sql\...``, drizzle, prisma, postgres-js) escape interpolations safely and are intentionally not matched.
How to fix
Pin away from astro-mcp-server until a fixed release is published (track upstream at https://github.com/TimBroddin/astro-mcp-server). For the source shape, switch to a parameterized-query API (e.g., db.query(sql, [param]), cursor.execute(sql, params)) or wrap interpolations in a tagged-template SQL helper such as drizzle-orm, postgres-js, or sql-template-tag — those escape values safely and AAK ignores them.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-ASTROMCP-SQLI-CVE-2026-7591-001
Limitations
Two arms. The pin reads astro-mcp-server in the root package.json, yarn.lock and pnpm-lock.yaml, and in package-lock.json only as a listed dependency ("astro-mcp-server": "1.1.1"), and reports every version because no fix exists. A node_modules/astro-mcp-server entry that only a transitive dependency adds to package-lock.json, a Yarn 2+ yarn.lock, a sub-directory package.json and an npx launcher in .mcp.json are not read. The source arm needs the SQL string concatenated or interpolated inside the call on db, client, conn, connection, pool, cursor, database, sqlite or knex, so a query built in a variable first (const sql = "SELECT ..." + id; db.query(sql)) is not reported. A file over 2 MB, or a lockfile over 32 MiB, is not read.
References
- CVE: CVE-2026-7591
- OWASP MCP Top 10: MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering), MCP05:2025 (Command Injection & Execution)
- OWASP Agentic Top 10: ASI02 (Tool Misuse and Exploitation), ASI04 (Agentic Supply Chain Vulnerabilities)
- Incidents and advisories: NVD-CVE-2026-7591, VULDB-360544
- CSA AI Controls Matrix (AICM): AIS-07, DSP-04, IVS-09
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-ASTROMCP-SQLI-CVE-2026-7591-001.md: the page then shows that text, with the registry reference appended under it.