bfla
它能做什么
这份指南涵盖操作级访问控制失效,即权限较低的用户可以调用管理员功能。适合检查网页、API 和后台功能中角色规则的安全测试人员。
适用场景
- ✓当授权测试需要检查普通用户能否访问仅限管理员的操作时。
- ✓当应用在界面中隐藏了管理员功能,但仍可能接受这些调用时。
- ✓当你需要检查 REST、GraphQL 和其他接口中的角色规则时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/bfla/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我们的应用中,普通用户能否通过直接发送请求来调用仅限管理员的操作?请帮我检查?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体列出高价值的操作,在授权测试中使用权限较低的账户逐一发送,并报告哪些本不应成功的操作却成功了。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Broken Function Level Authorization (BFLA)
BFLA is an action-level access control failure: a lower-privileged principal successfully invokes a function (HTTP endpoint, GraphQL mutation, gRPC method, WebSocket event, background job action) that should be restricted to a higher-privileged role. It is distinct from IDOR (T1190 object-level) — the surface here is the action itself, not the object ID. Enforcement must bind actor to action at every transport layer and every service boundary, not just at the UI or API gateway.
Authorized use only. Only test systems you are explicitly authorized to assess. Privilege escalation in production without authorization is a crime in most jurisdictions.
Attack Surface
- REST/JSON admin endpoints hidden from the UI but still live on the server
- GraphQL mutations and admin fields absent from the published schema but introspectable
- gRPC methods listed via server reflection that bypass gateway checks
- WebSocket events where only the handshake was authorized
- Background job create/finalize/approve endpoints that re-use session but skip role checks
- Internal microservice RPCs reachable via SSRF or exposed routing
- Feature flags enforced client-side / at edge but not at the core service
High-Value Actions
- Role/permission assignment, user impersonation, sudo/su endpoints
- Refund, credit issuance, price override, order void/cancel
- Export/bulk-download of all user data or PII
- Account suspension, deletion, reactivation, verification override
- Feature flag toggle, quota/grant adjustment, seat/license change
- 2FA reset, email-change bypass, password-reset initiation for arbitrary accounts
- Admin console CRUD (create user, delete user, assign group)
Reconnaissance
Build the Actor x Action Matrix
Before fuzzing, enumerate the roles and their expected actions:
# Capture all endpoints from JS bundles, API spec, and crawl
# Extract role-specific API paths from the frontend
curl -s https://<TARGET>/static/main.js | grep -oE '"/api/[^"]*"' | sort -u
curl -s https://<TARGET>/openapi.json 2>/dev/null | python3 -c "
import sys,json
spec = json.load(sys.stdin)
for path,methods in spec.get('paths',{}).items():
for method,info in methods.items():
tags = info.get('tags',[]) + info.get('x-roles',[]) + info.get('security',[])
print(method.upper(), path, tags)
" 2>/dev/null
For each discovered endpoint, note: HTTP method, expected minimum role, whether it appears in the UI for non-admin users.
Obtain Sessions for Each Role
# Register/obtain sessions for: unauthenticated, basic user, premium, staff, admin
# Store cookies/tokens for each role
curl -s -c unauthenticated.jar https://<TARGET>/api/me
curl -s -c basic.jar -X POST https://<TARGET>/login -d 'user=basic&pass=<pass>'
curl -s -c admin.jar -X POST https://<TARGET>/login -d 'user=admin&pass=<pass>'
Signals That BFLA Is Present
- Endpoint returns 200 for a lower-role token where 403/401 is expected
- Different HTTP methods on the same path have inconsistent enforcement (GET allowed, POST blocked — but PATCH is not)
- Admin endpoints return a different error code (404 vs 403) — "security through obscurity" that still processes the request
- Background job endpoints return 200 with a task ID even for non-admin callers
- GraphQL mutation returns data when sent from a basic-user token
Testing Methodology
Step 1: Baseline with Admin Token
Confirm each target action succeeds with the highest-privilege token first. This rules out the action being broken for everyone.
# Example: create a user as admin
curl -s -b admin.jar -X POST https://<TARGET>/api/admin/users \
-H 'Content-Type: application/json' \
-d '{"username":"testuser","role":"admin"}' | tee bfla_admin_baseline.txt
Step 2: Replay with Lower-Privilege Token
Replay the identical request with the basic-user or unauthenticated token. Same path, same method, same body.
curl -s -b basic.jar -X POST https://<TARGET>/api/admin/users \
-H 'Content-Type: application/json' \
-d '{"username":"testuser2","role":"admin"}' | tee bfla_basic_replay.txt
# Diff: admin got 201 Created, basic should get 403
diff bfla_admin_baseline.txt bfla_basic_replay.txt
Win condition: basic-user request returns 200/201/204 (or produces a durable state change verified by subsequent GET) when the admin baseline returned 201.
Step 3: Method Alternation
Many frameworks register rou
常见问题
它与 IDOR 有何不同?
该指南指出,IDOR 涉及对特定对象的访问,而这个问题关注的是操作本身。
隐藏的功能为什么重要?
该指南指出,管理员接口可能在界面中被隐藏,但仍然存在于服务器上。
应该在哪里强制执行?
在每个服务和传输层都进行角色检查,而不仅仅是在界面或网关上。
详情
作者的原始描述
Broken Function Level Authorization (BFLA) — exploit action-level access control failures where lower-privileged principals invoke admin/staff functions across REST, GraphQL, gRPC, WebSocket, and background job paths.
热度
- GitHub 星标
- 6.5k
- 排名
- #14049
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …