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

Function TestScan_DangerousFunction_LoadFile

pkg/sql/security/scanner_test.go:208–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

206}
207
208func TestScan_DangerousFunction_LoadFile(t *testing.T) {
209 scanner := NewScanner()
210
211 // Create AST with LOAD_FILE function call
212 selectStmt := &ast.SelectStatement{
213 Columns: []ast.Expression{
214 &ast.FunctionCall{
215 Name: "LOAD_FILE",
216 Arguments: []ast.Expression{&ast.LiteralValue{Value: "/etc/passwd", Type: "STRING"}},
217 },
218 },
219 }
220
221 tree := &ast.AST{Statements: []ast.Statement{selectStmt}}
222 result := scanner.Scan(tree)
223
224 if result.CriticalCount == 0 {
225 t.Error("expected at least one critical finding for LOAD_FILE function")
226 }
227}
228
229func TestScan_UnionWithNulls(t *testing.T) {
230 scanner := NewScanner()

Callers

nothing calls this directly

Calls 3

ScanMethod · 0.95
NewScannerFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected