IDOR in admin panel access control
This lab demonstrates an IDOR vulnerability in an admin panel system. The application allows users to access admin functions by simply changing the action parameter without proper authorization checks, even though they are not admin users.
Objective: Access admin panel functions by manipulating the action parameter to view sensitive administrative data.
// Vulnerable: No proper authorization check
$action = $_GET['action'] ?? 'dashboard';
// Simulate user authentication
$_SESSION['user_id'] = 1;
$_SESSION['role'] = 'user'; // Regular user, not admin
// Direct access to admin functions without checking role
switch ($action) {
case 'dashboard':
// Load admin dashboard
break;
case 'users':
// Load user management
break;
case 'settings':
// Load system settings
break;
case 'logs':
// Load system logs
break;
}
// Example vulnerable usage:
// ?action=dashboard (admin dashboard)
// ?action=users (user management)
// ?action=settings (system settings)
// ?action=logs (system logs)
Site name: KrazePlanetLabs
Maintenance mode:
Max users: 1000
Session timeout: 30
Backup frequency: daily
Security level: high
actionTry these action values:
dashboard - Admin dashboardusers - User managementsettings - System settingslogs - System logsExample URLs:
3.php?action=dashboard3.php?action=users3.php?action=settings3.php?action=logsClick these links to test the vulnerability: