From vuln-skills
Audits Go code for authentication/authorization bypass in RBAC policies, Kubernetes admission webhooks, JWT/OAuth validation, and cloud-native privilege escalation. Covers CWE-287/863/269/284/285/862.
npx claudepluginhub yhy0/ghsa-skill-builder --plugin vuln-skillsThis skill uses the workspace's default tool permissions.
当审计 Go 代码中涉及认证流程、RBAC 权限检查、K8s admission webhook、JWT/OAuth 验证时加载此 Skill。
Audits Python code for authentication bypass vulnerabilities in permission checks, DRF views, JWT/token validation, decorators, middleware, and SSO/OAuth flows. Covers CWE-285/287/863.
Analyzes auth mechanisms (passwords/sessions/JWT/OAuth/MFA) and authz patterns (RBAC/ABAC/ACL) for vulnerabilities like bypasses, hijacking, broken access control; reports with OWASP/NIST remediation.
Detects authentication and authorization bypass vulnerabilities including missing auth middleware, JWT algorithm confusion, IDOR, and session fixation in web apps.
Share bugs, ideas, or general feedback.
当审计 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 个真实案例,需要时加载)。