Authorization testing

From xalgorix/xalgorix · View interactive version

Authorization testing is an AI agent skill from the GitHub repository xalgorix/xalgorix. Application-level authorization methodology - horizontal, vertical, and tenant boundary testing, ownership transitions, method and route differentials. Replay legitimate privileged requests with lower privilege using authz_matrix first to produce differential evidence.

How to use this skill

Skill file

Authorization Testing

Purpose

Test whether the application enforces WHO may do WHAT to WHICH object - at every boundary: same-level users (horizontal), privilege levels (vertical), tenants (organizational), and lifecycle states (ownership transitions). This is the methodology layer: it decides which pairs to replay and what counts as proof.

Entry Conditions

Core Strategy: Replay the Legitimate Request, Change Only the Identity

  1. Perform the operation legitimately as the owner/rightful role (capture the exact request) - this is the baseline
  2. Replay the identical request with a lower-privilege or different-identity context
  3. Compare: status AND body AND effect on the object
  4. authz_matrix FIRST: authz_matrix url=<resource> replays your request as the second configured account and as anonymous, then records the cross-identity access differential as exploit-proven ledger evidence. Do not hand-roll multi-account curl comparisons when authz_matrix settles it in one call.

Boundary Classes

Horizontal (user -> other user objects)

Vertical (lower role -> privileged functions)

# Method differential on one protected endpoint, as the LOW-privilege user
for method in GET POST PUT PATCH DELETE OPTIONS HEAD; do
  code=$(curl -s -o /dev/null -w "%{http_code}" -X "$method" \
    -H "Authorization: $USER_TOKEN" "https://target.example.com/admin/users/5")
  echo "$method -> $code"
done

Tenant isolation

# Tenant-B data requested with Tenant-A session
curl -s -H "Authorization: $TENANT_A_TOKEN" \
  "https://target.example.com/api/organizations/tenant-b-id/users" | jq .
# Tenant supplied via header instead of path
curl -s -H "Authorization: $TENANT_A_TOKEN" -H "X-Tenant-ID: tenant-b-id" \
  "https://target.example.com/api/users" | jq .

Ownership transitions (the forgotten states)

Method and route differentials

Evidence Contract

legitimate owner/role request (captured baseline)
-> identical request replayed by attacker identity
-> response differential (status/body identical to baseline = boundary broken)
-> the attacker actually received/changed the protected object (match identifiers)
-> report with both request pairs

Not enough: User A got HTTP 200. Good proof: User A received User B real protected object (same order ID, total, email), or the delete actually removed B document.

A 403 on one verb is NOT a clean negative until the other verbs, versions, and route families are covered.

Common Misses

False Positives

Xalgorix Tool Strategy

When to Load a Specialist Skill

Stopping Rule

Stop when: every discovered resource type has been exercised horizontally (read AND write), every privileged route family has a vertical replay across available roles, every tenant-id location has been swapped once, and each ownership transition has been driven once. When a boundary proves broken in one route family, still spot-check one alternative family (v1/v2, GraphQL) before closing - but do not exhaustively re-test every family for every object.

Handoffs

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.