Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-73212

Submitting an issue collector on a non-same origin site results in HTTP 404

      Issue Summary

      XSRF checks were added to the endpoint /rest/collectors/1.0/template/custom as part of the fix for JRASERVER-73068

      The server receives requests from the same origin, as the form page is the same origin as the form submission, thus, the XSRF HTTP header matches, which is fine.

      However for the XSRF check to succeed, the form token and cookie token sent to the server must match. The problem occurs because modern web browser (beginning Chrome 80+) do not accept the atlassian.xsrf.cookie initially sent by the server in an iframe as it is treated as cross-site and is therefore rejected. This is because the cookie does not have the Same-Site:None attribute set (see JRASERVER-70494).

      Steps to Reproduce

      1. Create a Jira 8.20.3, a sample SCRUM project, and an issue collector (custom type)
      2. Insert the sample code into a html page on the same site (for testing local, JIRA_INSTALL/atlassian-jira/static-assets/test.html is fine)
      3. Load the page (eg http://JUPITER/static-assets/test.html), and submit an issue with the collector. Note that the POST to /rest/collectors/1.0/template/custom succeeds
      4. Insert the sample code into a html page on your local machine (differing origin), and load it in your browser

      Expected Results

      The issue submission succeeds

      Actual Results

      • The POST to /rest/collectors/1.0/template/custom is rejected with HTTP 404 and body "XSRF check failed"
      • Error is presented to the client

        Oops - something went wrong...
        There was a problem submitting your feedback, likely due to the configuration of this form. You might want to contact the site owner to let them know about this issue

      When enabling Jira Admin -> System -> Logging and Profiling -> HTTP Access log (ON) -> HTTP Dump Log (ON), the response from the client can be observed in JIRA_HOME/log/atlassian-jira-http-dump.log. Observe that the client does not sent the XSRF token in the cookie, as the browser rejected storing it

      Workaround

      The following workaround will disable XSRF checks for the issue collector, which was the behaviour prior to JRASERVER-73068. This may be tolerable for you, but it's worthwhile confirming within your organisation

      Modify the reverse proxy / load balancer / WAF to add the following header to the request as it makes it's way to the Jira node:

      • Condition: Method: POST
      • Condition: Request URL: /rest/collectors/1.0/template/custom/*
      • Action: Add header: X-Atlassian-Token: no-check

      Note on fix

      We've added "SameSite=None" parameter to xsrftoken, which is on by default.
      Please note : fix works only if connection is secure, issue collector needs to access Jira through https protocol. If it is not, collector works properly only on firefox.
      Unfortunately we can't omit this restriction, because that's how cookies are handled on chrome, opera etc. and they don't allow setting SameSite=None parameter to cookies if connection is not secure.

      Note that the reverse proxy needs to allow the SameSite cookie (SameSite="none") and the secure="true" attribute needs to be present in the Tomcat connector (server.xml). This is required so that the HTTP response sets the cookie parameters correctly.

        1. image-2022-01-26-21-14-57-092.png
          image-2022-01-26-21-14-57-092.png
          305 kB
        2. image-2022-01-26-21-15-28-033.png
          image-2022-01-26-21-15-28-033.png
          599 kB
        3. image-2022-01-26-21-16-13-655.png
          image-2022-01-26-21-16-13-655.png
          29 kB
        4. image-2022-01-26-21-23-10-335.png
          image-2022-01-26-21-23-10-335.png
          18 kB
        5. image-2022-01-27-13-09-59-772.png
          image-2022-01-27-13-09-59-772.png
          71 kB
        6. notworking.har
          1.98 MB
        7. screenshot-1.png
          screenshot-1.png
          282 kB
        8. screenshot-2.png
          screenshot-2.png
          508 kB

            [JRASERVER-73212] Submitting an issue collector on a non-same origin site results in HTTP 404

            Ge Bai added a comment -

            Still broken in v9.12.6

            Ge Bai added a comment - Still broken in v9.12.6

            Hey 76501d8a32d5

            We don't see a lot of new requests since problem was fixed, so I guess there is new a new different problem in your case.
            Can you please open a support request so our team can work on this problem together with you?

            Thank you.

            Regards,
            Andriy | SET

            Andriy Yakovlev [Atlassian] added a comment - Hey 76501d8a32d5 We don't see a lot of new requests since problem was fixed, so I guess there is new a new different problem in your case. Can you please open a support request so our team can work on this problem together with you? Thank you. Regards, Andriy | SET

            @Andriy Yakovlev [Atlassian]

            @Greg Rowinski

            Hello, do you have any news? Issue still not fixed and not reopen.

            Jiraconfluence added a comment - @Andriy Yakovlev [Atlassian] @Greg Rowinski Hello, do you have any news? Issue still not fixed and not reopen.

            krhodes12 added a comment -

            Applied the workaround to our load balancer and now 8.20.11 is working again. 

             

            krhodes12 added a comment - Applied the workaround to our load balancer and now 8.20.11 is working again.   

            krhodes12 added a comment -

            Issue collector No longer works after upgrading to 8.20.11.  

             

            krhodes12 added a comment - Issue collector No longer works after upgrading to 8.20.11.    

            We just upgraded to 8.22.6 but the issue still persist.

            Arleena Faith added a comment - We just upgraded to 8.22.6 but the issue still persist.

            Hi all, this was eventually resolved for us by making a change on the proxy server, to allow the SameSite cookie.  This in addition to upgrading was the fix.

            Pete Singleton added a comment - Hi all, this was eventually resolved for us by making a change on the proxy server, to allow the SameSite cookie.  This in addition to upgrading was the fix.

            Paul DeSousa added a comment - - edited

            I actually would like to know what the fix is as my current LTR version 8.20.10 has this issue.

            Paul DeSousa added a comment - - edited I actually would like to know what the fix is as my current LTR version 8.20.10 has this issue.

            Ian Applebaum added a comment - - edited

            Is this issue really resolved? Is there an area where I can allow certain trusted domains to submit issues via collectors? Both sites are https and I get the same result. My JiraServer is behind an nginx reverse proxy. I'm on Jira 8.22.4 which is listed as fixed. 

            Update: I guess I didn't wait long enough because it suddenly started working again.

            Ian Applebaum added a comment - - edited Is this issue really resolved? Is there an area where I can allow certain trusted domains to submit issues via collectors? Both sites are https and I get the same result. My JiraServer is behind an nginx reverse proxy. I'm on Jira 8.22.4  which is listed as fixed.   Update: I guess I didn't wait long enough because it suddenly started working again.

            If you still face the symptoms in fix versions, please make sure to

            • use HTTPS
            • if you use Easy SSO, try disabling it (we've seen Easy SSO 4.6.7 causing issue collector trouble at Jira 8.22.4)
            • have not disabled `com.atlassian.jira.use.same.site.none.for.xsrf.token.cookie` dark feature flag (it's enabled by default, but can be disabled by admin - https://confluence.atlassian.com/jirakb/enable-dark-feature-in-jira-959286331.html)
            • check the load balancer or proxy config, so that it does not affect the `atlassian.xsrf.token` cookie. You can test if this is the root cause by bypassing the proxy

            The cookie header received by your browser from Jira should read
            Set-Cookie: atlassian.xsrf.token=<cryptic-string-here>; Path=/; Secure; SameSite=None
            (one can use browser's dev tools to peek at cookie headers)

            Greg Rowinski (Inactive) added a comment - - edited If you still face the symptoms in fix versions, please make sure to use HTTPS if you use Easy SSO, try disabling it (we've seen Easy SSO 4.6.7 causing issue collector trouble at Jira 8.22.4) have not disabled `com.atlassian.jira.use.same.site.none.for.xsrf.token.cookie` dark feature flag (it's enabled by default, but can be disabled by admin - https://confluence.atlassian.com/jirakb/enable-dark-feature-in-jira-959286331.html ) check the load balancer or proxy config, so that it does not affect the `atlassian.xsrf.token` cookie. You can test if this is the root cause by bypassing the proxy The cookie header received by your browser from Jira should read Set-Cookie: atlassian.xsrf.token=<cryptic-string-here>; Path=/; Secure; SameSite=None (one can use browser's dev tools to peek at cookie headers)

              growinski@atlassian.com Greg Rowinski (Inactive)
              allewellyn@atlassian.com Alex [Atlassian,PSE]
              Affected customers:
              78 This affects my team
              Watchers:
              120 Start watching this issue

                Created:
                Updated:
                Resolved: