Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetty-12 SecurityHandler role checking with * not correct #9745

Closed
janbartel opened this issue May 6, 2023 · 1 comment
Closed

jetty-12 SecurityHandler role checking with * not correct #9745

janbartel opened this issue May 6, 2023 · 1 comment
Assignees
Labels
Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)

Comments

@janbartel
Copy link
Contributor

jetty-12 ee10 (TODO: check ee9)

SecurityHandler.isNotAuthorized doesn't correctly interpret the following security constraint as permitting access to a user who has been authenticated and is known to be in at least one role:

   <security-constraint>
    <web-resource-collection>
      <web-resource-name>MySecureBit6</web-resource-name>
      <url-pattern>/allRolesTest</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>Administrator</role-name>
      <role-name>*</role-name>
    </auth-constraint>
    <user-data-constraint>
      <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

The user in question has the following roles: VP, Manager.

There is a role-mapping for VP -> VP.

The user is correctly authenticated, however according to the spec, if a constraint has a mix of specific roles and *, then * wins and the user can be in any role.

TCK test in question: *com/sun/ts/tests/servlet/spec/security/secform/Client.java.test11 *

@janbartel janbartel added Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc) labels May 6, 2023
@janbartel janbartel assigned gregw and janbartel and unassigned gregw May 6, 2023
@janbartel
Copy link
Contributor Author

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side TCK For various Specification Test Compatibility Kits (eg: Servlet, WebSocket, HTTP/2, etc)
Projects
None yet
Development

No branches or pull requests

2 participants