Uploaded image for project: 'OpenAM Agents'
  1. OpenAM Agents
  2. AMAGENTS-2389

IllegalArgumentException: Header:Location Cannot contain CRLF Charcters on weblogic

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6.0.0
    • Fix Version/s: 5.6.0.0
    • Component/s: J2EE Agents
    • Environment:
      Weblogic 12.2.1.3
      6.0.0-SNAPSHOT / Build Date: 2019-Jan-05 02:51:46

      Description

      Bug description

      Java Agent 6 on weblogic suffers with exception

      Header:Location Cannot contain CRLF Charcter

      This exceptions happens when policy evaluation with environment condition is performed and excepted result is deny. This is a regression compare to agent 5.5.0 or 5.5.1.

      How to reproduce the issue

      1. Create a policy with environment condition:
        • Active Session Time
        • maxSessionTime: 1
        • terminateSession: false
      2. Access protected page, e.g http://java.agent.example.com:7001/app/index.jsp
      3. Login with user and you will see agent's protected page
      4. Wait 1 min and hit the page again
      Expected behaviour
      after one minute you will not have permission to the page and you will be redirected to login
      
      Current behaviour
      500 Internal Server error
      

       

      Weblogic produce the exception:

      ####<Jan 11, 2019 7:39:11,559 AM GMT> <Error> <HTTP> <riso-win16> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <a96889fd-90b1-44c2-b851-ed1bfcaea8c5-00000014> <1547192351559> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-101017> <[ServletContext@1662616438[app:frqa module:frqa.war path:null spec-version:3.1], request: weblogic.servlet.internal.ServletRequestImpl@12890f4d[
      GET /frqa/index.jsp HTTP/1.1
      Connection: keep-alive
      Cache-Control: max-age=0
      Upgrade-Insecure-Requests: 1
      User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/71.0.3578.98 Chrome/71.0.3578.98 Safari/537.36
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
      Referer: http://riso-ubuntu14.test.forgerock.com:8080/am/oauth2/authorize?scope=openid&response_type=id_token&redirect_uri=http%3A%2F%2Friso-win16.test.forgerock.com%3A7001%2Ffrqa%2FsunwCDSSORedirectURI&nonce=sf3d27a8555b2dc3e74ab5c4faf103fc8c007c4b7&client_id=win16&agent_realm=%2F&response_mode=form_post
      Accept-Encoding: gzip, deflate
      Accept-Language: en-US,en;q=0.9
      
      ]] Root cause of ServletException.
      java.lang.IllegalArgumentException: Header:Location Cannot contain CRLF Charcters
          at weblogic.servlet.internal.ServletResponseImpl.checkForCRLFChars(ServletResponseImpl.java:1919)
          at weblogic.servlet.internal.ServletResponseImpl.setHeader(ServletResponseImpl.java:1087)
          at weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:1020)
          at weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:974)
          at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:104)
          at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
          at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
          at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
          at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
          at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
          at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
          at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
          at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
          at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
          at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
          at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
          at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
          at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
          at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
          at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
          at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
          at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
      >
      ####<Jan 11, 2019 7:39:55,309 AM GMT> <Info> <Health> <riso-win16> <AdminServer> <weblogic.GCMonitor> <<anonymous>> <> <a96889fd-90b1-44c2-b851-ed1bfcaea8c5-00000010> <1547192395309> <[severity-value: 64] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-310002> <78% of the total memory in the server is free.>

       

        Attachments

          Activity

            People

            • Assignee:
              tony.bamford Tony Bamford
              Reporter:
              richard.hruza Richard Hruza
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: