Skip to content

Check per-table read permission in lookup table tester - #26915

Open
dennisoelkers wants to merge 7 commits into
masterfrom
fix/lookup-table-tester-permission-check
Open

Check per-table read permission in lookup table tester#26915
dennisoelkers wants to merge 7 commits into
masterfrom
fix/lookup-table-tester-permission-check

Conversation

@dennisoelkers

@dennisoelkers dennisoelkers commented Aug 6, 2026

Copy link
Copy Markdown
Member

Note: This needs to be backported to previous, supported version.

Description

Motivation and Context

Prior to this PR, a user without read access to a specific lookup table could use the tester endpoint to extract data from it, due to a missing permissions check.

The lookup table tester endpoints (GET/POST /tools/lookup_table_tester) now resolve the requested lookup table and check lookuptables:read for its id before performing the lookup.

Previously the GET variant required no permission beyond authentication, and the POST variant only required the unscoped lookuptables:read permission. Since the instance-scoped check now covers both endpoints, the unscoped @RequiresPermissions annotation on POST was dropped, so users who only hold a grant for an individual table can use the tester for that table.

Table names which don't resolve to a loaded lookup table keep returning the existing "doesn't exist" response instead of failing the permission check, which cannot leak data: the lookup resolves the table through the same service and returns an error result when it isn't loaded.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

dennisoelkers and others added 7 commits August 6, 2026 15:08
The lookup table tester endpoints only required the generic
`lookuptables:read` permission (and the `GET` variant required no
permission at all beyond authentication). A user without read access to
a specific lookup table could therefore use the tester to extract data
from it.

Both endpoints now resolve the lookup table and check
`lookuptables:read` for its id before performing the lookup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers both the GET and the POST endpoint: a user is only allowed to run
the tester against a lookup table if they hold `lookuptables:read` for
that table's id. Neither an unscoped `lookuptables:read` nor a grant for
a different table is sufficient.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`LookupTableService#getTable` returns `null` for tables which aren't
loaded, so the new permission check threw a `NullPointerException` (500)
instead of the "doesn't exist" response for unknown table names.

Skipping the instance-scoped check in that case doesn't expose any data:
the lookup itself resolves the table through the same service and
returns an error result when it isn't loaded.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dennisoelkers
dennisoelkers requested review from bernd and thll August 11, 2026 12:41
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.

1 participant