_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

OWASP Top 10: Broken Access Control

29. 08. 2025 1 min read intermediate

Broken Access Control has been the number one vulnerability in OWASP Top 10 since 2021. Every third web application has authorization problems — users access data they don’t have permission to.

What is Broken Access Control

Access control ensures that users can only do what they’re authorized to do. Broken access control occurs when the application doesn’t perform this check correctly — users can modify others’ data, access admin interfaces, or escalate their privileges.

Typical Attacks

  • IDOR (Insecure Direct Object Reference): Changing ID in URL — /api/users/123 → /api/users/456
  • Forced browsing: Direct access to /admin without role check
  • Parameter tampering: Changing role in POST request — role=user → role=admin
  • Path traversal: Access to files outside allowed directory

Example of Vulnerable Code

// ❌ BAD — no ownership check
app.get('/api/orders/:id', async (req, res) => {
  const order = await Order.findById(req.params.id);
  res.json(order);
});

// ✅ GOOD — ownership check
app.get('/api/orders/:id', async (req, res) => {
  const order = await Order.findById(req.params.id);
  if (!order || order.userId !== req.user.id) {
    return res.status(403).json({ error: 'Forbidden' });
  }
  res.json(order);
});

Prevention

  • Deny by default — everything forbidden unless explicitly allowed
  • Authorization check on server, never just on client
  • Use RBAC or ABAC for permission management
  • Log all unauthorized access attempts
  • Automated authorization tests in CI/CD

Middleware pattern

const authorize = (allowedRoles) => { return (req, res, next) => { if (!req.user || !allowedRoles.includes(req.user.role)) { return res.status(403).json({ error: ‘Insufficient permissions’ }); } next(); }; }; app.delete(‘/api/users/:id’, authorize([‘admin’]), deleteUser);

Key Takeaway

Access control patří na server. Každý endpoint musí ověřit, zda aktuální uživatel má právo provést danou akci. Deny by default, logujte pokusy, testujte automaticky.

owaspsecurityaccess control
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.