Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-8423

Error 500 is generated when basic authentication is failing because of bad header

    Details

      Description

      When the basic header contains invalid data, the following stacktrace error is generated :

      2016.11.22 20:27:03 ERROR web[][o.s.s.p.w.RootFilter] Processing of request /api/events/index?id=pl.kubiczak.felix.shark%3Asamples failed
      java.lang.IllegalArgumentException: Illegal base64 character 20
              at java.util.Base64$Decoder.decode0(Base64.java:714) ~[na:1.8.0_111]
              at java.util.Base64$Decoder.decode(Base64.java:526) ~[na:1.8.0_111]
              at org.sonar.server.authentication.BasicAuthenticator.getCredentials(BasicAuthenticator.java:68) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.authentication.BasicAuthenticator.authenticate(BasicAuthenticator.java:60) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.authentication.UserSessionInitializer.authenticate(UserSessionInitializer.java:130) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.authentication.UserSessionInitializer.setUserSession(UserSessionInitializer.java:106) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.authentication.UserSessionInitializer.initUserSession(UserSessionInitializer.java:93) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.user.UserSessionFilter.doFilter(UserSessionFilter.java:59) ~[sonar-server-6.1.1.jar:na]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.sonar.server.platform.web.RoutesFilter.doFilter(RoutesFilter.java:55) ~[sonar-server-6.1.1.jar:na]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:113) ~[sonar-server-6.1.1.jar:na]
              at org.sonar.server.platform.web.RootFilter.doFilter(RootFilter.java:81) ~[sonar-server-6.1.1.jar:na]
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:191) [logback-access-1.1.3.jar:na]
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_111]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_111]
              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.32.jar:8.0.32]
              at java.lang.Thread.run(Thread.java:745) [na:1.8.0_111]
      

      This bug exists in 6.2-RC1.

        Attachments

          Activity

            People

            • Assignee:
              julien.lancelot Julien Lancelot
              Reporter:
              julien.lancelot Julien Lancelot
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: