Uploaded image for project: 'Geronimo'
  1. Geronimo
  2. GERONIMO-646

Servlet calling HttpServletRequest.isUserInRole(null) causes NPE using Jetty container

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-M4
    • 1.2, 2.0-M1
    • web
    • None
    • All

    Description

      The servlet isUserInRole call eventually gets delegated to
      org.apache.geronimo.jetty.JAASJettyRealm.isUserInRole, which causes a NPE in
      javax.security.jacc.WebRoleRefPermission.hashCode().

      JAASJettyRealm.isUserInRole creates a WebRoleRefPermission, passing it the
      null role that it was passed, then delegates the role check to
      java.security.AccessControlContext.checkPermission, passing it the WebRoleRefPermission.
      When the web role ref permission gets checked, eventually its hashcode method is called,
      which tries to compute the hash by getting the hashcode of the (null) role name,
      which throws the NPE.

      Attachments

        1. WebRoleRefPermissionTest-patch.txt
          0.9 kB
          Tom McQueeney
        2. WebRoleRefPermission-patch.txt
          2 kB
          Tom McQueeney
        3. JAASJettyRealm-patch.txt
          0.8 kB
          Tom McQueeney

        Activity

          People

            maguro Alan Cabrera
            mcqueeney Tom McQueeney
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: