scanSetOperation analyzes UNION/EXCEPT/INTERSECT for injection patterns.
(stmt *ast.SetOperation, result *ScanResult)
| 712 | |
| 713 | // scanSetOperation analyzes UNION/EXCEPT/INTERSECT for injection patterns. |
| 714 | func (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. |
| 732 | func (s *Scanner) scanExpression(expr ast.Expression, result *ScanResult, context string) { |
no test coverage detected