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

Method scanSetOperation

pkg/sql/security/scanner.go:714–729  ·  view source on GitHub ↗

scanSetOperation analyzes UNION/EXCEPT/INTERSECT for injection patterns.

(stmt *ast.SetOperation, result *ScanResult)

Source from the content-addressed store, hash-verified

712
713// scanSetOperation analyzes UNION/EXCEPT/INTERSECT for injection patterns.
714func (s *Scanner) scanSetOperation(stmt *ast.SetOperation, result *ScanResult) {
715 // UNION-based injection detection
716 if strings.ToUpper(stmt.Operator) == "UNION" {
717 // Check if UNION might be used for data extraction
718 s.checkUnionInjection(stmt, result)
719 }
720
721 // Recursively scan left and right statements
722 // Note: SetOperation.Left and .Right are already ast.Statement type
723 if stmt.Left != nil {
724 s.scanStatement(stmt.Left, result)
725 }
726 if stmt.Right != nil {
727 s.scanStatement(stmt.Right, result)
728 }
729}
730
731// scanExpression analyzes an expression for injection patterns.
732func (s *Scanner) scanExpression(expr ast.Expression, result *ScanResult, context string) {

Callers 1

scanStatementMethod · 0.95

Calls 2

checkUnionInjectionMethod · 0.95
scanStatementMethod · 0.95

Tested by

no test coverage detected