agentleFS
mejbaurbaharmejbaurbahar/software-tester-skills/skills/authn-authz-testing/SKILL.md

authn-authz-testing

Skill1 starsChanged 53 days agoMITView on GitHub

Use when testing authentication and authorization — login, MFA, OAuth2/OIDC, SAML, JWT, sessions/cookies, password reset, RBAC/ABAC, IDOR/BOLA, privilege escalation, multi-tenant isolation, and account-takeover paths.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Function-level (BFLA): every API route, incl. undocumented (diff OpenAPI vs proxy logs).

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Authentication & Authorization Testing

Auth is where most critical breaches live (OWASP A01 Broken Access Control, A07 Auth Failures, API1 BOLA). Test who you are (authn) and what you may do (authz) separately.

Authentication matrix

AreaCases
LoginValid/invalid; user-enumeration via message/timing/status; lockout & rate limit; credential stuffing; case/space/unicode normalization
PasswordsMin length (≥12), breached-password check, no truncation, strong hashing (argon2id/bcrypt), reset tokens single-use + short TTL + bound to user, reset doesn't leak account existence
MFAEnforced for privileged; brute-force limits; bypass via alternate endpoint/remember me; recovery codes; SIM-swap resilience; step-up for sensitive actions
SessionsNew ID on login (fixation), HttpOnly; Secure; SameSite, idle + absolute timeout, logout invalidates server-side, concurrent sessions, revoke-all on password change
OAuth2/OIDCstate & PKCE enforced; exact redirect_uri match; nonce; code single use; scopes minimal; refresh-token rotation/reuse detection; ID-token aud/iss/exp validated
SAML/SSOSignature wrapping, Audience, InResponseTo, replay, assertion expiry, JIT provisioning role mapping
API keysScoped, rotatable, hashed at rest, never in URLs/logs

JWT checklist

alg:none rejected · algorithm pinned (no RS→HS confusion) · signature verified · exp/nbf/iat/aud/iss checked · kid not injectable · short access-token TTL · tokens revocable · no secrets/PII in payload · key rotation works.

jwt_tool $TOKEN -T                      # tamper claims; -X a (alg none), -X k (key confusion)
echo $TOKEN | cut -d. -f2 | base64 -d   # inspect claims

Authorization testing — the role × resource × action grid

  1. List roles (anon, user, admin, support, tenant-admin), resources, actions (CRUD + export, share, impersonate).
  2. For each cell: expected allow/deny. Automate with two+ accounts.
  3. Horizontal: user A requests user B's object by ID (/orders/123, ?user_id=, GraphQL node id, file paths, UUIDs are not security). → expect 403/404.
  4. Vertical: low-priv token calls admin endpoints, hidden UI actions, PUT role=admin mass-assignment, HTTP method swap (GET→DELETE), header tricks (X-Original-URL, X-HTTP-Method-Override).
  5. Function-level (BFLA): every API route, incl. undocumented (diff OpenAPI vs proxy logs).
  6. Multi-tenant: tenant-ID in JWT vs path vs body — tamper each; bulk/export/search/cache/queue/webhook paths often forget tenancy.
  7. Indirect: forced browsing, presigned URL reuse, cached responses served across users (Vary, CDN), stale permissions after role change/user removal.
# BOLA probe — same request as A vs B
for rid in a_resource_ids:
    r = s_b.get(f"{API}/orders/{rid}")
    assert r.status_code in (403, 404), (rid, r.status_code)

Burp: Autorize / AuthMatrix extensions; ZAP access-control scripts; Postman collection run per role.

Reporting

Show request/response for both principals, the missing check, impact (data/actions exposed), CVSS, and fix (centralized policy: deny-by-default, object-level check in data layer, tests per role).

Related

security-testing, api-testing, 42crunch-api-security-testing, threat-modeling

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.