analyzeUpdateStatement analyzes UPDATE statements
(stmt *ast.UpdateStatement)
| 205 | |
| 206 | // analyzeUpdateStatement analyzes UPDATE statements |
| 207 | func (a *SQLAnalyzer) analyzeUpdateStatement(stmt *ast.UpdateStatement) { |
| 208 | // Check for UPDATE without WHERE clause |
| 209 | if stmt.Where == nil { |
| 210 | a.addSecurityIssue("UPDATE_WITHOUT_WHERE", "CRITICAL", |
| 211 | "UPDATE without WHERE clause will modify all rows in table", |
| 212 | "Always include WHERE clause in UPDATE statements") |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // analyzeDeleteStatement analyzes DELETE statements |
| 217 | func (a *SQLAnalyzer) analyzeDeleteStatement(stmt *ast.DeleteStatement) { |