Api bola

From xalgorix/xalgorix · View interactive version

Api bola is an AI agent skill from the GitHub repository xalgorix/xalgorix. Broken Object Level Authorization (BOLA/IDOR) testing for REST and GraphQL APIs — object ID harvesting and swapping across paths, query, body, batch, and nested resources with two-account differential evidence (OWASP API1)

How to use this skill

Skill file

API BOLA — Broken Object Level Authorization (OWASP API1)

Purpose

Test whether authenticated callers can access or modify other users' objects by manipulating object identifiers, when the server fails to enforce per-object authorization.

Preconditions

Attack Surface Signals

Methodology

Step 1: Harvest Object IDs

# Legitimate IDs first (own account), then victim IDs from list endpoints,
# search responses, exports, logs, comments, and any shared context.
curl -sk -H "Authorization: Bearer USER_A" "https://TARGET/api/users/me" | jq -r '.id'
curl -sk -H "Authorization: Bearer USER_A" "https://TARGET/api/users/me/orders" | jq -r '.orders[].id'

Step 2: Two-Account Differential

# User B legitimately accesses their own object (baseline B)
curl -sk -H "Authorization: Bearer USER_B" "https://TARGET/api/orders/5003" > tmp/b_own.json
# User A attacks the same object
curl -sk -H "Authorization: Bearer USER_A" "https://TARGET/api/orders/5003" > tmp/a_cross.json
# User A's own object (baseline A) and anonymous request complete the matrix
curl -sk -H "Authorization: Bearer USER_A" "https://TARGET/api/orders/5001" > tmp/a_own.json
curl -sk "https://TARGET/api/orders/5003" > tmp/anon.json
diff <(jq -S . tmp/b_own.json) <(jq -S . tmp/a_cross.json)

Confirm the response is User B's ACTUAL data (match a known victim-owned value: email, address, total), never an empty shell or generic 200.

Step 3: Test Every ID Location

Step 4: Test Every Method

for method in GET PUT PATCH DELETE; do
  code=$(curl -sk -o /dev/null -w "%{http_code}" -X $method \
    -H "Authorization: Bearer USER_A" "https://TARGET/api/addresses/2002")
  echo "$method: $code"
done

GET may 403 while PUT/PATCH/DELETE succeed. For write hits, read back as the victim (or admin) to verify the change persisted.

Step 5: Version and Shape Drift

Evidence Contract

A BOLA finding requires ALL of:

  1. Baseline: victim legitimately accesses their object; attacker legitimately accesses own object
  2. Manipulation: attacker's session references the victim's object ID
  3. Differential: attacker receives the victim's actual data (verified by a known victim-owned value) or modifies/deletes it (verified by read-back)
  4. Anonymous/low-priv controls show the endpoint is otherwise protected

NOT evidence: HTTP 200 with an empty body, a 200 on the attacker's own object, 404/405 responses, existence of an ID parameter, error-message leaks

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Stopping Rule

Every object-ID-bearing endpoint x every ID location x every method, with a verified victim-data differential before reporting.

Handoff

Report endpoint, method, ID location, victim object reference, and the concrete victim-owned value returned or changed. Property-level leaks within a cross-object read also belong to api-bopla; write-side role changes belong to api-bfla.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.