Uploaded image for project: 'WildFly Naming Client'
  1. WildFly Naming Client
  2. WFNC-23

WildFlyRootContext needs to initiate Service Loaders within privileged blocks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Beta12
    • 1.0.0.Beta11
    • None

      WildFlyRootContext's constructor initiates Service Loaders and this fails when Security Manager is enabled, see the stacktrace below.

      11:01:56,499 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /web/CallEjbServlet: java.security.AccessControlException: WFSM000001: Permission check failed (permission "("java.io.FilePermission" "/home/istudens/work/git/jboss-eap-upstream/dist/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules/system/layers/base/org/wildfly/naming-client/main/wildfly-naming-client-1.0.0.Beta11.jar" "read")" in code source "(vfs:/content/ejb.ear/web.war/WEB-INF/classes <no signer certificates>)" of "ModuleClassLoader for Module "deployment.ejb.ear.web.war" from Service Module Loader")
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:278)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkPermission(WildFlySecurityManager.java:175)
      	at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
      	at org.wildfly.security.manager.WildFlySecurityManager.checkRead(WildFlySecurityManager.java:350)
      	at java.util.zip.ZipFile.<init>(ZipFile.java:210)
      	at java.util.zip.ZipFile.<init>(ZipFile.java:149)
      	at java.util.jar.JarFile.<init>(JarFile.java:166)
      	at java.util.jar.JarFile.<init>(JarFile.java:103)
      	at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
      	at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
      	at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:84)
      	at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
      	at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
      	at java.net.URL.openStream(URL.java:1045)
      	at java.util.ServiceLoader.parse(ServiceLoader.java:304)
      	at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
      	at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
      	at java.util.ServiceLoader$LazyIterator.access$600(ServiceLoader.java:323)
      	at java.util.ServiceLoader$LazyIterator$1.run(ServiceLoader.java:396)
      	at java.util.ServiceLoader$LazyIterator$1.run(ServiceLoader.java:395)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:398)
      	at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
      	at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:459)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:130)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at org.jboss.as.test.integration.naming.remote.multiple.CallEjbServlet.doGet(CallEjbServlet.java:36)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      	at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:46)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
      	at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1706)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1706)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1706)
      	at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1706)
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1$1.run(ServletInitialHandler.java:110)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:107)
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:211)
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:809)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

              istudens@redhat.com Ivo Studensky
              istudens@redhat.com Ivo Studensky
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: