golang-security

Audit Go code for security vulnerabilities using threat modeling and govulncheck.

4|Updated May 17, 2026
One-click install
npx skills add https://github.com/hellopoisonx/aim --skill golang-security-hellopoisonx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-security
Source: https://github.com/hellopoisonx/aim/tree/main/skills/golang-security
Command: npx skills add https://github.com/hellopoisonx/aim --skill golang-security-hellopoisonx

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents common and high-impact security flaws in Go applications by providing practical, defense-in-depth guidance for validating inputs, using safe cryptography, securing filesystem and network access, handling cookies/secrets correctly, and writing secure logs.

Core Features & Use Cases

  • Go security audit workflow: Review or audit Go code using a trust-boundary-first approach, STRIDE threat modeling, and DREAD-based severity prioritization.
  • Vulnerability prevention patterns: Covers injection risks (SQL/command/XSS/SSRF), cryptographic misuse (AES-GCM/nonce safety, TLS rules), filesystem safety (os.Root, ZipSlip, zip bomb limits), and safer error/log handling.
  • Operational verification guidance: Recommends concrete tooling and test strategies such as govulncheck, security linters, and go test -race.

Quick Start

Use the golang-security skill to audit a Go change set for injection, auth flaws, unsafe crypto, path traversal, insecure cookies, secrets handling, and sensitive logging by following its review checklist.

Frequently Asked Questions about golang-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection and command injection in Go applications?

To prevent SQL injection and command injection in Go, use parameterized SQL queries and execute commands via exec.Command without shell interpolation. This skill provides concrete defense-in-depth patterns for validating inputs and securing I/O operations against malicious code execution.

How do I perform a security audit on a Go codebase?

Performing a Go security audit involves using a trust-boundary-first approach with STRIDE threat modeling and DREAD-based severity prioritization. This skill guides you through reviewing injection risks, unsafe cryptography, path traversal, and insecure cookies to identify high-impact flaws.

What is the best way to secure file path access and prevent ZipSlip in Go?

The best way to secure file paths and prevent ZipSlip in Go is by enforcing safe path confinement using os.Root and implementing zip bomb limits. This skill provides specific filesystem safety patterns to restrict directory traversal and handle untrusted archives securely.

Can I use govulncheck to scan dependencies during a Go security review?

Yes, you can use govulncheck for verified dependency scanning during a Go security review. This skill recommends operational verification guidance including govulncheck, security linters, and go test -race to detect vulnerable packages and concurrency issues before production deployment.

How does html/template auto-escaping prevent XSS vulnerabilities in Go?

Html/template auto-escaping prevents XSS vulnerabilities in Go by contextually sanitizing dynamic data before rendering HTML output. This skill outlines vulnerability prevention patterns for injection risks including XSS, ensuring external user input is safely handled across templates.

What cryptography rules should I follow to avoid nonce safety issues with AES-GCM in Go?

To avoid nonce safety issues with AES-GCM in Go, enforce strict cryptographic rules ensuring nonces are never reused with the same key and TLS configurations meet modern security standards. This skill provides safe cryptography usage patterns to prevent high-impact security flaws.