Skip to content

Authorization bypass: @RolesAllowed unenforced on microservices, workflow-compiling-service requires no token at all #4904

Description

@Yicong-Huang

What happened?

@RolesAllowed annotations on microservice resources are not enforced because none of the microservices register Jersey's RolesAllowedDynamicFeature. The annotations are decorative — anyone with a valid JWT can hit endpoints labeled @RolesAllowed(Array("ADMIN")), regardless of the user's role.

workflow-compiling-service is worse: it registers neither JwtAuthFilter nor RolesAllowedDynamicFeature, so its @RolesAllowed endpoint runs without any authentication or authorization at all.

amber correctly registers RolesAllowedDynamicFeature (amber/.../web/TexeraWebApplication.scala:142 and amber/.../web/ComputingUnitMaster.scala:172), so its annotations work as intended.

Service JwtAuthFilter RolesAllowedDynamicFeature uses @RolesAllowed?
access-control-service yes no no
config-service yes no yes (2 places)
file-service yes no no
computing-unit-managing-service yes no yes (10+ places)
workflow-compiling-service no no yes (1 place)
amber (TexeraWebApplication, ComputingUnitMaster) yes yes yes

Concrete decorative annotations:

  • config-service/.../resource/ConfigResource.scala:32, 66 — @RolesAllowed(Array("REGULAR", "ADMIN"))
  • computing-unit-managing-service/.../resource/ComputingUnitManagingResource.scala:252, 262, 276, 491, 594, 642, 682, 736, 751 — @RolesAllowed(Array("REGULAR", "ADMIN"))
  • computing-unit-managing-service/.../resource/ComputingUnitAccessResource.scala:104 — same
  • workflow-compiling-service/.../resource/WorkflowCompilationResource.scala:59 — same (and the request is unauthenticated to begin with)

How to reproduce?

  1. Issue a JWT for a user whose role is below the one a @RolesAllowed annotation requires (e.g. role INACTIVE against @RolesAllowed(Array("REGULAR", "ADMIN"))).
  2. curl -H "Authorization: Bearer <that-token>" http://localhost:<port>/api/<annotated-endpoint> against config-service or computing-unit-managing-service.
  3. Observe: the request succeeds with 200. The role check is silently skipped.
  4. For workflow-compiling-service, omit the token entirely: any request reaches the resource method. No JwtAuthFilter runs because the service never registers it.

Branch

main

Commit Hash (Optional)

786a920

Activity

  1. changed the title [-]Microservices do not enforce @RolesAllowed; workflow-compiling-service has no auth filter at all[/-] [+]Authorization bypass: @RolesAllowed unenforced on microservices, workflow-compiling-service requires no token at all[/+] on May 4, 2026
  2. added theissue type on May 4, 2026
  3. Yicong-Huang commented on May 4, 2026

    @Yicong-Huang
    ContributorAuthor

    @chenlica please check this issue.

  4. Ma77Ball commented on May 13, 2026

    @Ma77Ball
    Contributor

    /take

  5. added a commit that references this issue on May 23, 2026
    d1cf4eb
  6. Yicong-Huang commented on May 24, 2026

    @Yicong-Huang
    ContributorAuthor

    @Ma77Ball please make sure to reopen the issue when revert lands.

  7. added a commit that references this issue on Jun 1, 2026
    2ebef32
  8. Yicong-Huang commented on Jun 7, 2026

    @Yicong-Huang
    ContributorAuthor

    still have more work to do

  9. added a commit that references this issue on Jun 9, 2026
  10. added a commit that references this issue on Jun 9, 2026
  11. added a commit that references this issue on Jun 16, 2026
  12. added 3 commits that reference this issue on Jun 22, 2026
    1d4cf7b
    c27a055
    9b651b7
  13. Yicong-Huang commented on Jul 5, 2026

    @Yicong-Huang
    ContributorAuthor

    Fixed. Enforcement re-landed in #5199 (all five microservices now register JwtAuthFilter + RolesAllowedDynamicFeature via the shared AuthFeatures.register), file-service was covered in #5198, and #5743 added RoleAnnotationEnforcer, which fails service startup if any HTTP resource method lacks @RolesAllowed/@PermitAll/@DenyAll — so annotations can no longer silently be decorative. workflow-compiling-service now requires a JWT as well. Follow-up (out of scope here): notebook-migration-service registers the auth stack but doesn't run RoleAnnotationEnforcer yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions