ScanningSAST by Language

Go SAST

What xgrep detects in Go — injection, SSRF, weak crypto, integer-overflow and memory-safety issues, and error-handling bugs — with taint analysis.

Go SAST

xgrep parses .go into tree-sitter ASTs and ships roughly 60 rules, 16 of them taint-based, focused on the standard library and common patterns (net/http, database/sql, crypto/tls, os/exec).

xgrep scan --include '*.go' .

What xgrep detects

Injectionsql-injection, command-injection, email-injection, format-string-injection, log-injection, xpath-injection.

Cross-site scriptingxss-response-writer.

SSRF, redirects & URL validationssrf-request, open-redirect, bad-redirect-check, unanchored-url-validation, incomplete-url-scheme-check, incomplete-hostname-regexp.

Path traversal & filespath-traversal, overly-permissive-file.

Deserializationunsafe-deserialization.

Crypto, TLS & SSHinsecure-tls, disabled-cert-validation, weak-cipher, weak-cipher-usage, weak-hash, weak-key-size, weak-random, insecure-host-key, insecure-host-key-callback, cleartext-storage / -transmission.

Auth & comparisonscookie-no-httponly / -secure, csrf-constant-state, jwt-unverified, timing-attack-string-comparison, constant-length-comparison.

Integer & memory safetyinteger-overflow, allocation-size-overflow, uncontrolled-allocation, shift-out-of-range, negative-length-check, mistyped-exponentiation.

Error handling & correctnessmissing-error-check, wrapped-error-always-nil, redundant-recover, unhandled-close-writable-handle, plus dead-store and duplicate-branch checks (run with --category correctness).

Data exposurehardcoded-credentials, sensitive-data-logging, stacktrace-exposure.

Taint analysis

16 rules use taint mode: an HTTP handler's request values must reach a sink (exec.Command, a SQL query, http.Get, an io.Writer response) before the rule fires, so shape-only matches don't become findings.

See also Secrets scanning and the CLI reference.

On this page