Course contentsShow
← Software Engineering
Lesson 1042 of 1,93332. Security EngineeringFree lesson

A01: Broken Access Control

How improper authorization checks allow users to access unauthorized functionality or data.

A01: Broken Access Control

What you'll learn: How improper authorization checks allow users to access unauthorized functionality or data — and why it's the #1 web application security risk.

The Core Problem

Broken Access Control occurs when your application fails to properly enforce who can access what. You've built authentication (proving identity) and even defined authorization rules (who should do what), but somewhere in your code, those checks are missing, incomplete, or bypassable.

Think of it like a hospital with ID badges but unlocked doors. Everyone has their badge checked at the front desk, but nothing stops a visitor from wandering into the surgery wing because nobody checks credentials at the actual operating room door.

Common Examples

Direct Object References: A user changes a URL from /invoice/123 to /invoice/124 and suddenly sees someone else's invoice — because the code never verified ownership.

Elevation of Privilege: A regular user discovers they can access /admin/users simply by typing the URL, because the backend only checked roles on the login page, not on every request.

Metadata Manipulation: Changing userId=42 in a POST request body to access another user's account.

Missing Function-Level Checks: The UI hides admin buttons from regular users, but the API endpoints behind those buttons accept requests from anyone.

Why It's Dangerous

Access control flaws expose sensitive data, allow unauthorized modifications, and can lead to complete account takeovers. They're widespread because developers often implement checks inconsistently — protecting one endpoint but forgetting another.

Key Takeaway: Every access to protected resources must verify authorization at the server level, regardless of what the client UI shows or what checks happened earlier in the request chain.