Skip to content

Authorization bypass: @RolesAllowed unenforced on file-service (DatasetResource) #5433

Closed

Description

@Ma77Ball

What happened?

Follow-up to #4904 (now closed). That issue tracked @RolesAllowed annotations being unenforced across the microservices because they never registered Jersey's RolesAllowedDynamicFeature. Most services were since wired up (#5049 / #5199), and access-control-service is being addressed in #5421, but file-service was missed.

file-service registers JwtAuthFilter and the AuthValueFactoryProvider.Binder, but not RolesAllowedDynamicFeature. As a result, every @RolesAllowed annotation on DatasetResource is decorative: a request that authenticates with any valid JWT reaches the resource method regardless of the user's role.

DatasetResource carries ~20 @RolesAllowed(Array("REGULAR", "ADMIN")) annotations, e.g.:

  • file-service/.../resource/DatasetResource.scala:258: @POST /api/dataset/create
  • file-service/.../resource/DatasetResource.scala:345: @POST /api/dataset/{did}/version/create
  • file-service/.../resource/DatasetResource.scala:435: @DELETE /api/dataset/{did}

None of these role checks actually run today.

Expected: a JWT whose role is below REGULAR/ADMIN should be rejected with 403 on these endpoints. Actual: the request succeeds; the role check is silently skipped.

How to reproduce?

  1. Issue a JWT for a user whose role is below REGULAR (e.g. RESTRICTED or INACTIVE).
  2. curl -X POST -H "Authorization: Bearer <that-token>" -H "Content-Type: application/json" http://localhost:<file-service-port>/api/dataset/create -d '{...}'
  3. Observe: the request reaches createDataset and is processed; the @RolesAllowed(Array("REGULAR", "ADMIN")) check is not applied. (With RolesAllowedDynamicFeature registered, the same request returns 403.)

Version/Branch

1.3.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

5c2eaa2

Activity

  1. added theissue type on Jun 7, 2026
  2. added a commit that references this issue on Jun 9, 2026
    7dc17c0
  3. added a commit that references this issue on Jun 9, 2026
    7b7a5c6
  4. added a commit that references this issue on Jun 16, 2026
    39a9298
  5. added a commit that references this issue on Jun 22, 2026
    9b651b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions