Over the years, Pentest has conducted hundreds, if not thousands, of assessments on web applications and APIs, helping organisations ensure their online presence is as secure as possible. During this time, we have observed many recurring issues, recently, however, we have noticed an increase in Access Control issues making their way into clients’ reports.
To raise awareness about these issues, I have put together an overview of Access Controls, the risks they pose, and the potential consequences if these vulnerabilities are exploited.
What Are Access Controls?
Access Controls are essential components of web services and applications and are used by organisations to define who has access to specific resources and functionalities. This process is often referred to as session management.
Session management involves allocating a unique identifier, known as a session token, to each user. Applications typically issue session tokens automatically without requiring user interaction. It is normal for a user to receive a token upon their first interaction with the application and subsequently acquire a new token after authentication.
As users request data, process information, and utilise functionalities, access control checks are conducted to verify that the user has permission to perform these actions. Permissions are typically assigned on an individual basis by the administrative team. In cases of self-registration, users are automatically assigned the lowest level of permissions until their access is adjusted by the administration team.
Users can be assigned permissions in several ways, the most common being:
- Granular Access: Specifying exactly what actions a user is permitted to perform.
- Role-Based Access: Grouping users into categories such as Reader, User, or Administrator.
If a user requests an action they are not authorised to perform, they should receive an error message indicating that access is forbidden, the 403 HTTP status code is designed for this purpose. However, if proper access control checks are not implemented, users might gain access to resources or perform actions that they should not be authorised to. This leads to potential vulnerabilities.
These vulnerabilities are classified as “Broken Access Controls” and can severely impact the confidentiality, integrity, and availability of the application and its users.
Broken Access Controls – A Growing Risk
As previously mentioned, there has been an uptick in Broken Access Control issues in the web applications we have tested over the last few years. This challenge has also been acknowledged by the Open Web Application Security Project (OWASP) in their OWASP Top 10 list.
For those unfamiliar, the OWASP Top 10 represents a “broad consensus regarding the most critical security risks facing web applications” and serves as an essential reference for developers, as well as being integral to any penetration testing methodology.
To compile the OWASP Top 10 rankings, OWASP maps Common Weakness Enumerations (CWEs) to each risk category. These CWEs detail the vulnerabilities and weaknesses that can be exploited, guiding people in identifying, mitigating, and preventing these issues.
In the latest edition of the OWASP Top 10 published in 2021, Broken Access Controls were identified as the most critical security issue for web applications, with 34 CWEs mapped to it. This marked an increase from its previous ranking of fifth place in the 2017 review. This rise in ranking underscores the growing severity and critical nature of Broken Access Control issues.
Impact of Broken Access Controls
Throughout our testing experience, the following impacts have been regularly identified due to Broken Access Controls. Note: these examples have been created specifically for demonstration purposes.
Privilege Escalation
Privilege escalation is the process of gaining unauthorised access to another user’s content permanently by abusing application controls.
Privilege escalation can occur in two manners:
- Horizontal – User to User, whereby it could be possible to compromise other user accounts/tenants. This would impact the confidentiality and integrity of their data.
- Vertical – User to Administrator, allowing the threat actor to control the application, data it processes, and user accounts amongst other operations.
The following example shows the steps taken to move from a low-level tenant specific user to an administrator, designed for internal use only, allowing access data from all tenants.
1. Authenticate into the application as a User.
2. Navigate to the Profile section of the application