---
slug: go-security-vulnerability
name: go-security-vulnerability
version: "0.1.0"
displayName: Go Security Vulnerab
summary: "使用govulncheck识别评估修复Go模块安全漏洞,处理常见漏洞模式,提升Go代码安全性"
  Handle common...
license: MIT
description: |-
  Identify, assess, and fix security vulnerabilities in Go modules using
  govulncheck。Handle common。Use when 需要安全检测、合规审计、漏洞扫描、加密防护时使用。不适用于渗透测试未授权目标。适用于独立开发者、企业团队和自动化工作流场景。
tags:
- Security
tools:
  - - read
- exec
pricing_tier: "L4"
pricing_model: "monthly"
suggested_price: 99.9
---


# Go Security Vulnerability

Use Go tooling to identify, assess, and fix security vulnerabilities in Go modules. This skill helps detect and remediate vulnerabilities while maintaining application functionality.

## Vulnerability Detection

Scan for vulnerabilities in your Go project:

```bash
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
```

Check specific modules for known vulnerabilities:

```bash
govulncheck -show verbose ./...
```

## Assessment Process

1. **Identify Affected Packages**: Determine which dependencies contain vulnerabilities
2. **Check Severity**: Review the CVE details and potential impact
3. **Verify Usage**: Confirm if the vulnerable functions are actually used in your code
4. **Plan Remediation**: Choose the appropriate fix strategy

## Common Fix Strategies

### Direct Dependency Update

Update vulnerable packages to secure versions:

```bash
go get -u vulnerable/package@latest
go mod tidy
```

### Transitive Dependency Handling

For vulnerabilities in transitive dependencies:

```bash
go mod why vulnerable/package  # Understand why it's included
go mod edit -replace vulnerable/package=newer-version  # Replace if needed
go mod tidy
```

### Removal Strategy

If a dependency is unused or can be replaced:

1. Remove direct imports of the vulnerable code
2. Run `go mod tidy` to clean up unused dependencies
3. Verify application functionality remains intact

## Verification Steps

After applying fixes:

```bash
govulncheck ./...

go build ./...

go test ./...
```

## Common Vulnerabilities

### JWT Libraries

* Issue: `github.com/golang-jwt/jwt` GO-2025-3553 (excessive memory allocation)
* Fix: Update to newer version or switch to `golang.org/x/oauth2` alternatives

### Standard Library Updates

* Keep Go version updated for security patches
* Run `go vuln` to check for stdlib vulnerabilities

## Best Practices

* Regularly scan dependencies with `govulncheck`
* Keep dependencies updated with `go get -u`
* Use `go mod tidy` to remove unused dependencies
* Test thoroughly after vulnerability fixes
* Monitor for new vulnerabilities with automated tools

## 依赖说明

### 运行环境
- **Agent平台**: 支持SKILL.md的任意AI Agent(Claude Code / Cursor / Codex / Gemini CLI等)
- **操作系统**: Windows / macOS / Linux

### 依赖说明
| 依赖项 | 类型 | 是否必需 | 获取方式 |
|:-------|:-----|:---------|:---------|
| LLM API | API | 必需 | 由Agent内置LLM提供 |

### API Key 配置
- 本Skill基于Markdown指令,无需额外API Key(除内容中明确标注的外部API)

### 可用性分类
- **分类**: MD+EXEC(纯Markdown指令,部分功能需要exec命令行执行能力)
- **说明**: 基于Markdown的AI Skill,通过自然语言指令驱动Agent执行任务

## 核心能力

- Identify, assess, and fix security vulnerabilities in Go modules using
  govulncheck
- Handle common
- 触发关键词: identify, assess, vulnerabilities, vulnerability, modules, security

## 适用场景

| 场景 | 输入 | 输出 |
|------|------|------|
| 基础使用 | 用户请求 | 处理结果 |

**不适用于**：需要人工判断的复杂决策场景

## 使用流程

1. 确认运行环境满足依赖说明中的要求
2. 根据适用场景选择合适的使用方式
3. 执行操作并检查输出结果
4. 如遇错误，参考错误处理章节

## 示例

### 示例1：基础用法

```
输入: 用户请求
处理: 根据使用流程执行
输出: 处理结果
```

## 错误处理

| 错误场景 | 原因 | 处理方式 |
|---------|------|---------|
| 配置错误 | 参数缺失或格式错误 | 检查依赖说明中的配置要求 |
| 运行时错误 | 运行环境不满足 | 确认运行环境符合依赖说明 |
| 网络错误 | 连接超时或不可达 | 检查网络连接后重试，参考国内替代方案 |

## 常见问题

### Q1: 如何开始使用Go Security Vulnerab？
A: 请先阅读使用流程章节，确认环境满足依赖说明中的要求。

### Q2: 遇到错误怎么办？
A: 请参考错误处理章节，按照表格中的处理方式操作。

### Q3: Go Security Vulnerab有什么限制？
A: 请参考已知限制章节了解具体限制。

## 已知限制

- 需要LLM支持，无LLM环境无法使用
- 复杂场景可能需要人工辅助判断
- 性能取决于底层模型能力
