Skip to content

Security Analysis

MCP-Go-MSSQL has been designed following recognized security standards and applies defense in depth across all layers.

VectorMitigation
SQL InjectionExclusive prepared statements, no dynamic concatenation
Unauthorized accessRead-only mode + table whitelist
Data interceptionMandatory TLS on all connections
Resource exhaustionConnection pooling with configurable limits
Information leakageGeneric errors to client, details only in internal logs
Privilege escalationMulti-table validation on JOINs and subqueries
  • OWASP Top 10 (2021): A01-Broken Access Control, A03-Injection, A02-Cryptographic Failures
  • CWE Top 25 (2024): CWE-89 (SQL Injection), CWE-306 (Missing Auth), CWE-798 (Hardcoded Credentials)
  • NIST Cybersecurity Framework: Identify, Protect, Detect, Respond
  • Mandatory TLS encryption (encrypt=true)
  • Certificate validation in production (trustservercertificate=false)
  • Self-signed certificates only allowed in development mode
  • Automatic sanitization of sensitive data in logs
  • Query size limit (1 MB)
  • Empty input rejection
  • System command blocking (xp_cmdshell, OPENROWSET, etc.)
  • Prepared statements for all queries without exception
  • Validation of all tables referenced in modifications
  • Connection pooling with active connection limits
  • Configurable timeouts to prevent hanging connections
  1. Run with MSSQL_READ_ONLY=true in production
  2. Set MSSQL_WHITELIST_TABLES only for AI temporary tables
  3. Use a database user with minimal permissions
  4. Monitor security logs periodically
  5. Rotate credentials regularly