Broken Access Control/Privilege Escalation
Description
Broken Access Control occurs when an application fails to enforce proper access restrictions, allowing unauthorized users to access or modify resources they shouldn't have access to. Privilege Escalation involves exploiting such weaknesses to gain higher-level access.
Example with Scenario
Scenario: A web application has an admin panel that should be accessible only to administrators. An attacker discovers that they can access the admin panel by directly navigating to the URL without proper authorization checks.
Payloads and Test Cases
Payloads
Direct URL Access:
Parameter Manipulation:
Forced Browsing:
Test Cases
Direct URL Access:
Payload:
Test Case:
Parameter Manipulation:
Payload:
Test Case:
Forced Browsing:
Payload:
Test Case:
Mitigation
Enforce Access Control:
Implement access control checks at the server-side for all sensitive actions.
Use role-based access control to enforce permissions.
Use Secure Frameworks:
Use security frameworks that provide built-in access control mechanisms.
Ensure access control is consistently applied throughout the application.
Parameter Validation:
Validate and sanitize parameters to ensure they cannot be manipulated to escalate privileges.
Use strong validation rules to prevent unauthorized access.
Regular Audits:
Conduct regular security audits and penetration testing to identify and fix access control vulnerabilities.
Monitor access logs for suspicious activity.
Last updated