go-security-pitfalls

go-security-pitfalls is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 46 tokens per session (1,632 once invoked), scanned A, original, Apache-2.0.

A security review guide for Go web services and programs. It covers common risks in HTTP handlers, database queries, command execution, file paths, templates, cryptography, TLS, SSH, and JSON input.

In plain words
What is it for?
It is for reviewing Go changes involving net/http or Fiber, database/sql or GORM, os/exec, file access, HTML templates, cryptography, TLS, SSH clients, and JSON binding.
Why use it?
It helps catch unsafe use of ordinary Go APIs, such as building SQL or file paths from user input. It focuses on security problems that remain even though Go prevents many memory-safety errors by default.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit It is for reviewing Go changes involving net/http or Fiber, database/sql or GORM, os/exec, file access, HTML templates, cryptography, TLS, SSH clients, and JSON binding.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/go-security-pitfalls
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add makifbaysal/tasktrooper --skill go-security-pitfalls
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for go-security-pitfalls

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/go-security-pitfalls/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/go-security-pitfalls)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/go-security-pitfalls"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/go-security-pitfalls/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for go-security-pitfalls

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/go-security-pitfalls"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/go-security-pitfalls.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,632 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01632
Opus 5.5 $0.00018 $0.00653
Sonnet 5.5 $0.00009 $0.00326
Haiku 4.5 $0.00005 $0.00163

Measured 1mo ago against content hash cf67fd16b6d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

go-security-pitfalls scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

catalog/agents/security-agent/skills/go-security-pitfalls/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Security Pitfalls

Overview

Go removes whole classes of bugs (memory safety, implicit shell, unsafe default deserialization), which makes the remaining ones look innocent: a fmt.Sprintf in a query builder, a HasPrefix path check, a template.HTML conversion. Memory-safety findings in pure Go are excluded; unsafe and cgo are the exception.

1. SQL: database/sql, sqlx, GORM (CWE-89)

// ❌
db.QueryContext(ctx, fmt.Sprintf("SELECT * FROM tasks WHERE owner = '%s'", owner))
// ✅
db.QueryContext(ctx, "SELECT * FROM tasks WHERE owner = $1", owner)

GORM accepts raw SQL in more places than people expect:

// ❌ all of these take SQL text
db.Where(fmt.Sprintf("name = '%s'", name)).Find(&users)
db.Order(r.URL.Query().Get("sort")).Find(&users)   // ORDER BY injection
db.First(&user, r.PathValue("id"))                // a string id is used as an inline condition
db.Raw("SELECT … " + filter).Scan(&rows)
// ✅
db.Where("name = ?", name).Find(&users)
db.Order(clause.OrderByColumn{Column: clause.Column{Name: sortCols[key]}}).Find(&users)
db.First(&user, "id = ?", id)

2. Commands: os/exec (CWE-78, CWE-88)

exec.Command never invokes a shell — unless you pass sh -c. With separate args the risk is argument injection:

// ❌ shell
exec.Command("sh", "-c", "git clone "+repoURL).Run()
// ❌ no shell, but repoURL = "--upload-pack=…" is an option
exec.Command("git", "clone", repoURL, dir).Run()
// ✅
exec.Command("git", "clone", "--", repoURL, dir).Run()

Also check cmd.Env built from request data (NODE_OPTIONS, LD_PRELOAD, GIT_SSH_COMMAND — injection-and-dangerous-sinks).

3. Paths: filepath, os.Root (CWE-22)

// ❌ lexical check: a symlink inside base escapes it, and
//    "/srv/data-other/x" passes HasPrefix(p, "/srv/data")
p := filepath.Join(base, name)
if !strings.HasPrefix(p, base) { … }

// ✅ Go 1.24+: lookups confined to the root, symlinks included
root, err := os.OpenRoot(base)
f, err := root.Open(name)
// ✅ older Go: reject anything non-local before joining
if !filepath.IsLocal(name) { return errBadPath }

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed cf67fd16b6d5
  2. 1mo ago First seen · 125 lines · 46 tokens per session scan A d40cc5a7c484

Subscribe to this mod's changes

go-security-pitfalls is a skill published in the GitHub repository makifbaysal/tasktrooper (123 stars, last pushed today), licensed Apache-2.0. It adds 46 tokens to every session and 1,632 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-09.

Related

go-security-pitfalls compared with skills from other repositories

go-security-pitfalls next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
go-security-pitfallsmakifbaysal/tasktrooperSkill123todayApache-2.0A46Claude Code, Codex
cuequivariance-jaxNVIDIA/skillsSkill4.2k2d agoApache-2.0A38Claude Code, Codex
cuequivariance-torchNVIDIA/skillsSkill4.2k2d agoApache-2.0A37Claude Code, Codex
cudnn-compile-and-serializeNVIDIA/skillsSkill4.2k2d agoApache-2.0A59Claude Code, Codex
cudnn-installNVIDIA/skillsSkill4.2k2d agoApache-2.0A49Claude Code, Codex
ccclNVIDIA/skillsSkill4.2k2d agoApache-2.0A206Claude Code, Codex
holoscan-install-wheelNVIDIA/skillsSkill4.2k2d agoApache-2.0A34Claude Code, Codex