Most business applications have a login screen, and most owners take comfort from it. A username and password stand between the public and the customer records, so the records feel protected. The login screen does one job, though. It establishes who is at the door. What that person can open once inside is a separate matter, and it’s where applications often fall short.
Two different checks
Authentication is the process of proving who you are. Typing a password, or entering a one-time code sent to your phone, is authentication.
Authorisation is the decision about what you may see and do once the application knows who you are. This is also called access control. A customer should see their own invoices. A branch manager should see their own branch. An administrator may add and remove users.
An application can do the first check well and the second one badly. When that happens, every person with a valid login, including a customer who signed up five minutes ago, may be able to reach far more than you intended.
Hiding a button doesn’t remove the function
A common shortcut is to control access through the screen. Ordinary users don’t see the “Delete user” button, so the assumption is that they can’t delete users.
The screen is only the part of the application that runs in the user’s browser or phone. The real work happens on the server, the computer that stores the data and carries out requests. Anyone who is logged in can send a request to the server directly, without using your buttons. If the server doesn’t check whether this particular user is allowed to make this particular request, the hidden button protects nothing.
The server must check permission on every request, every time, regardless of what the screen shows.
Where the gaps usually are
Three patterns are worth knowing about.
- Other people’s records. A customer views their invoice at an address ending in
invoice/1042. They change the number to 1043 and see another customer’s invoice. The application checked that they were logged in, but never checked that the invoice was theirs. - Admin functions open to ordinary users. The administration pages are left out of the menu, but an ordinary user who knows or guesses the address can still load them.
- Forgotten API endpoints. An API is the set of addresses your website or mobile app uses to talk to the server, and an endpoint is one of those addresses. Older endpoints, built for a previous version of the app, often stay switched on with weaker checks or none at all.
If the application holds personal information about customers or staff, a gap like this is also relevant to how you handle that information under POPIA, South Africa’s Protection of Personal Information Act.
What to ask your developers
You don’t need to read code to ask useful questions. These are a reasonable start:
- Where are permissions checked, in the interface or on the server?
- If a logged-in user changes a record number in a request, what stops them from seeing someone else’s record?
- Is there a written list of user roles and what each role may do?
- Are there automated tests that try to do things a user shouldn’t be allowed to do, and confirm they are refused?
- Which API endpoints exist, and which of them are still in use?
- When a staff member changes role or leaves, how quickly does their access change?
Vague answers (“a user wouldn’t know to do that”) are worth following up, because an application’s safety shouldn’t depend on users lacking curiosity.
An independent assessment can test these points within an agreed scope, by using ordinary accounts to attempt what they shouldn’t be able to do and recording what the server allows.