What CodeSlick Checks in Go
CodeSlick analyzes Go code with 26 security checks purpose-built for cloud-native applications. Go's concurrency model and standard library introduce distinct vulnerability classes — race conditions in goroutines, unsafe use of os/exec, and cryptographic pitfalls from the math/rand vs crypto/rand confusion. All findings include CWE classification and CVSS scoring.
Check your Go code for race conditions, command injection, and weak cryptography in under 3 seconds.
26 Security Checks for Go
Injection
- Command injection:
exec.Command()with user-controlled arguments — critical in Go microservices that invoke system tools - SQL injection: String formatting in
db.Query(),db.Exec() - Path traversal:
os.Open(),os.ReadFile()with unsanitized user-supplied paths - SSRF:
http.Get()with user-controlled URLs without allowlist validation
Concurrency
- Data races: Shared mutable state accessed from multiple goroutines without synchronization (maps, slices, struct fields)
- Channel misuse: Unbuffered channel sends in goroutines that can deadlock under load
Cryptography
- Weak random:
math/randused for tokens, session IDs, or keys (must usecrypto/rand) - Weak hash:
crypto/md5orcrypto/sha1for security-sensitive operations - Hardcoded secrets: API keys, tokens, and private keys embedded in Go source
- TLS skip verify:
InsecureSkipVerify: trueintls.Config— disables certificate validation
Cloud-Native Patterns
- Environment variable exposure: Logging
os.Getenv()results that may contain secrets - HTTP timeouts:
http.Clientwithout timeout — vulnerable to slow-loris and resource exhaustion - Goroutine leaks: Background goroutines started without context cancellation
Cloud-Native and Kubernetes Coverage
CodeSlick's Go analyzer was designed for cloud-native code: microservices, Kubernetes controllers, and API servers. It understands patterns specific to this context:
- net/http server hardening: Missing timeouts on
http.Serverthat expose services to slowloris attacks - gRPC patterns: Unvalidated proto fields passed to downstream operations
- AWS SDK usage: IAM permission grants and S3 bucket operations with user-controlled parameters
CodeSlick covers 47 AI code detection patterns for Go — the largest of any language — because Go's strict type system creates distinctive hallucination patterns in LLM-generated code.
AI Code Detection in Go
CodeSlick includes 47 Go-specific AI code detection patterns — more than any other supported language. Go's strict type system and idiomatic patterns create distinctive hallucinations in LLM-generated code:
- Interface implementation errors: LLMs frequently generate incorrect interface implementations that compile but panic at runtime
- Error handling idioms: AI-generated Go often uses non-idiomatic error wrapping or swallows errors in ways that violate Go conventions
- Channel and goroutine patterns: Incorrect goroutine lifecycle management characteristic of LLM generation
- Value vs pointer receiver confusion: Common LLM mistake that causes subtle bugs with mutability
How to Use the Free Go Checker
No account required:
- Visit codeslick.dev/analyze
- Select Go from the language selector
- Paste your Go code or upload a
.gofile - Click Analyze
- Review findings with CWE classification and CVSS severity
For full module analysis including go.sum dependency scanning and pre-commit hooks, use the CodeSlick CLI.