Skip to content

Commit 6855c0f

Browse files
authored
Fix broken access control in Kiosk Manager API endpoints (#7693)
## What Changed <!-- Short summary - what and why (not how) --> Add AdminRoleAuthMiddleware to the /kiosks API route group to restrict access to admin users only. This fixes a broken access control vulnerability where any authenticated user could: - Allow kiosk registrations (/api/kiosks/allowRegistration) - Accept kiosk devices (/api/kiosks/{id}/acceptKiosk) - Reload kiosk devices (/api/kiosks/{id}/reloadKiosk) - Identify kiosk devices (/api/kiosks/{id}/identifyKiosk) - Set kiosk assignments (/api/kiosks/{id}/setAssignment) These operations are now properly restricted to administrators only. ## Type <!-- Check one --> - [ ] ✨ Feature - [ ] 🐛 Bug fix - [ ] ♻️ Refactor - [ ] 🏗️ Build/Infrastructure - [x] 🔒 Security ## Testing <!-- How to verify this works --> ## Screenshots <!-- Only for UI changes - drag & drop images here --> ## Security Check <!-- Only check if applicable --> - [ ] Introduces new input validation - [ ] Modifies authentication/authorization - [ ] Affects data privacy/GDPR ### Code Quality - [ ] Database: Propel ORM only, no raw SQL - [ ] No deprecated attributes (align, valign, nowrap, border, cellpadding, cellspacing, bgcolor) - [ ] Bootstrap CSS classes used - [ ] All CSS bundled via webpack ## Pre-Merge - [ ] Tested locally - [ ] No new warnings - [ ] Build passes - [ ] Backward compatible (or migration documented)
2 parents c1351b6 + 83bb6eb commit 6855c0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/api/routes/kiosks.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use ChurchCRM\dto\SystemConfig;
44
use ChurchCRM\model\ChurchCRM\KioskDeviceQuery;
5+
use ChurchCRM\Slim\Middleware\Request\Auth\AdminRoleAuthMiddleware;
56
use ChurchCRM\Slim\SlimUtils;
67
use ChurchCRM\Utils\LoggerUtils;
78
use Propel\Runtime\ActiveQuery\Criteria;
@@ -79,4 +80,4 @@
7980

8081
return SlimUtils::renderSuccessJSON($response);
8182
});
82-
});
83+
})->add(AdminRoleAuthMiddleware::class);

0 commit comments

Comments
 (0)