Skip to content

Scope mothership updateSoftwareRelease to the caller's container#7763

Merged
labkey-martyp merged 2 commits into
release25.7-SNAPSHOTfrom
25.7_fb_mothership_release_container
Jun 18, 2026
Merged

Scope mothership updateSoftwareRelease to the caller's container#7763
labkey-martyp merged 2 commits into
release25.7-SNAPSHOTfrom
25.7_fb_mothership_release_container

Conversation

@labkey-martyp

Copy link
Copy Markdown
Contributor

Rationale

MothershipManager.updateSoftwareRelease performed a raw Table.update keyed only on the SoftwareRelease primary key, with no container filter, and reassigned the row's container to the caller's folder. Because the update form binds softwareReleaseId directly from the request and UpdateAction only checks UpdatePermission against the current folder, a user with update rights in one folder could edit — and re-home into their own folder — a SoftwareRelease owned by another folder. This scopes the update to the caller's container so only rows that already belong to that folder can be modified.

Related Pull Requests

  • None

Changes

  • Add a container-scoped MothershipManager.getSoftwareRelease(int, Container) lookup, mirroring the existing getExceptionStackTrace/getServerInstallation helpers.
  • Verify the target SoftwareRelease belongs to the caller's container in updateSoftwareRelease before updating; throw NotFoundException otherwise.
  • Fix an incidental NPE in BulkUpdateAction where updateExceptionStackTrace was invoked even when the container-scoped lookup returned null; the call now happens only inside the null check.

MothershipManager.updateSoftwareRelease did a raw Table.update keyed only on the primary key with no container filter, and set the bean's container to the caller's folder. A user with UpdatePermission in one folder could therefore edit and re-home a SoftwareRelease owned by another folder via an attacker-supplied softwareReleaseId on the bean-bound update form. This adds a container-scoped getSoftwareRelease lookup and verifies the target row belongs to the caller's container before updating, throwing NotFoundException otherwise.

Also fix an incidental NPE in BulkUpdateAction where updateExceptionStackTrace was called even when the container-scoped lookup returned null; the call now happens only inside the null check.
@labkey-martyp

Copy link
Copy Markdown
Contributor Author

@josheckels This is a low risk issue. The ROI on an integration test setting up multiple containers seems too low.

@labkey-martyp labkey-martyp merged commit d2667da into release25.7-SNAPSHOT Jun 18, 2026
10 checks passed
@labkey-martyp labkey-martyp deleted the 25.7_fb_mothership_release_container branch June 18, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants