Chuyển đến nội dung
Skillpedia
Bảo mật6.5k · #14049

bfla

Skill này làm gì

Hướng dẫn này nói về lỗi kiểm soát truy cập ở mức hành động, khi người dùng có quyền thấp hơn có thể gọi một chức năng quản trị. Dành cho người kiểm thử bảo mật kiểm tra quy tắc vai trò trên web, API và các tính năng nền.

Khi nào nên dùng

  • ✓Khi một bài kiểm thử được ủy quyền muốn kiểm tra xem người dùng thông thường có tiếp cận được các thao tác chỉ dành cho quản trị không.
  • ✓Khi ứng dụng ẩn tính năng quản trị trên giao diện nhưng vẫn có thể chấp nhận các lệnh gọi đó.
  • ✓Khi bạn cần kiểm tra quy tắc vai trò trên REST, GraphQL và các giao diện khác.

Liên kết skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/bfla/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/exploit/web/bfla/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Người dùng thông thường trong ứng dụng của chúng tôi có thể gọi các thao tác chỉ dành cho quản trị bằng cách gửi yêu cầu trực tiếp không? Vui lòng kiểm tra.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent liệt kê các thao tác có giá trị cao, gửi từng thao tác bằng một tài khoản có quyền thấp hơn trong một bài kiểm thử được ủy quyền, và báo cáo những thao tác thành công dù không được phép.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

Câu hỏi thường gặp

Khác gì với IDOR?

Hướng dẫn cho biết IDOR là về truy cập đối tượng cụ thể, còn lỗi này là về chính hành động đó.

Vì sao các tính năng ẩn quan trọng?

Hướng dẫn lưu ý rằng các endpoint quản trị có thể bị ẩn khỏi giao diện nhưng vẫn tồn tại trên máy chủ.

Nên áp dụng gì?

Kiểm tra vai trò ở mọi dịch vụ và tầng truyền tải, không chỉ ở giao diện hay cổng vào.

Chi tiết

Mô tả gốc của tác giả

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.

repo: BitterSecurity/Decepticon

Độ phổ biến

Sao GitHub
6.5k
Vị trí xếp hạng
#14049
Giấy phép
Apache-2.0
Cập nhật
1/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự