Habari CMS 0.9.2 Cross Site Scripting
Posted on 19 November 2016
Document Title: =============== Habari CMS v0.9.2 - (Backend Comments) XSS Vulnerability References (Source): ==================== https://www.vulnerability-lab.com/get_content.php?id=1999 Release Date: ============= 2016-11-09 Vulnerability Laboratory ID (VL-ID): ==================================== 1999 Common Vulnerability Scoring System: ==================================== 3.5 Product & Service Introduction: =============================== While there are a number of technical reasons that highlight the differences and advantages Habari has over other blogging packages, a major component of what makes Habari different is its community participation model. (Copy of the Homepage: http://habariproject.org/en ) Abstract Advisory Information: ============================== The vulnerability laboratory core research team discovered a persistent cross site scripting vulnerability in the Habari v0.9.2 content management system. Vulnerability Disclosure Timeline: ================================== 2016-11-09: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Habari Product: Habari - Content Management System 0.9.2 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ A persistent cross site scripting web vulnerability has been discovered in the official Habari CMS v0.9.2. The vulnerability allows remote attackers to inject own malicious script code on the application-side of affected web modules or service function. The persistent cross site scripting web vulnerability is located in the `name` parameter of the `comments` module. Remote attackers without privileged web-application user accounts are able to inject malcious script code to the comments backend. Thus allows remote attackers to execute script code on preview of the comments section for administrators in the application backend. The attack vector of the issue is persistent and the request method to inject the malicious comments is POST. The vulnerability is a classic cross site scripting issue that affects the backend to compromise administrator accounts. The security risk of the issue is estimated as medium with a cvss (common vulnerability scoring system) count of 3.5. Exploitation of the web vulnerability requires no privileged web-application user account and only low user interaction. Successful exploitation of the vulnerability results in persistent phishing attacks, session hijacking, persistent external redirect to malicious sources and persistent manipulation of affected or connected web module context. Request Method(s): [+] POST Vulnerable Module(s): [+] Feedback - Comments Vulnerable Parameter(s): [+] comment_name Affected Module(s): [+] Backend - Comments Proof of Concept (PoC): ======================= The vulnerability can be exploited by remote attackers without user account and with low user interaction. For security demonstration or to reproduce follow the provided information and steps below to continue. Manual steps to reproduce the vulnerability ... 1. Open the application with an article 2. Write a comment and include as name to the comment a script code payload 3. Save to submit via POST method request Note: Now the attacker awaits the admin watches the comments 4. The malicious script code payload executes on visit of the comments module in the backend 5. Successful reproduce of the remote vulnerability! Injection Point: http://habari.localhost:8080/habari/habari#comment-form Execution Point: http://habari.localhost:8080/habari/admin/comment?id PoC: Exploitation (comment_name) <div id="page-bottom"> <div id="wrapper-bottom"> <div id="bottom-primary"> <div id="post-comments"> <div id="comment-1" class="post-comment"> <div class="post-comment-commentor"><h2> <a href="http://test.de/" rel="external"><[PAYLOAD EXECUTION VIA NAME OF THE COMMENTS INPUT!]></a> </h2></div> <div class="post-comment-body"> <p>test message by pentester</p> <p class="post-comment-link"> <a href="#comment-1" title="Time of this comment - Click for comment permalink">2016-11-05 8:05 pm</a></p> </div></div> <div id="post-comments-footer"> <!-- TODO: A hook can be placed here--> </div></div> --- PoC Session Logs [POST] --- Status: 302[Found] POST http://habari.localhost:8080/habari/1/d647f75a71/feedback Mime Type[text/html] Request Header: Host[habari.localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0] Referer[http://habari.localhost:8080/habari/habari] Cookie[comment_f1d6f9c9f31f8745f650f82892e5d607a4c1cf15=+%2520%3E%22%23sdasd%40gmail.com%23http%3A%2F%2Fsadasd.de%2F; g3sid=13e938f0028945d17f32c164f7a9d904f84dfe8e%7E8br7cg0v7kr8mqut1q256vq542; _pk_id.2.bb5e=8b2f85bd26c204d7.1478373106.1.1478376901.1478373106.; _pk_ref.2.bb5e=%5B%22%22%2C%22%22%2C1478373106%2C%22http%3A%2F%2Fwww.localhost:8080%2Fdemo%2F1%2F343%2FGallery%22%5D; _pk_ses.2.bb5e=*; PHPSESSID=pau398b2k2gpsafkbh0pdhjvk7; style=light] Connection[keep-alive] Upgrade-Insecure-Requests[1] POST-Daten: FormUI[d4ce1bda87af8f173f916f9216dfe2fc] comment_name[MALICIOUS+PAYLOAD+INJECT+VIA+NAME] comment_email[test%40test.de] comment_url[http%3A%2F%2Fwww.test.de] comment_content[test+body+msg] ce0d8b4d[Submit] Response Header: Server[nginx/1.2.1] Content-Type[text/html;charset=utf-8] Connection[keep-alive] X-Powered-By[PHP/5.5.27-1+deb.sury.org~precise+1] Cache-Control[no-store, no-cache, must-revalidate, post-check=0, pre-check=0] Location[http://habari.localhost:8080/habari/habari#comment-2] - Status: 200[OK] GET http://habari.localhost:8080/habari/admin/[EXECUTE OF PAYLOAD VIA NAME] Mime Type[text/html] Request Header: Host[habari.localhost:8080] User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0] Referer[http://habari.localhost:8080/habari/admin/comment?id=2] Cookie[comment_f1d6f9c9f31f8745f650f82892e5d607a4c1cf15=+%2520%3E%22%23sdasd%40gmail.com%23http%3A%2F%2Fsadasd.de%2F; g3sid=13e938f0028945d17f32c164f7a9d904f84dfe8e%7E8br7cg0v7kr8mqut1q256vq542; _pk_id.2.bb5e=8b2f85bd26c204d7.1478373106.1.1478377048.1478373106.; _pk_ref.2.bb5e=%5B%22%22%2C%22%22%2C1478373106%2C%22http%3A%2F%2Fhabari.localhost:8080%2Fx%2F1%2F343%2Fx%22%5D; _pk_ses.2.bb5e=*; PHPSESSID=pau398b2k2gpsafkbh0pdhjvk7; style=light] DNT[1] Connection[keep-alive] Response Header: Server[nginx/1.2.1] Content-Type[text/html;charset=utf-8] Transfer-Encoding[chunked] Connection[keep-alive] X-Powered-By[PHP/5.5.27-1+deb.sury.org~precise+1] Reference(s): http://habari.localhost:8080/ http://habari.localhost:8080/habari/ http://habari.localhost:8080/habari/1/ http://habari.localhost:8080/habari/1/d647f75a71/ http://habari.localhost:8080/habari/1/d647f75a71/feedback http://habari.localhost:8080/habari/admin/ http://habari.localhost:8080/habari/admin/comment Solution - Fix & Patch: ======================= The vulnerability can be patched by a secure parse of the name parameter in the comments section of the administrator backend. Restrict the input field and disallow the usage of special chars for comment (name or description). Parse the input field and escape the entries in case of emergency. Security Risk: ============== The security risk of the persistent cross site scripting vulnerability in the habari web-application is estimated as medium. (CVSS 3.5) Credits & Authors: ================== Vulnerability Laboratory [Research Team] - Benjamin Kunz Mejri (http://www.vulnerability-lab.com/show.php?user=Benjamin%20K.M.) Disclaimer & Information: ========================= The information provided in this advisory is provided as it is without any warranty. Vulnerability Lab disclaims all warranties, either expressed or implied, including the warranties of merchantability and capability for a particular purpose. Vulnerability-Lab or its suppliers are not liable in any case of damage, including direct, indirect, incidental, consequential loss of business profits or special damages, even if Vulnerability-Lab or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability mainly for consequential or incidental damages so the foregoing limitation may not apply. We do not approve or encourage anybody to break any licenses, policies, deface websites, hack into databases or trade with stolen data. Domains: www.vulnerability-lab.com - www.vuln-lab.com - www.evolution-sec.com Section: magazine.vulnerability-lab.com - vulnerability-lab.com/contact.php - evolution-sec.com/contact Social: twitter.com/vuln_lab - facebook.com/VulnerabilityLab - youtube.com/user/vulnerability0lab Feeds: vulnerability-lab.com/rss/rss.php - vulnerability-lab.com/rss/rss_upcoming.php - vulnerability-lab.com/rss/rss_news.php Programs: vulnerability-lab.com/submit.php - vulnerability-lab.com/list-of-bug-bounty-programs.php - vulnerability-lab.com/register.php Any modified copy or reproduction, including partially usages, of this file, resources or information requires authorization from Vulnerability Laboratory. Permission to electronically redistribute this alert in its unmodified form is granted. All other rights, including the use of other media, are reserved by Vulnerability-Lab Research Team or its suppliers. All pictures, texts, advisories, source code, videos and other information on this website is trademark of vulnerability-lab team & the specific authors or managers. To record, list, modify, use or edit our material contact (admin@) to get a ask permission. Copyright A(c) 2016 | Vulnerability Laboratory - [Evolution Security GmbH]aC/ -- VULNERABILITY LABORATORY - RESEARCH TEAM SERVICE: www.vulnerability-lab.com