TSPlus 16.0.0.0 - Remote Work Insecure Credential storage

Exploit Author: shinnai Analysis Author: www.bubbleslearn.ir Category: Remote Language: JavaScript Published Date: 2023-08-21
# Exploit Title: TSPlus 16.0.0.0 - Remote Work Insecure Credential storage
# Date: 2023-08-09
# Exploit Author: Carlo Di Dato for Deloitte Risk Advisory Italia
# Vendor Homepage: https://tsplus.net/
# Version: Up to 16.0.0.0
# Tested on: Windows
# CVE : CVE-2023-31069

With TSPlus Remote Work (v. 16.0.0.0) you can create a secure single 
sign-on web portal and remote desktop gateway that enables users to 
remotely access the console session of their office PC.
It is possible to create a custom web portal login page which allows a 
user to login without providing their credentials.
However, the credentials are stored in an insecure manner since they are 
saved in cleartext, within the html login page.
This means that everyone with an access to the web login page, can 
easely retrieve the credentials to access to the application by simply 
looking at the html code page.

This is a code snippet extracted by the source code of the login page 
(var user and var pass):

   // --------------- Access Configuration ---------------
   var user = "Admin";                         // Login to use when 
connecting to the remote server (leave "" to use the login typed in this 
page)
   var pass = "SuperSecretPassword";           // Password to use when 
connecting to the remote server (leave "" to use the password typed in 
this page)
   var domain = "";                            // Domain to use when 
connecting to the remote server (leave "" to use the domain typed in 
this page)
   var server = "127.0.0.1";                   // Server to connect to 
(leave "" to use localhost and/or the server chosen in this page)
   var port = "";                              // Port to connect to 
(leave "" to use localhost and/or the port of the server chosen in this 
page)
   var lang = "as_browser";                    // Language to use
   var serverhtml5 = "127.0.0.1";              // Server to connect to, 
when using HTML5 client
   var porthtml5 = "3389";                     // Port to connect to, 
when using HTML5 client
   var cmdline = "";                           // Optional text that will 
be put in the server's clipboard once connected
   // --------------- End of Access Configuration ---------------


TSPlus 16.0.0.0 Vulnerability: Insecure Credential Storage in Remote Work Portal

Security vulnerabilities in remote access solutions are increasingly becoming a critical concern for organizations adopting hybrid work models. One such vulnerability was recently identified in TSPlus 16.0.0.0, a widely used remote desktop gateway and single sign-on (SSO) web portal. This flaw, disclosed under CVE-2023-31069, exposes user credentials in plain text within the client-side HTML code, making it trivial for attackers to extract sensitive login information.

Understanding the Vulnerability

TSPlus is designed to allow employees to securely access their office desktops from remote locations via a web-based interface. The platform supports custom login pages, which can be configured to pre-fill authentication details for seamless access. However, this feature introduces a significant security flaw: credentials are stored in cleartext within the HTML source code.

Attackers with access to the login page—whether through direct inspection or via browser developer tools—can easily retrieve the hardcoded username and password by examining the source code. This undermines the entire security premise of a secure remote access system.

Code Example: Insecure Credential Storage


// --------------- Access Configuration ---------------
var user = "Admin"; // Login to use when connecting to the remote server (leave "" to use the login typed in this page)
var pass = "SuperSecretPassword"; // Password to use when connecting to the remote server (leave "" to use the password typed in this page)
var domain = ""; // Domain to use when connecting to the remote server (leave "" to use the domain typed in this page)
var server = "127.0.0.1"; // Server to connect to (leave "" to use localhost and/or the server chosen in this page)
var port = ""; // Port to connect to (leave "" to use localhost and/or the port of the server chosen in this page)
var lang = "as_browser"; // Language to use
var serverhtml5 = "127.0.0.1"; // Server to connect to, when using HTML5 client
var porthtml5 = "3389"; // Port to connect to, when using HTML5 client
var cmdline = ""; // Optional text that will be put in the server's clipboard once connected
// --------------- End of Access Configuration ---------------

This code snippet demonstrates how credentials are hardcoded directly into the client-side JavaScript. The var user and var pass variables are assigned literal values—Admin and SuperSecretPassword—which are accessible to anyone viewing the page source. This is a textbook example of insecure credential storage in web applications.

Why This Is a Critical Risk

While the configuration may seem intended for convenience, it creates a severe security exposure:

  • Public Exposure: The login page is often accessible via public URLs or internal web portals. Anyone with access to the page—employees, contractors, or malicious actors—can view the source code and extract credentials.
  • Automated Scraping: Tools like web scrapers or automated scripts can easily extract these values, enabling mass credential harvesting.
  • Man-in-the-Middle Attacks: Even if the connection is encrypted, the pre-filled credentials in the HTML source can be exploited before the user even logs in.
  • Insider Threats: Employees or administrators with access to the configuration page may inadvertently expose credentials to unauthorized users.

Real-World Impact and Use Cases

Consider a scenario where a company uses TSPlus to allow remote access to sensitive financial systems. If the login page is configured with hardcoded credentials, an attacker who gains access to the web portal—via a phishing link or a misconfigured firewall—can extract the Admin account and SuperSecretPassword in seconds.

Once obtained, the attacker can:

  • Log in directly without needing to guess or brute-force passwords.
  • Access sensitive data, modify configurations, or escalate privileges.
  • Use the credentials to pivot into other systems, especially if the same credentials are reused across platforms.

Such a breach could lead to data exfiltration, ransomware deployment, or complete system compromise—especially in environments where the Admin account has full access to the remote desktop session.

Security Best Practices and Remediation

Hardcoded credentials in client-side code are a fundamental anti-pattern in secure software development. The following measures should be implemented to mitigate this risk:

1. Avoid Hardcoding Credentials

Instead of storing credentials in JavaScript variables, use server-side configuration with encrypted storage. Authentication should be handled through secure APIs or session-based mechanisms.

2. Use Environment Variables or Secure Configuration Files

Store credentials in encrypted configuration files or environment variables accessible only to the backend. The client-side should never receive raw credentials.

3. Implement Role-Based Access Control (RBAC)

Ensure that only authorized users can access or modify login configurations. Use strong authentication and audit logging for administrative changes.

4. Enable Dynamic Authentication

Replace hardcoded credentials with dynamic login prompts. Users should enter their own credentials during the session, not rely on pre-filled values.

5. Regular Security Audits and Penetration Testing

Organizations using TSPlus or similar remote access tools should conduct regular code reviews and penetration tests to detect such vulnerabilities early.

Vendor Response and Patching

As of August 2023, the vendor TSPlus has acknowledged the vulnerability and is working on a patch for versions beyond 16.0.0.0. Users are advised to:

  • Upgrade to the latest stable version.
  • Disable the feature that pre-fills credentials in the login page.
  • Review and audit all custom login configurations.
  • Implement additional access controls, such as IP whitelisting and multi-factor authentication (MFA).

Conclusion: Lessons from CVE-2023-31069

The CVE-2023-31069 vulnerability in TSPlus 16.0.0.0 serves as a stark reminder that convenience should never override security. Hardcoded credentials in web applications are a common yet dangerous flaw that can lead to catastrophic breaches. Organizations must prioritize secure configuration practices, enforce least-privilege access, and continuously validate the security posture of their remote access infrastructure.

As remote work becomes the norm, securing access points is not optional—it’s essential. Developers and administrators must treat every piece of code as a potential attack surface, and never assume that "just for convenience" is a valid security justification.