You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Severity: π’ LOW Component:sql_engine.py β INJECTION_PATTERNS Audit ID: LOW-03 Re-audit of v0.2.1: Finding is NEW
Description
The injection pattern set includes:
r"--[^\n]*",
This flags every SQL line comment as a potential injection β including idiomatic, documented queries:
SELECT id, email FROM users -- only fetch non-PII columnsWHERE active =1
verify_sql_query returns verified=False for this query. Any developer schema that ships with inline comments (standard practice in migration files and ORM-generated SQL) is blocked wholesale.
False positives at the verification boundary are not harmless: repeated blocking of legitimate code trains consumers to distrust or bypass the guard β the same erosion dynamic documented in #13 for open().
Why This Violates QWED Philosophy
Principle 3 β Deterministic Decisions: A comment is not deterministic evidence of injection. The pattern encodes a heuristic ("comments are suspicious") that produces both noise and, conversely, no protection against actual comment-based bypasses in this architecture (the query never executes here β the engine only judges patterns).
Retain genuinely dangerous comment-adjacent patterns only where they combine with injection structure (e.g., ' ; -- statement termination followed by comment is already covered by '\s*;\s*--).
Regression test: a commented legitimate query passes; ' OR '1'='1' -- still fails.
QWED-MCP Audit Finding: LOW-03
Severity: π’ LOW
Component:
sql_engine.pyβINJECTION_PATTERNSAudit ID: LOW-03
Re-audit of v0.2.1: Finding is NEW
Description
The injection pattern set includes:
r"--[^\n]*",This flags every SQL line comment as a potential injection β including idiomatic, documented queries:
verify_sql_queryreturnsverified=Falsefor this query. Any developer schema that ships with inline comments (standard practice in migration files and ORM-generated SQL) is blocked wholesale.False positives at the verification boundary are not harmless: repeated blocking of legitimate code trains consumers to distrust or bypass the guard β the same erosion dynamic documented in #13 for
open().Why This Violates QWED Philosophy
open()causing false positives on legitimate QWED SDK usageΒ #13's lesson: guards that block safe code while missing dangerous alternatives are worse than no guard.Expected Behavior
--[^\n]*pattern.' ; --statement termination followed by comment is already covered by'\s*;\s*--).' OR '1'='1' --still fails.Environment
0.2.1src/qwed_mcp/engines/sql_engine.py(L29β38)