← 返回 Skills 市场
yhy0

Go Vuln Auth Bypass

作者 yhy · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
239
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install go-vuln-auth-bypass
功能描述
Use when auditing Go code involving authentication flows, RBAC policies, Kubernetes admission webhooks, JWT/OAuth token validation, or privilege escalation i...
使用说明 (SKILL.md)

Go Auth Bypass Vulnerability Patterns (CWE-287/863/269/284/285/862)

当审计 Go 代码中涉及认证流程、RBAC 权限检查、K8s admission webhook、JWT/OAuth 验证时加载此 Skill。

Detection Strategy

通用检测模型,适用于 Go 云原生生态中认证/授权绕过的所有变体。

Sources(攻击入口):

  • HTTP 请求头部(Authorization, Impersonate-User, Impersonate-Group
  • Kubernetes API 请求(ServiceAccount token, RBAC RoleBinding)
  • gRPC metadata(authorization, custom auth headers)
  • JWT/OAuth token(id_token, access_token, state parameter)
  • Webhook 回调请求(admission webhook, mutating webhook)
  • Rancher API proxy 请求(/v3/clusters/:id/proxy

Sinks(受保护资源/操作):

  • Kubernetes API 调用(client-go Create/Update/Delete
  • Rancher 管理 API(集群凭证、cloud credential)
  • Secret 读取/修改操作(v1.Secret 对象)
  • 特权提升操作(ClusterRoleBinding 创建, RoleRef 修改)
  • Admission webhook 的 allow/deny 决策
  • gRPC service method 实现

Sanitization(认证/授权屏障):

  • Go HTTP 中间件(chi Use(), gin Use(), echo middleware chain)
  • Kubernetes RBAC(SubjectAccessReview, SelfSubjectAccessReview
  • OPA/Gatekeeper 策略评估
  • JWT 验证库(golang-jwt/jwt/v5Parse + WithValidMethods
  • gRPC interceptor(UnaryInterceptor, StreamInterceptor
  • Rancher webhook 验证(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"
  1. 搜索受保护的资源端点(HTTP handler、gRPC method、admission webhook handler)
  2. 检查是否有认证/授权中间件保护(middleware chain、interceptor、RBAC check)
  3. 验证屏障是否可被绕过:
    • Admission webhook 在升级过程中是否被临时禁用?
    • RBAC 策略是否存在跨 namespace 权限泄漏?
    • JWT 验证是否检查了 alg 字段和 audience
    • OAuth state 参数是否正确验证?
    • 中间件顺序是否正确(auth middleware 在路由之前)?
    • Impersonation header 是否在 API proxy 中被正确过滤?
    • ServiceAccount token 的权限范围是否过宽?
  4. 若无屏障或屏障可被绕过 -> 标记为候选漏洞

Detection Checklist

  • Admission Webhook 升级期间绕过审计 (CWE-284):Rancher/K8s webhook 在升级过程中是否被临时删除或跳过?升级脚本是否先删除 webhook 再安装新版本?failurePolicy 设为 Ignore(failOpen)时 webhook 故障会导致请求被放行。namespaceSelector 配置不当可能导致特定 namespace 绕过 webhook 检查。务必验证 admission request 的来源(TLS 证书)防止伪造请求。
  • 跨 Namespace 权限泄漏审计 (CWE-269):Kyverno/OPA 策略中的 apiCall 是否使用了 ServiceAccount 的集群级权限访问其他 namespace 的资源?
  • JWT 验证完整性审计 (CWE-287):jwt.Parse() 是否指定了 jwt.WithValidMethods([]string{"RS256"})?是否检查了 aud/iss/exp claims?
  • OAuth state 参数验证审计 (CWE-287):OAuth 回调处理是否验证 state 参数与 session 中存储的值一致?是否存在 token 交换时的 TOCTOU?
  • gRPC Interceptor 认证审计 (CWE-285):所有需要认证的 gRPC method 是否都经过 UnaryInterceptor 认证链?是否有 method 被排除在外?
  • 中间件顺序审计 (CWE-285):chi/gin/echo 的 auth 中间件是否在路由组注册之前执行?r.Group().Use(authMiddleware) 是否覆盖了所有子路由?
  • K8s Impersonation Header 过滤审计 (CWE-284):API proxy 是否转发了 Impersonate-User/Impersonate-Group header?低权限用户是否能通过 proxy 冒充高权限用户?
  • Rancher Cloud Credential 访问控制审计 (CWE-284):Proxy API 是否正确验证用户对 cloud credential 的访问权限?是否存在通过代理绕过权限检查的路径?
  • ServiceAccount Token 权限范围审计 (CWE-269):自动创建的 SA token 是否具有集群级 cluster-admin 权限?是否遵循最小权限原则?

False Positive Exclusion Guide

以下模式不是此类漏洞:

  • 测试代码中的权限豁免 -- _test.go 文件中使用 fake.NewSimpleClientset() 跳过认证
  • 健康检查端点无认证 -- /healthz/readyz/livez 不需要认证是正常行为
  • 公开的 metrics 端点 -- /metrics 在 Prometheus 架构中通常不需要认证(需确认网络隔离)
  • 内部 gRPC 通信使用 mTLS -- 如果 gRPC 服务仅在 mesh 内通信且使用 mTLS,缺少 application-level 认证可接受

以下模式需要深入检查

  • admission.Allowed("") -- 空 reason 的 allow 决策可能是 webhook 的默认放行逻辑
  • if err != nil { return true } -- 认证错误时默认允许是高危模式
  • 中间件链中 Next() 在认证检查之前被调用 -- 可能导致后续 handler 在未认证情况下执行
  • ClusterRole 使用 * 通配符 -- resources: ["*"] + verbs: ["*"] 是过宽权限

Real-World Cases

详见 references/cases.md(7 个真实案例,需要时加载)。

安全使用建议
This skill is an offline checklist and code-search patterns for auditing Go auth/authorization issues and appears internally consistent. Before installing or granting an agent access: (1) ensure the agent is only given access to the repository or files you want audited (the skill's checks operate on local source), (2) review references/cases.md if you want concrete examples, and (3) if you prefer manual control, invoke the skill only when needed (it is not always-enabled). There are no required credentials or remote installs, so the direct technical risk from the skill itself is low.
功能分析
Type: OpenClaw Skill Name: go-vuln-auth-bypass Version: 0.1.0 The skill bundle is a legitimate security auditing tool designed to help an AI agent identify authentication and authorization bypass vulnerabilities in Go code. It contains standard detection strategies, grep patterns for common sinks/sources (e.g., `jwt.Parse`, `SubjectAccessReview`), and educational references to real-world CVEs like CVE-2021-25320. No evidence of malicious intent, data exfiltration, or harmful instructions was found in SKILL.md or references/cases.md.
能力评估
Purpose & Capability
The name/description describe auditing Go auth/authorization flows and the artifact is a detailed checklist and grep/search patterns for exactly that task. No unrelated binaries, env vars, or external services are requested.
Instruction Scope
SKILL.md contains static guidance and concrete repo-local grep/search/check steps for auditing Go code, plus a references file of real cases. It does not instruct the agent to read unrelated system files, exfiltrate data, or call external endpoints.
Install Mechanism
No install spec or code files — instruction-only. Nothing will be downloaded or written to disk by an install step.
Credentials
The skill declares no required environment variables, credentials, or config paths. The guidance operates on repo-local source code, so no external secrets are needed.
Persistence & Privilege
always is false and there is no install-time persistence. The skill is user-invocable and allows model invocation (platform default) but does not request elevated or permanent privileges.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install go-vuln-auth-bypass
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /go-vuln-auth-bypass 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of go-vuln-auth-bypass, a skill for auditing Go authentication and authorization flows. - Supports detection of common auth/z bypass patterns in Go/Kubernetes/cloud-native projects. - Provides a comprehensive checklist for auditing admission webhooks, RBAC, JWT/OAuth validation, gRPC interceptors, and middleware chains. - Details sources, sinks, sanitizers, and grep patterns for accurate detection. - Includes false positive/negative guidance and real-world vulnerabilities references. - Covers CWE-287, CWE-863, CWE-269, CWE-284, CWE-285, and CWE-862.
元数据
Slug go-vuln-auth-bypass
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Go Vuln Auth Bypass 是什么?

Use when auditing Go code involving authentication flows, RBAC policies, Kubernetes admission webhooks, JWT/OAuth token validation, or privilege escalation i... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 239 次。

如何安装 Go Vuln Auth Bypass?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install go-vuln-auth-bypass」即可一键安装,无需额外配置。

Go Vuln Auth Bypass 是免费的吗?

是的,Go Vuln Auth Bypass 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Go Vuln Auth Bypass 支持哪些平台?

Go Vuln Auth Bypass 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Go Vuln Auth Bypass?

由 yhy(@yhy0)开发并维护,当前版本 v0.1.0。

💬 留言讨论