Skip to content

fix(publicshareprovider): [OCISDEV-1383] enforce authz on public link type change - #796

Merged
LukasHirt merged 2 commits into
stable-8.0from
fix/ocisdev-1383-public-link-type-change-authz-stable-8.0
Nov 12, 2026
Merged

LukasHirt merged 2 commits into
stable-8.0from
fix/ocisdev-1383-public-link-type-change-authz-stable-8.0

Conversation

@LukasHirt

Copy link
Copy Markdown

Backport of #794 to stable-8.0.

Summary

Changing a share link's type is now subject to the same authorization checks as
creating a link. Raising an internal link to a public link now requires the user
to be permitted to create public links and to reshare the resource.

Previously UpdatePublicShare did not re-apply the public-link authorization
checks on a link type change and exempted the link creator from them, so an
internal link could be turned into a public link even when the user had no
resharing permission on the resource.

Changes

  • UpdatePublicShare: on an internal → public (non-internal) type change, apply
    the WritePublicLink and resharing (AddGrant) checks, without exempting the
    share creator.
  • Added unit tests covering the denied and allowed promotion paths.

Note on this backport

stable-8.0 has no enable_public_sharing toggle (it was introduced later), so the
public-sharing-enabled gate that is part of the fix on main/stable-9.0 is
omitted here; the resharing-authority enforcement applies as above.

Tests

  • go test ./internal/grpc/services/publicshareprovider/ passes.

@LukasHirt LukasHirt self-assigned this Nov 5, 2026
… type change

Promoting an internal link (empty permissions) to a non-internal public
link is equivalent to creating a public link, but UpdatePublicShare did
not re-apply the public-link authorization checks and exempted the link
creator from them. Apply the same checks as CreatePublicShare on an
internal-to-public type change (public-sharing enabled, write-public-link
permission, resharing permission), without exempting the creator.

Signed-off-by: Lukas Hirt <[email protected]>
@LukasHirt
LukasHirt force-pushed the fix/ocisdev-1383-public-link-type-change-authz-stable-8.0 branch from 9809ce0 to 1a1911f Compare November 5, 2026 09:57
@kw-security

kw-security commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

…he permission gRPC call

Signed-off-by: Lukas Hirt <[email protected]>
(cherry picked from commit 57b34aa)
Signed-off-by: Lukas Hirt <[email protected]>
@LukasHirt

Copy link
Copy Markdown
Author

PR to main merged.

@LukasHirt
LukasHirt requested a review from a team November 10, 2026 11:49
@LukasHirt
LukasHirt merged commit 8577f4a into stable-8.0 Nov 12, 2026
@LukasHirt
LukasHirt deleted the fix/ocisdev-1383-public-link-type-change-authz-stable-8.0 branch November 12, 2026 09:11
LukasHirt added a commit to owncloud/ocis that referenced this pull request Nov 12, 2026
…when updating links

The reva fix (owncloud/reva#796) comes in with the reva re-pin in #13446.

Signed-off-by: Lukas Hirt <[email protected]>
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 16, 2026
…e manager

Bump reva to v2.0.0-20261112224757-ebbb52833e5f, the head of
owncloud/reva#813.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed.

The new reva:
- removes stale group shares from the group cache, only when it read the
  share file of the space
- does not upload a file when a Remove changes nothing
- writes a share before the grantee entry, and rolls back after a failure
- removes the share in an unshare also when the grantee entry fails
- removes many shares with one upload for each document
- logs the share cleanup errors after a space delete

The bump also brings owncloud/reva#796 into
stable-8.0. The previous reva pin did not have it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 16, 2026
…e manager

Bump reva to v2.0.0-20261112224757-ebbb52833e5f, the head of
owncloud/reva#813.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed.

The new reva:
- removes stale group shares from the group cache, only when it read the
  share file of the space
- does not upload a file when a Remove changes nothing
- writes a share before the grantee entry, and rolls back after a failure
- removes the share in an unshare also when the grantee entry fails
- removes many shares with one upload for each document
- logs the share cleanup errors after a space delete

The bump also brings owncloud/reva#796 into
stable-8.0. The previous reva pin did not have it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
2403905 added a commit to owncloud/ocis that referenced this pull request Nov 17, 2026
…e manager

Bump reva to v2.0.0-20261112224757-ebbb52833e5f, the head of
owncloud/reva#813.

A stale group share is a share ID in the group cache that has no share. On
each listing of the received shares, the jsoncs3 share manager uploaded the
received.json file of the user again with the same content, and the stale ID
stayed.

The new reva:
- removes stale group shares from the group cache, only when it read the
  share file of the space
- does not upload a file when a Remove changes nothing
- writes a share before the grantee entry, and rolls back after a failure
- removes the share in an unshare also when the grantee entry fails
- removes many shares with one upload for each document
- logs the share cleanup errors after a space delete

The bump also brings owncloud/reva#796 into
stable-8.0. The previous reva pin did not have it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Roman Perekhod <[email protected]>
LukasHirt added a commit to owncloud/ocis that referenced this pull request Nov 18, 2026
…when updating links

The reva fix (owncloud/reva#796) comes in with the reva re-pin in #13446.

Signed-off-by: Lukas Hirt <[email protected]>
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.

4 participants