/vuln-skills:go-vuln-auth-bypassfrom vuln-skills
Audits Go code for authentication/authorization bypass vulnerabilities in cloud-native infrastructure, covering JWT/OAuth validation, RBAC policies, Kubernetes admission webhooks, and privilege escalation.
Ships in vuln-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
当审计 Go 代码中涉及认证流程、RBAC 权限检查、K8s admission webhook、JWT/OAuth 验证时加载此 Skill。
通用检测模型,适用于 Go 云原生生态中认证/授权绕过的所有变体。
Sources(攻击入口):
Authorization, Impersonate-User, Impersonate-Group)authorization, custom auth headers)id_token, access_token, state parameter)/v3/clusters/:id/proxy)Sinks(受保护资源/操作):
client-go Create/Update/Delete)v1.Secret 对象)ClusterRoleBinding 创建, RoleRef 修改)allow/deny 决策Sanitization(认证/授权屏障):
Use(), gin Use(), echo middleware chain)SubjectAccessReview, SelfSubjectAccessReview)golang-jwt/jwt/v5 的 Parse + WithValidMethods)UnaryInterceptor, StreamInterceptor)cattle.io webhook admission)检测路径:
搜索认证/授权模式的 Grep 模式:
# K8s admission webhook — 检查是否正确拒绝请求
grep -rn "admission.Response\|admission.Allowed\|admission.Denied" --include="*.go"
# RBAC 检查
grep -rn "SubjectAccessReview\|SelfSubjectAccessReview\|authz" --include="*.go"
# JWT 解析
grep -rn "jwt.Parse\|jwt.ParseWithClaims\|token.Valid" --include="*.go"
# OAuth state 参数
grep -rn "oauth\|OAuth\|state.*param\|csrf.*token" --include="*.go"
# HTTP 中间件注册
grep -rn "\.Use(\|\.Group(\|middleware\.\|interceptor" --include="*.go"
# Rancher proxy API
grep -rn "proxy.*handler\|proxyRequest\|cloud.*credential" --include="*.go"
# K8s impersonation
grep -rn "Impersonate\|impersonate\|as-user\|as-group" --include="*.go"
alg 字段和 audience?failurePolicy 设为 Ignore(failOpen)时 webhook 故障会导致请求被放行。namespaceSelector 配置不当可能导致特定 namespace 绕过 webhook 检查。务必验证 admission request 的来源(TLS 证书)防止伪造请求。apiCall 是否使用了 ServiceAccount 的集群级权限访问其他 namespace 的资源?jwt.Parse() 是否指定了 jwt.WithValidMethods([]string{"RS256"})?是否检查了 aud/iss/exp claims?state 参数与 session 中存储的值一致?是否存在 token 交换时的 TOCTOU?UnaryInterceptor 认证链?是否有 method 被排除在外?r.Group().Use(authMiddleware) 是否覆盖了所有子路由?Impersonate-User/Impersonate-Group header?低权限用户是否能通过 proxy 冒充高权限用户?cluster-admin 权限?是否遵循最小权限原则?以下模式不是此类漏洞:
_test.go 文件中使用 fake.NewSimpleClientset() 跳过认证/healthz、/readyz、/livez 不需要认证是正常行为/metrics 在 Prometheus 架构中通常不需要认证(需确认网络隔离)以下模式需要深入检查:
admission.Allowed("") -- 空 reason 的 allow 决策可能是 webhook 的默认放行逻辑if err != nil { return true } -- 认证错误时默认允许是高危模式Next() 在认证检查之前被调用 -- 可能导致后续 handler 在未认证情况下执行ClusterRole 使用 * 通配符 -- resources: ["*"] + verbs: ["*"] 是过宽权限详见 references/cases.md(7 个真实案例,需要时加载)。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Go, Kubernetes, Oauth, JWT
npx claudepluginhub yhy0/ghsa-skill-builder --plugin vuln-skills26 skills in this plugin
/go-vuln-crypto-tlsUse when auditing Go code involving TLS configuration, certificate validation, JWT token parsing, SAML assertion verification, webhook signature checking, or cryptographic operations. Covers CWE-295/347/345. Keywords: InsecureSkipVerify, TLS, mTLS, certificate validation, JWT algorithm, SAML signature, cosign, sigstore, hmac.Equal, X.509, webhook HMAC/go-vuln-dosUse when auditing Go code involving goroutine management, channel operations, HTTP request handling, resource allocation, or panic recovery. Covers CWE-400/770/476. Keywords: denial of service, goroutine leak, channel deadlock, panic recover, io.ReadAll, resource exhaustion, OOM, HTTP/2 abuse, protobuf, unbounded allocation, rate limiting/go-vuln-info-disclosureUse when auditing Go code involving logging, error handling, HTTP response data, Kubernetes Secret management, or credential storage. Covers CWE-200/532/522/312/552. Keywords: information disclosure, credential leak, log exposure, Kubernetes Secret, json tag, struct formatting, error message, stack trace, Rancher, Argo CD, sensitive data/go-vuln-injectionUse when auditing Go code involving OS command execution, SQL queries, template rendering, or child command invocation. Covers CWE-78/89/77/94/88. Keywords: command injection, SQL injection, exec.Command, os/exec, database/sql, text/template, html/template, argument injection, shell injection, Gogs, Grafana, MCP stdio/go-vuln-path-traversalUse when auditing Go code involving file path operations, archive extraction, symlink handling, container volume mounts, or HTTP file serving. Covers CWE-22/59. Keywords: path traversal, directory traversal, filepath.Join, symlink, archive extraction, zip slip, tar, volume mount, go-git, Helm chart, os.Open, filepath.Clean/go-vuln-ssrf-requestforgeryUse when auditing Go code involving HTTP client requests, webhook callbacks, URL handling, HTML template rendering in Go web frameworks, or CSRF protection. Covers CWE-918/352/79. Keywords: SSRF, server-side request forgery, XSS, cross-site scripting, CSRF, http.Get, http.Client, template.HTML, Gin, Echo, Fiber, webhook, Kyverno, DNS rebindingOther plugins' skills for the same job