MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / scanSelectStatement

Method scanSelectStatement

pkg/sql/security/scanner.go:665–680  ·  view source on GitHub ↗

scanSelectStatement analyzes SELECT for injection patterns.

(stmt *ast.SelectStatement, result *ScanResult)

Source from the content-addressed store, hash-verified

663
664// scanSelectStatement analyzes SELECT for injection patterns.
665func (s *Scanner) scanSelectStatement(stmt *ast.SelectStatement, result *ScanResult) {
666 // Check WHERE clause for tautologies
667 if stmt.Where != nil {
668 s.scanExpression(stmt.Where, result, "WHERE clause")
669 }
670
671 // Check HAVING clause
672 if stmt.Having != nil {
673 s.scanExpression(stmt.Having, result, "HAVING clause")
674 }
675
676 // Check for suspicious function calls in columns
677 for _, col := range stmt.Columns {
678 s.scanExpressionForDangerousFunctions(col, result)
679 }
680}
681
682// scanInsertStatement analyzes INSERT for injection patterns.
683func (s *Scanner) scanInsertStatement(stmt *ast.InsertStatement, result *ScanResult) {

Callers 1

scanStatementMethod · 0.95

Calls 2

scanExpressionMethod · 0.95

Tested by

no test coverage detected