<html><body><p>ICT Protege GX/WX 2.08 Authenticated Stored XSS Vulnerability

Vendor: Integrated Control Technology Ltd.
Product web page:
Affected version: GX: Ver: 2.08.1002 K1B3
                      Lib: 04.00.217
                      Int: 2.3.235.J013
                      OS: 2.0.20
                  WX: Ver: 4.00 284 H062
                      App: 02.08.766
                      Lib: 04.00.169
                      Int: 02.2.208

Summary: Protege GX is an enterprise level integrated access control, intrusion
detection and building automation solution with a feature set that is easy to
operate, simple to integrate and effortless to extend. Protege WX is an all-in-one,
web-based, cross-platform system that gives you a fully functional access control
and intrusion detection solution in a fraction of the time of conventional software.
With no software to install, setup is quick and simple. Connect the Controller and
system components, then open a web browser to launch the intuitive wizard-driven
interface which guides you through the process of configuring your system.

Desc: The application suffers from an authenticated stored XSS vulnerability.
The issue is triggered when input passed to the 'Name' parameter is not properly
sanitized before being returned to the user. This can be exploited to execute
arbitrary HTML and script code in a user's browser session in context of an
affected site.

Tested on: Microsoft-WinCE/6.00

Vulnerability discovered by Gjoko 'LiquidWorm' Krstic

Advisory ID: ZSL-2022-5699
Advisory URL:



UI navigation:

Scheduling &gt; Daylight Savings &gt; (Name field).

Decrypted POST request:

POST /daylightsaving.htm


Encrypted GET request:


Additional info:

Databse backup predictable name: Db_D3037E8A_8_Feb_22.bak
The D3037E8A is the serial number of the onboard reader.

Encrypt/Decrypt functions:

From console:
&gt; localStorage.getItem("WXKey")
&lt; '8EDB22D9FB767538'

function encryptAES(a, c) {
    a = a.toString();
    a = unescape(encodeURIComponent(a));
    "undefined" == typeof c &amp;&amp; (c = !0);
    if (0 == servertype)
        return a;
    var b = localStorage.getItem("WXKey");
    if ("" == b || null == b)
        return a;
    for (var d = "", e = 0; 16 &gt; e; e++)
        d += String.fromCharCode(Math.floor(75 * Math.random() + 48));
    a = d + mcrypt.Encrypt(addPKCS7(a), d, b, "rijndael-128", "cbc");
    return a = c ? getCookie("SESSID") + strToHex(a) : strToHex(a)

function decryptAES(a) {
    if (null == a)
        return "";
    a = a.toString();
    if ("<invalid session=""> &lt; Packet not Init and not encrypted. &gt;" == a)
        a = 0 == servertype ? "login.php" : "login.htm",
        window.location = a + "?" + Math.random().toString(16).substring(2, 8).toLowerCase();
    else if ("<invalid session="">" == a.substr(0, 17))
        a = 0 == servertype ? "login.php?logout" : "login.htm?logout",
        window.location = a + "?" + Math.random().toString(16).substring(2, 8).toLowerCase();
    else {
        if (0 == servertype)
            return a;
        var c = localStorage.getItem("WXKey");
        if ("" == c)
            return a;
        a = hexToStr(a);
        var b = a.substr(0, 16);
        a = a.substr(16, a.length);
        a = mcrypt.Decrypt(a, b, c, "rijndael-128", "cbc").replace(/\x00+$/g, "");
        a = removePKCS7(a);
        return a = decodeURIComponent(escape(a))