Skip to content

Fix: enforce authorization in template field endpoints#5875

Merged
elzody merged 1 commit into
mainfrom
fix/fieldsendpoint
Jul 24, 2026
Merged

Fix: enforce authorization in template field endpoints#5875
elzody merged 1 commit into
mainfrom
fix/fieldsendpoint

Conversation

@rikled

@rikled rikled commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: Claude Code:Opus 4.8

  • Target version: main

Summary

extractFields and fillFields resolved a global fileId via rootFolder->getFirstNodeById(), which searches across all users' storage. Any authenticated user could pass an arbitrary id to read another user's file contents or fill/overwrite it.
Changes:

  • Resolve the id within the acting user's folder (getUserFolder()->getFirstNodeById()) so only accessible nodes (including valid shares) are returned, with a baseline READ check.
  • Require PERMISSION_UPDATE before filling a PDF, since that overwrites the source in place.

Because resolution is now user-scoped, getPermissions() reflects the caller's share-level rights, making the permission check meaningful.

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@rikled
rikled marked this pull request as ready for review July 17, 2026 19:18
@elzody
elzody force-pushed the fix/fieldsendpoint branch 2 times, most recently from 494b848 to ec39d2f Compare July 22, 2026 21:16
Signed-off-by: Hendrik Leidinger <[email protected]>
Assisted-by: Claude Code:Opus 4.8
@elzody
elzody force-pushed the fix/fieldsendpoint branch from 6af86fc to f7c9786 Compare July 24, 2026 17:38
@elzody

elzody commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable34

@elzody

elzody commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable33

@elzody

elzody commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable32

@elzody

elzody commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable31

@elzody

elzody commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

/backport to stable30

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