Skip to content
Web Design & Development

How to Get Access Control and Authorization Right

Making sure each user can only see and do what they are allowed to, such as viewing their own orders but not someone else's.

MediaScaleUp Editorial Team 2 min read 11 views
How to Get Access Control and Authorization Right

The key figures

OWASP Top 10 2021
broken access control ranked first
Common flaw
changing an ID in a URL to view another user's record
Principle
deny by default and check permissions on the server for every request
Framework tools
policies and gates in Laravel

Why this is worth getting right

Broken access control is the top risk in the OWASP Top 10, and a single missing check can expose every customer's data.

Do this, not that

Do

  • Check authorization on every request, not only in the interface
  • Deny access by default
  • Centralize permission logic in policies
  • Test with accounts of different roles
  • Log access control failures

Don’t

  • Hiding buttons as the only protection
  • Trusting IDs sent by the browser
  • Admin areas protected only by obscure URLs
  • Copy-pasted permission checks that drift apart

When to bring in help

Our advice Bring in help when building multi-user or multi-tenant applications, or after an access control finding.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

MediaScaleUp Editorial Team

Articles here are researched, written and checked by the MediaScaleUp studio team before they are published, and dated when they are reviewed.

Keep reading

More in Web Design & Development