Best for
- Code touches SQL queries, command execution, or file path operations
- Code handles user input, authentication, authorization, or session management
- Code involves HTTP handlers, TLS configuration, or cryptographic operations
johnqtcg/awesome-skills/skills/go-security-review/SKILL.md
Review Go code for security vulnerabilities including OWASP Top 10, injection, auth/authz, crypto, secrets, SSRF, XSS, and input validation. Trigger when code involves SQL, user input, authentication, HTTP handlers, TLS, crypto, secrets, or file path operations. Use for security-focused code review of Go projects.
Decision brief
Review Go code for security vulnerabilities including OWASP Top 10, injection, auth/authz, crypto, secrets, SSRF, XSS, and input validation. Trigger when code involves SQL, user input, authentication, HTTP handlers, TLS, crypto, secrets, or file path operations.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-security-review"Inspect the Agent Skill "go-security-review" from https://github.com/johnqtcg/awesome-skills/blob/d933bc88237f7a18a7ecf01e5d97a745b083df0f/skills/go-security-review/SKILL.md at commit d933bc88237f7a18a7ecf01e5d97a745b083df0f. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Define scope — confirm files/diff under review. Apply Generated Code Exclusion Gate. 2. Gather evidence — read changed files, identify security-relevant patterns: SQL strings, os/exec, filepath, HTTP handlers, TLS config, crypto, hardcoded literals, auth middleware, URL fetch…
Reason: MD5 at cache.go:15 is used for cache key derivation from internal struct, not password hashing. Anti-example: "over-cautious crypto on non-password use"
Security only — never comment on performance, concurrency, style, tests, error handling, or logic
Identify exploitable security vulnerabilities in Go code. Scope is strictly security: injection, authentication/authorization, cryptography, secrets management, input validation, transport security, and HTTP hardening.
Code touches SQL queries, command execution, or file path operations
Permission review
The documentation asks the agent to run terminal commands or scripts.
Never claim `gosec` or any security tool ran unless it actually produced output. If not run: state reason + exact command.Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 94/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 30 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Identify exploitable security vulnerabilities in Go code. Scope is strictly security: injection, authentication/authorization, cryptography, secrets management, input validation, transport security, and HTTP hardening.
This skill does NOT cover: performance, concurrency (race conditions), code quality/style, test quality, error handling patterns, or business logic correctness — those belong to sibling vertical skills.
go-performance-reviewgo-concurrency-reviewgo-error-reviewgo-quality-reviewgo-test-reviewgo-logic-reviewNever claim gosec or any security tool ran unless it actually produced output. If not run: state reason + exact command.
Read go.mod for the go directive. Do NOT recommend version-specific features above project version. If inaccessible, record Go version: unknown.
Before reporting, verify finding is not a false positive. MUST quote specific code evidence satisfying the precondition. Category match alone is insufficient.
Embedded anti-examples for security domain:
fmt.Sprintf in SQL when the interpolated value is a compile-time constant, config value, or internal enum. Trace data flow from input source to dangerous function — confirm user input actually reaches it.Exclude: *.pb.go, *_gen.go, mock_*.go, wire_gen.go, *_string.go, files with // Code generated .* DO NOT EDIT. Note excluded files in Execution Status.
os/exec, filepath, HTTP handlers, TLS config, crypto, hardcoded literals, auth middleware, URL fetching, template rendering.go-security-patterns.md; load go-api-http-checklist.md when HTTP/API code present.This skill uses mechanical grep pre-scanning to guarantee zero missed checklist items. 14 of 16 items are grep-gated; 2 are semantic-only.
$TMPDIR/review_snippet.go)Include in Execution Status: Grep pre-scan: X/14 items hit, Z confirmed as findings (2 semantic-only)
filepath\.Join\|os\.Open HIT → trace whether input comes from user requestlog\.\|slog\. HIT → check if logged value includes password/token/PIIhttp\.Get\|client\.Do HIT → trace whether URL comes from user inputsubtle.ConstantTimeCompare NOT foundAtoi\|ParseInt HIT → check if result used for allocation/slice sizing without bounds checkAll High severity unless marked (Medium).
| # | Item | Code Pattern Triggers | Grep Pattern |
|---|---|---|---|
| 1 | SQL injection | fmt.Sprintf + SQL keywords, string concat in db.Query/db.Exec, gorm.Raw() | Sprintf.*SELECT|Sprintf.*INSERT|Sprintf.*UPDATE|Sprintf.*DELETE|db\.Query|db\.Exec|gorm\.Raw |
| 2 | Command injection | os/exec with variables from request/config, sh -c with interpolation | os/exec|exec\.Command |
| 3 | Path traversal | filepath.Join with unsanitized request input, no filepath.Rel base-dir check | filepath\.Join|os\.Open|os\.ReadFile (compound: AND user input flows in — semantic required) |
| 4 | Insecure TLS | InsecureSkipVerify: true, MinVersion below TLS 1.2 | InsecureSkipVerify|MinVersion|tls\.Config |
| 5 | Weak crypto | md5.Sum/sha1.Sum for passwords or auth tokens, RSA < 2048, math/rand for secrets | md5\.Sum|sha1\.Sum|math/rand |
| 6 | Hardcoded secrets | String literals matching sk-, ghp_, AKIA, password=, -----BEGIN | sk-|ghp_|AKIA|password\s*=\s*"|BEGIN.*PRIVATE |
| 7 | unsafe package | import "unsafe" without documented justification comment | "unsafe" |
| 8 | Sensitive data in logs | Passwords, tokens, PII in log.*, slog.*, fmt.Errorf, full request body logged | log\.|slog\.|Errorf|Fprintf (compound: AND sensitive data keyword in same statement — semantic required) |
| 9 | AuthN/AuthZ flaws | JWT without algorithm pinning, IDOR (no ownership check), auth middleware after handler | Semantic-Only (auth/authz patterns require understanding middleware flow) |
| 10 | SSRF | http.Get/client.Do with user-controlled URL, no host allowlist or private-IP blocking | http\.Get|http\.Post|client\.Do|http\.NewRequest (compound: AND user-controlled URL — semantic required) |
| 11 | XSS | text/template for HTML, template.HTML() on user input, fmt.Fprintf to ResponseWriter with HTML | text/template|template\.HTML|Fprintf.*ResponseWriter |
| 12 | Rate limiting missing (Medium) | Auth/login/password-reset endpoints without rate limit middleware | Semantic-Only (rate limiting detection requires understanding endpoint exposure) |
| 13 | CORS misconfiguration | Reflected Origin header, Access-Control-Allow-Origin: * with credentials | Access-Control|AllowOrigin|CORS|Origin |
| 14 | HTTP security headers missing (Medium) | No X-Content-Type-Options, X-Frame-Options, HSTS, CSP | X-Content-Type|X-Frame|Strict-Transport|Content-Security-Policy |
| 15 | Timing attack | == on secrets/tokens instead of crypto/subtle.ConstantTimeCompare | ==.*secret|==.*token|==.*key|==.*password (compound: AND NOT subtle\.ConstantTimeCompare) |
| 16 | Input validation missing | No http.MaxBytesReader on body, unchecked strconv.Atoi used for allocation size | MaxBytesReader|LimitReader|Atoi|ParseInt|ParseUint |
High — Exploitable vulnerability: injection, auth bypass, data exposure, SSRF, hardcoded secrets, insecure TLS.
Medium — Requires specific conditions or defense-in-depth gap: missing headers, rate limiting, weak config defaults.
path:line), concrete impact, actionable fix with code exampler.URL.Query().Get("q") at handler.go:23) and the sink (e.g., fmt.Sprintf at repo.go:67)path:line (or location list)must-fix | follow-upGo version: X.Y or unknowngosec: PASS | FAIL | Not available (reason + command)Grep pre-scan: X/14 items hit, Z confirmed as findings (2 semantic-only)Excluded (generated): list or NoneReferences loaded: list1-2 lines. Count by severity.
### Findings
#### [High] SQL Injection in User Search
- **ID:** SEC-001
- **Location:** `internal/repo/user.go:67`
- **Impact:** Attacker can execute arbitrary SQL via search parameter
- **Evidence:** `fmt.Sprintf("SELECT * FROM users WHERE name LIKE '%%%s%%'", name)` — `name` flows from `r.URL.Query().Get("q")` at handler.go:23 through SearchUsers() without sanitization
- **Recommendation:** Use parameterized query: `db.QueryContext(ctx, "SELECT * FROM users WHERE name LIKE ?", "%"+name+"%")`
- **Action:** must-fix
### Suppressed Items
#### [Suppressed] MD5 Usage in Cache Key Generation
- **Reason:** MD5 at cache.go:15 is used for cache key derivation from internal struct, not password hashing. Anti-example: "over-cautious crypto on non-password use"
- **Residual risk:** None — cache key collision is acceptable
### Execution Status
- Go version: 1.21
- gosec: Not available (command: `gosec ./...`)
- Grep pre-scan: 3/14 items hit, 1 confirmed as findings (2 semantic-only)
- Excluded (generated): None
- References loaded: go-security-patterns.md, go-api-http-checklist.md
### Summary
1 High finding (SQL injection). No Medium findings.
If no issues found: state No security findings identified. Still output Execution Status, Suppressed Items (if any), Summary.
| Reference | Load When |
|---|---|
references/go-security-patterns.md | Always |
references/go-api-http-checklist.md | Code involves net/http, handlers, gin/echo/chi, gRPC, middleware |
references/go-review-anti-examples.md | Always |
Frequently asked questions
Review Go code for security vulnerabilities including OWASP Top 10, injection, auth/authz, crypto, secrets, SSRF, XSS, and input validation. Trigger when code involves SQL, user input, authentication, HTTP handlers, TLS, crypto, secrets, or file path operations.
The source record exposes this install command: npx skills add https://github.com/johnqtcg/awesome-skills --skill "skills/go-security-review". Inspect the command and pinned source before running it.
Static rules flagged exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
seb1n/awesome-ai-agent-skills
Perform thorough code reviews on files or pull requests, checking for bugs, security vulnerabilities, performance issues, and style violations. Use when the user requests code review or provides relevant inputs for this workflow.
aAAaqwq/AGI-Super-Team
AI code review for PR or local changes
simota/agent-skills
Analyzing code statically for security flaws: hardcoded secrets, SQL injection, input validation, security headers, dependency CVEs. Not for runtime exploit checks (Probe) or code review (Judge).
dancingteeth/unified-code-review
Risk-first code review for PRs and branch audits: blast-radius triage, agent-authored discipline (tests first, intent evidence), call-graph pincer for integration defects between modules, then structural code-judo bar. Use when reviewing PRs, auditing agent-written diffs, catching rubber-stamp green CI, or wiring bugs single-file review misses. Prefer over structure-only thermo-nuclear review alone. Do not use for unrelated coding tasks or as an always-on rule.