isSystemTable checks if a table name refers to a system table using precise matching. Uses prefix matching and exact name matching to avoid false positives.
(tableName string)
| 896 | // isSystemTable checks if a table name refers to a system table using precise matching. |
| 897 | // Uses prefix matching and exact name matching to avoid false positives. |
| 898 | func (s *Scanner) isSystemTable(tableName string) bool { |
| 899 | tableLower := strings.ToLower(tableName) |
| 900 | |
| 901 | // Check exact matches first |
| 902 | for _, name := range systemTableNames { |
| 903 | if tableLower == name { |
| 904 | return true |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | // Check prefix matches (e.g., "information_schema.tables", "pg_class") |
| 909 | for _, prefix := range systemTablePrefixes { |
| 910 | if strings.HasPrefix(tableLower, prefix) { |
| 911 | return true |
| 912 | } |
| 913 | } |
| 914 | |
| 915 | return false |
| 916 | } |
| 917 | |
| 918 | // scanFunctionCall checks for dangerous function usage. |
| 919 | func (s *Scanner) scanFunctionCall(fn *ast.FunctionCall, result *ScanResult) { |
no outgoing calls