OWASP API Security Top 10: API1 BOLA · API3 broken object property level auth (mass assignment) · API4 unrestricted resource consumption
✅ This week — what to do
- Before class — Docker Desktop working (Week 1 Lab 0); skim last week's recap.
- Lecture (120 min) — weekly quiz first (~10 min), then the lecture. Slides:
slides/week10.md. - Lab (180 min) — play this week's game, then complete Worksheet 10 (
worksheet.md, Parts 1–4, incl. Audit the AI + EiPE/Prompt). Kickoff:docker compose up → :8080 (insecure) / :8081 (secure). - Submit — worksheet PDF →
learn.zcr.ai/submit· code → GitHub · weekly quiz →learn.zcr.ai/quiz. (How: SUBMISSION.md.) - Project — apply this week's lesson to your NoteVault project where it fits.
Time breakdown: AGENDA.md (../../AGENDA.md). Grading: see the worksheet rubric.
Objectives
- Map the REST/GraphQL attack surface.
- Exploit BOLA and mass assignment.
- Add authorization, schema validation, and rate limiting.
🥷 Signature game — "crAPI Raid"
Target: the local API below — that's the graded lab (see rubric), not crAPI.
- BOLA: read another user's orders by id with zero ownership check (
/api/users/<id>/orders). - Mass assignment: smuggle
is_admin/balanceintoPOST /api/users. - Resource consumption: hammer
/api/login— no rate limit (401×5 → 429×2). - Fix: read
solution_api.pyand cite the exact line that blocks each exploit (the object-level ownership check, theALLOWED_CREATE_FIELDSallow-list, and the rate limiter).
Bonus (optional, ~20 min, ungraded): crAPI — OWASP's own intentionally-vulnerable API, real GUID-based BOLA. Capture-only — no fix step.
git clone https://github.com/OWASP/crAPI.git
cd crAPI/deploy/docker && docker compose -f docker-compose.yml up -d
Run the local target
docker compose up # vulnerable_api.py on http://localhost:8080 ; solution_api.py on :8081
The secure API is solution_api.py (on :8081).
Deliverable
Findings report (API Top 10 mapping) + fixes.
References
- https://owasp.org/API-Security/ · https://github.com/OWASP/crAPI