A01: Broken Access Control
Access control enforces policy such that users cannot act outside of their intended permissions. Failures lead to unauthorized information disclosure, modification, or destruction of data.
Key Vulnerabilities
Violation of the principle of least privilege — access should be deny-by-default
Bypassing access control by modifying URLs, internal state, or API requests
Insecure Direct Object References (IDOR) — accessing other users' data by guessing IDs
Missing access controls for POST, PUT, DELETE on APIs
Elevation of privilege — acting as admin without proper authorization
CORS misconfiguration allowing unauthorized API access
Prevention Strategies
Deny by default — except for public resources
Implement access control once, reuse throughout the app
Enforce record ownership in data models
Disable directory listing and remove metadata from web roots
Log access control failures and alert admins
Rate-limit API and controller access
Invalidate session tokens server-side on logout
Real-World Example
In 2019, a major US financial services company exposed 100 million customer records due to a misconfigured WAF that allowed SSRF attacks — a form of broken access control.
Code Comparison
// VULNERABLE: Direct parameter access without authorization check
app.get('/api/account', (req, res) => {
const accountId = req.query.acct;
// No check if user owns this account!
db.query('SELECT * FROM accounts WHERE id = ?', [accountId]);
});
// Attacker: /api/account?acct=someone_elses_id// SECURE: Verify user owns the requested resource
app.get('/api/account', authenticate, (req, res) => {
const accountId = req.query.acct;
const userId = req.user.id;
db.query(
'SELECT * FROM accounts WHERE id = ? AND owner_id = ?',
[accountId, userId]
);
});