/vuln-skills:vuln-patterns-auth-bypassfrom vuln-skills
Audits Python authentication flows, permission checks, JWT/token validation, decorator-based protection, and SSO/OAuth identity binding for bypass vulnerabilities (CWE-285/287/863).
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.
当审计 Python 代码中涉及认证流程、权限检查、访问控制逻辑时加载此 Skill。
通用检测模型,适用于此类漏洞的所有变体。
Sources(攻击入口):
Sinks(受保护资源/操作):
Sanitization(认证/授权屏障):
@login_required, @permission_required)permission_classes(IsAuthenticated, IsAdminUser)检测路径:
搜索认证/授权模式的 Grep 模式:
# DRF 视图缺少 permission_classes
grep -rn "class.*APIView\|class.*ViewSet" --include="*.py"
grep -rn "permission_classes" --include="*.py"
# 异常处理中的 fallback
grep -rn "except.*return" --include="*.py"
# 认证装饰器
grep -rn "login_required\|permission_required" --include="*.py"
# SSO/OAuth 相关
grep -rn "SAML\|OAuth\|OpenID\|IdP" --include="*.py"
# 事件总线
grep -rn "event.*handler\|on_event\|publish(" --include="*.py"
except 块中是否返回可预测的 fallback 值(如 -1, None, ""),且该值可被攻击者用于绕过后续校验?if A and B or C 类型的复合条件是否因缺少括号导致逻辑与预期不符?(and 优先级高于 or)APIView/ViewSet 是否显式声明了 permission_classes?未声明时 DRF 默认使用 DEFAULT_PERMISSION_CLASSES,可能为 AllowAny。is_authenticated 不等于「是本人」。/user 匹配 /user/admin)?低权限角色的路由列表是否包含高权限端点?allow_all + identity_provider),升级框架版本后优先级是否发生变化?以下模式不是此类漏洞:
if secret != -1 and secret == input),则不是漏洞DEBUG=True 时跳过认证,需确认生产环境不受影响以下模式需要深入检查:
except Exception: return default_value -- 宽泛异常捕获 + 返回默认值是高危模式,必须追踪 default_value 的使用方式if user.is_authenticated -- 仅检查认证状态而不验证身份(是否是正确的用户),在 account linking 场景中可能导致冒充permission_classes = [] 或 permission_classes = [AllowAny] -- 显式移除权限检查,需确认是否为公开接口allow_all 等配置项的语义可能因框架升级而改变/user 路由权限是否意外覆盖了 /user/admin 等子路径详见 references/cases.md(7 个真实案例,需要时加载)。
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub yhy0/ghsa-skill-builder --plugin vuln-skills26 skills in this plugin
/go-vuln-auth-bypassUse when auditing Go code involving authentication flows, RBAC policies, Kubernetes admission webhooks, JWT/OAuth token validation, or privilege escalation in cloud-native infrastructure. Covers CWE-287/863/269/284/285/862. Keywords: authentication bypass, authorization bypass, RBAC, admission webhook, JWT, OAuth, privilege escalation, Rancher, Kyverno, impersonation, namespace isolation, middleware auth/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-Other plugins' skills for the same job