Skip to content

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

Merged
LukasHirt merged 2 commits into
mainfrom
fix/ocisdev-1383-public-link-type-change-authz
Nov 9, 2026
Merged

LukasHirt merged 2 commits into
mainfrom
fix/ocisdev-1383-public-link-type-change-authz

Conversation

@LukasHirt

Copy link
Copy Markdown

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 is only permitted when
public sharing is enabled and the user is allowed 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 in configurations where creating
one directly is not permitted.

Changes

  • UpdatePublicShare: on an internal → public (non-internal) type change, apply
    the same gates as CreatePublicShare — public sharing enabled, WritePublicLink
    permission, and resharing (AddGrant) permission — without exempting the share
    creator.
  • Added unit tests covering the denied and allowed promotion paths.

Tests

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

@LukasHirt
LukasHirt requested a review from a team as a code owner November 5, 2026 09:52
@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 branch from 0f21b05 to f0b74c2 Compare November 5, 2026 09:53
@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.

@LukasHirt
LukasHirt requested a review from jvillafanez November 9, 2026 09:45
@LukasHirt
LukasHirt merged commit bcf9a0c into main Nov 9, 2026
@LukasHirt
LukasHirt deleted the fix/ocisdev-1383-public-link-type-change-authz branch November 9, 2026 10:28
LukasHirt added a commit to owncloud/ocis that referenced this pull request Nov 12, 2026
…when updating links

The reva fix (owncloud/reva#794) is already vendored on master through an earlier reva bump.

Signed-off-by: Lukas Hirt <[email protected]>
LukasHirt added a commit to owncloud/ocis that referenced this pull request Nov 12, 2026
…when updating links (#13441)

The reva fix (owncloud/reva#794) is already vendored on master through an earlier reva bump.

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.

3 participants