golang-security

Audit Go code for exploitable vulnerabilities across trust boundaries and sensitive subsystems.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go, govulncheck, and includes references (resource) components.

What problem does it solve?

This Skill helps you avoid common security vulnerabilities in Go by guiding secure patterns for input handling, cryptography, filesystem access, networking, cookies, secrets management, memory/concurrency safety, and secure logging.

Core Features & Use Cases

  • Injection prevention: Use safe practices for SQL, command execution, templates (XSS), and SSRF so untrusted inputs can’t alter code paths.
  • Crypto and secrets hardening: Apply vetted algorithms, secure randomness, safe nonce handling, and correct key/password and session/token practices.
  • Filesystem and network safety: Confine file operations to allowed roots, prevent ZipSlip/decompression bombs, and harden HTTP/TLS behavior while keeping debug endpoints private.
  • Operational guardrails: Add security headers, enforce request limits/timeouts/rate limiting, and verify dependencies with tools like govulncheck.

Quick Start

Use the golang-security skill while reviewing or writing your Go code to systematically check trust boundaries, validate inputs, and apply defense-in-depth for authentication, authorization, and risky I/O.

Frequently Asked Questions about golang-security

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

FAQPage Schema
How do I prevent SSRF and SQL injection vulnerabilities in my Golang web application?

To prevent injection vulnerabilities in Golang, use safe practices for SQL queries, command execution, and templates so untrusted inputs cannot alter code paths or trigger server-side request forgery.

What is the best way to harden cryptography and manage secrets in Go?

The best way to harden Go cryptography is to apply vetted algorithms, secure randomness, safe nonce handling, and correct key/password practices to prevent exploitable flaws across trust boundaries.

How do I secure filesystem access to prevent ZipSlip and decompression bombs in Go?

Secure Go filesystem access by confining file operations to allowed roots and validating archive contents to prevent ZipSlip and decompression bombs during file handling.

Does this approach work with govulncheck for dependency vulnerability scanning?

Yes, this approach integrates with govulncheck to verify dependencies, add security headers, enforce request limits, and harden HTTP/TLS behavior while keeping debug endpoints private.

When do I need to enforce constant-time comparisons and non-leaky error handling in Go?

You need constant-time comparisons and non-leaky error handling in Go whenever processing authentication flows, secrets, or tokens to prevent timing attacks and sensitive data exposure.

Can I use this secure coding method for PR reviews and full codebase audits?

Yes, you can use this secure coding method during PR review, full codebase audits, or new feature implementation that touches crypto, networking, cookies, or authentication flows.