Missing Function Level Access Control

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.html

views.py

dashboard.html

Weak Points: Access Control - Missing Function Level Access Control

  1. User Dashboard Access Control:

    • The user_dashboard view 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.

  2. User Home Page:

    • The user_home view 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.

  3. User Logout:

    • The user_logout function 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

  1. Identify Vulnerable Views: Review the codebase for views that use @login_required without additional role checks.

  2. Log in as a Regular User: Create a regular user account and log in to the application.

  3. Access the Dashboard: Attempt to access the dashboard URL with the query parameter ?admin=True:

  4. 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

  1. Facebook

  2. Edx.

  3. Educational Websites

  4. Forums

Last updated