docs(skills): add MCP/DB read-only guard bypass skill#846
docs(skills): add MCP/DB read-only guard bypass skill#846gulmezeren2-byte wants to merge 1 commit into
Conversation
Greptile SummaryThis PR adds a skill for testing read-only SQL guard bypasses. The main changes are:
Confidence Score: 4/5The payload-to-guard classification needs correction before merging.
strix/skills/vulnerabilities/mcp_sql_guard_bypass.md
|
| Filename | Overview |
|---|---|
| strix/skills/vulnerabilities/mcp_sql_guard_bypass.md | Adds a correctly discoverable vulnerability skill, but its payload framing conflates SELECT-prefix, blocklist, and transaction-escape bypasses. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
strix/skills/vulnerabilities/mcp_sql_guard_bypass.md:19
**Payloads Target Different Guards**
This says every example passes a shape check, but `COPY`, `EXEC`, `ATTACH`, and the stacked `COMMIT; DROP` payload do not pass the described `startswith("SELECT")` guard. An agent testing that guard can draw the wrong conclusion from rejected payloads and miss a real SELECT-shaped bypass; separate the techniques by the exact guard they bypass.
Reviews (1): Last reviewed commit: "docs(skills): add MCP/DB read-only guard..." | Re-trigger Greptile
|
|
||
| ## Techniques (well-formed reads that are not reads) | ||
|
|
||
| Reframe by engine — each is a single `SELECT`/statement a shape check passes: |
There was a problem hiding this comment.
Payloads Target Different Guards
This says every example passes a shape check, but COPY, EXEC, ATTACH, and the stacked COMMIT; DROP payload do not pass the described startswith("SELECT") guard. An agent testing that guard can draw the wrong conclusion from rejected payloads and miss a real SELECT-shaped bypass; separate the techniques by the exact guard they bypass.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/skills/vulnerabilities/mcp_sql_guard_bypass.md
Line: 19
Comment:
**Payloads Target Different Guards**
This says every example passes a shape check, but `COPY`, `EXEC`, `ATTACH`, and the stacked `COMMIT; DROP` payload do not pass the described `startswith("SELECT")` guard. An agent testing that guard can draw the wrong conclusion from rejected payloads and miss a real SELECT-shaped bypass; separate the techniques by the exact guard they bypass.
How can I resolve this? If you propose a fix, please make it concise.
Adds
strix/skills/vulnerabilities/mcp_sql_guard_bypass.md.Closes #845.
A distinct class from
sql_injection.md: apps that intend to run caller-suppliedSELECTs — database MCP servers (querytools), text-to-SQL, admin/BI consoles — but enforce "read-only" with a shape-based check (startswith-SELECT, keyword blocklist, or an escapable read-only transaction). Well-formedSELECTs still read files (pg_read_file), open sockets (dblink), run shell (xp_cmdshell), or escape the transaction (COMMIT; DROP …). This is the class behind the archived reference PostgreSQL MCP server and the Supabase "lethal trifecta," and it's increasingly relevant as agents get DB-access tools.The skill mirrors the existing vulnerability-skill shape: attack surface → techniques by engine (Postgres/MSSQL/MySQL/SQLite) → confirmation methods (OOB, file-read echo, time-based, second-order) → false-positive avoidance (how to tell a bypassable shape check from a hardened function-level guard, so the agent reports real findings, not passes). Single markdown file, no code changes.