Chuyển đến nội dung
Skillpedia
Kiểm thử35k · #8378

testing-api-for-broken-object-level-authorization

Skill này làm gì

Công cụ này kiểm tra xem một hệ thống trực tuyến (API) có cho phép một người dùng truy cập hoặc sửa đổi dữ liệu của người dùng khác mà không được phép hay không. Nó làm việc này bằng cách kiểm tra các mã định danh đối tượng khác nhau.

Khi nào nên dùng

  • ✓Khi bạn kiểm thử bảo mật một hệ thống trực tuyến.
  • ✓Khi bạn muốn đảm bảo người dùng không thể truy cập dữ liệu của nhau.
  • ✓Khi bạn muốn kiểm tra xem hệ thống có bảo vệ đúng dữ liệu của từng cá nhân không.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-for-broken-object-level-authorization/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/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-for-broken-object-level-authorization/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

“Kiểm tra xem API có cho phép người dùng A xem đơn hàng của người dùng B không.”

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

Cách hoạt động

Công cụ thử dùng mã định danh của một đối tượng (như số đơn hàng) thuộc về một người dùng, nhưng với thông tin đăng nhập của người dùng khác. Nếu hệ thống cho phép truy cập, nó có lỗ hổng bảo mật.

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.

Testing API for Broken Object Level Authorization

When to Use

  • Assessing REST or GraphQL APIs that use object identifiers in URL paths, query parameters, or request bodies
  • Performing OWASP API Security Top 10 assessments where API1:2023 (BOLA) must be tested
  • Testing multi-tenant SaaS applications where users from different tenants should not access each other's data
  • Validating that API endpoints enforce per-object authorization checks beyond just authentication
  • Evaluating APIs after new endpoints are added to ensure authorization middleware is applied consistently

Do not use without written authorization from the API owner. BOLA testing involves accessing or attempting to access other users' data, which requires explicit permission.

Prerequisites

  • Written authorization specifying the target API endpoints and scope of testing
  • At least two test accounts with different privilege levels and distinct data sets
  • Burp Suite Professional or OWASP ZAP configured as an intercepting proxy
  • Authentication tokens (JWT, session cookies, API keys) for each test account
  • API documentation (OpenAPI/Swagger spec) or access to enumerate endpoints
  • Python 3.10+ with requests library for scripted testing
  • Autorize Burp extension installed for automated BOLA detection

Workflow

Step 1: API Endpoint Discovery and Object ID Mapping

Enumerate all API endpoints and identify parameters that reference objects:

From OpenAPI/Swagger Specification:

# Download and parse the OpenAPI spec
curl -s https://target-api.example.com/api/docs/swagger.json | python3 -m json.tool

# Extract all endpoints with path parameters
curl -s https://target-api.example.com/api/docs/swagger.json | \
  python3 -c "
import json, sys
spec = json.load(sys.stdin)
for path, methods in spec.get('paths', {}).items():
    for method, details in methods.items():
        if method in ('get','post','put','patch','delete'):
            params = [p['name'] for p in details.get('parameters',[]) if p.get('in') in ('path','query')]
            if params:
                print(f'{method.upper()} {path} -> params: {params}')
"

From Burp Suite Traffic:

  1. Browse the application as User A, exercising all features that involve data creation and retrieval
  2. In Burp, go to Target > Site Map and filter for API paths (e.g., /api/v1/, /graphql)
  3. Look for patterns: /api/v1/users/{id}, /api/v1/orders/{order_id}, /api/v1/documents/{doc_uuid}
  4. Note the object ID format: sequential integers (predictable), UUIDs (less predictable), or encoded values

Classify Object ID Types:

ID Type Example Predictability BOLA Risk
Sequential Integer /orders/1042 High - increment/decrement Critical
UUID v4 /orders/550e8400-e29b-41d4-a716-446655440000 Low - random Medium (if leaked)
Encoded/Hashed /orders/base64encodedvalue Medium - decode and predict High
Composite /users/42/orders/1042 High - multiple IDs to swap Critical
Slug /profiles/john-doe Medium - guess usernames High

Step 2: Baseline Request Capture with Authenticated User

Capture legitimate requests for User A and User B:

import requests

BASE_URL = "https://target-api.example.com/api/v1"

# User A credentials
user_a_token = "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
user_a_headers = {"Authorization": user_a_token, "Content-Type": "application/json"}

# User B credentials
user_b_token = "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
user_b_headers = {"Authorization": user_b_token, "Content-Type": "application/json"}

# Step 1: Identify User A's objects
user_a_profile = requests.get(f"{BASE_URL}/users/me", headers=user_a_headers)
user_a_id = user_a_profile.json()["id"]  # e.g., 1001

user_a_orders = requests.get(f"{BASE_URL}/users/{user_a_id}/orders", headers=user_a_headers)
user_a_order_ids = [o["id"] for o in user_a_orders.json()["orders"]]  # e.g., [5001, 5002]

# Step 2: Identify User B's objects
user_b_profile = requests.get(f"{BASE_URL}/users/me", headers=user_b_headers)
user_b_id = user_b_profile.json()["id"]  # e.g., 1002

user_b_orders = requests.get(f"{BASE_URL}/users/{user_b_id}/orders", headers=user_b_headers)
user_b_order_ids = [o["id"] for o in user_b_orders.json()["orders"]]  # e.g., [5003, 5004]

print(f"User A (ID: {user_a_id}): Orders {user_a_order_ids}")

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

BOLA/IDOR là gì?

Đây là các lỗ hổng bảo mật, trong đó người dùng có thể truy cập hoặc sửa đổi dữ liệu mà họ không được phép, thường bằng cách thay một mã định danh (ID) bằng ID khác.

Tôi có cần sự cho phép để dùng công cụ này không?

Có, bạn cần giấy ủy quyền rõ ràng bằng văn bản từ chủ hệ thống trước khi thực hiện bất kỳ kiểm thử nào.

Tôi cần những công cụ nào?

Bạn cần các công cụ như Burp Suite hoặc OWASP ZAP, tài khoản kiểm thử và kiến thức lập trình cơ bản.

Chi tiết

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

Tests REST and GraphQL APIs for Broken Object Level Authorization (BOLA/IDOR, OWASP API1:2023) by intercepting API calls, identifying object ID parameters (numeric IDs, UUIDs, slugs), and systematically substituting IDs belonging to other users to check whether the server enforces per-object authorization. Use when asked to test BOLA or IDOR in an API, verify object-level authorization, or assess

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8378
Giấy phép
Apache-2.0
Cập nhật
31/8/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ự