Missing Function Level Access Control
This vulnerability is largely due to a flawed assumption or misconfigured access control lists. In the first case, applications will commonly modify the user interface to remove or hide elements that a user does not have access to. However, a dangerous assumption that is often made is that because a user will not have access to UI elements or links, they will not be able to invoke the hidden application functionality. However, predictable identifiers and standard naming conventions can make guessing or enumerating hidden web pages or links quite easy. If no server-side access checks are performed, an attacker can simply access these pages and potentially gain access to privileged functionality. In the second case, access control lists on the server may be misconfigured and result in a mismatch with client-side UI restrictions. This may allow functionality that is disallowed by the UI to be invoked on the server.
Website Tree Structure
Here’s the structured representation of your website's code tree:
Website/
│
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.py
│
└── Exams/
├── __init__.py
├── apps.py
├── models.py
├── urls.py
├── views.py
└── Templates/
└── exams/
├── dashboard.html
├── home.html
└── login.htmlviews.py
dashboard.html
Weak Points: Access Control - Missing Function Level Access Control
User Dashboard Access Control:
The
user_dashboardview allows any logged-in user to access it. The logic that checks for the "admin" parameter does not enforce any role checks, which could expose admin functionalities to regular users. This means that if a regular user manipulates the URL to include?admin=True, they could potentially see admin-related content.
User Home Page:
The
user_homeview is accessible to any logged-in user, but it does not check if the user has the appropriate permissions to view certain content. If sensitive information is displayed here, it could be exposed to unauthorized users.
User Logout:
The
user_logoutfunction does not verify the user's role before allowing them to log out. This could lead to situations where a user could log out another user if they have access to the session.
Steps to Reproduce the Attack Vector
Identify Vulnerable Views: Review the codebase for views that use
@login_requiredwithout additional role checks.Log in as a Regular User: Create a regular user account and log in to the application.
Access the Dashboard: Attempt to access the dashboard URL with the query parameter
?admin=True:Observe the Response: If the application allows access to admin-related content without proper authorization checks, it confirms the presence of a missing function level access control vulnerability.
Real-Life Examples of Similar Vulnerabilities
Facebook
Edx.
Educational Websites
Forums
Last updated