Facebook Google Plus Twitter LinkedIn YouTube RSS Menu Search Resource - BlogResource - WebinarResource - ReportResource - Eventicons_066 icons_067icons_068icons_069icons_070

LabKey Server Community Edition Multiple Vulnerabilities

Medium

Synopsis

CVE-2019-3911: Reflected XSS

Numerous XSS flaws exists in LabKey Server Community Edition prior to 18.3.0. For all query-* functions in the query viewers with the exception of query-selectAllRows, the “query.sort” parameter in particular does not appear to be validated or sanitized in any way. Since this parameter is reflected in the output to the user and interpreted by the browser, a cross site scripting attack becomes possible. This allows an attacker to run arbitrary code within the context of the user’s browser.

These attacks are possible both authenticated on any project as well as unauthenticated via extra “__r#” paths that appear to have limited functionality, but are available in a default installation.

Below are examples of attacks that are triggered without authentication and then with authentication. The attack consists of including an image tag in the query.sort parameter with an invalid source. When the browser attempts to load this image, it will trigger an error, which cause the “alert(1)” javascript to run.

http://[host]/labkey/__r2/query-printRows.view?schemaName=ListManager&query.queryName=ListManager&query.sort=Nameelk5q%3Cimg%20src%3da%20onerror%3dalert(1)%3Ezp59r&query.containerFilterName=CurrentAndSubfolders&query.selectionKey=%24ListManager%24ListManager%24%24query&query.showRows=ALL
http://[host]/labkey/test_project/query-printRows.view?schemaName=ListManager&query.queryName=ListManager&query.sort=Name%3Cimg%20src%3da%20onerror%3dalert(1)%3E

This also affects parameters in other modules, such as Announcements, which are easily triggered unauthenticated as well via the Announcement.sort parameter or any other parameters that are reflected in responses.

CVE-2019-3912: Open Redirects

Open redirects via returnUrl exist throughout LabKey Server. The __r paths appear to be the easiest to manipulate. An attacker may utilize these to redirect users to a location controlled by the attacker themselves.

GET /labkey/__r1/login-login.view?returnUrl=http://evil.tld HTTP/1.1
Host: [host]
Accept-Encoding: gzip, deflateAccept: */*Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Referer: http://[host]/labkey/login-login.view?returnUrl=%2Flabkey%2F__r1%2Fadmin-createFolder.view%3F
Cookie: X-LABKEY-CSRF=00ccaab3e5fccc4fd306acb09fedc936;
JSESSIONID=30E2500105179B0415819804D11A36E7

CVE-2019-3913: Logic Flaw in Network Drive Mapping Functionality

When attempting to map a network drive, a user is able to manipulate the arguments of the “net use” command due to improper sanitation of the supplied values, and simply abuse logic of the mapping utility itself. Note that admin access to the web interface is required for this vulnerability. The vulnerable code exists within labkey/server/api/src/org/labkey/api/util/NetworkDrive.java.

The vulnerable function can be found below:

public String mount(char driveChar) throws InterruptedException, IOException
{
	unmount(driveChar);
	StringBuilder sb = new StringBuilder();
	sb.append("net use ");
	sb.append(driveChar);
	sb.append(": ");
	sb.append(getPath());
	sb.append(" ");
	if (getPassword() != null && !"".equals(getPassword().trim()))
	{
		sb.append(getPassword());
	}
	
	if (getUser() != null && !"".equals(getUser().trim()))
	{
		sb.append(" /USER:");
		sb.append(getUser());
	}
	String connCommand = sb.toString();
	Process p = Runtime.getRuntime().exec(connCommand);

As an example proof of concept, notice how the mount command always attempts to run “unmount()” at the start of any “mount()” operation. This means that a user is able to supply any valid drive letter and the application (running with elevated privileges on the host) will end the connection regardless of whether or not the rest of the mapping command is correct.

Solution

Upgrade to LabKey Server Community Edition 18.3.0-61806.763 or later.

Disclosure Timeline

10/23/2019 - Tenable discovers vulnerabilities. 8
10/26/2018 - Tenable requests security contact details from LabKey via [email protected]
10/28/2018 - LabKey responds to request for security contact.
10/29/2018 - Tenable discloses vulnerabilities to LabKey. Disclosure date set to Jan 24, 2019.
10/29/2018 - LabKey assigns tracking IDs: 35895, 35896, 35898.
11/19/2018 - Tenable requests status update from vendor.
12/03/2018 - LabKey responds with patching status.
12/04/2018 - Tenable asks for an update when patches are available.
12/13/2018 - LabKey acknowledges the request.
01/15/2019 - Tenable checks in with LabKey.
01/15/2019 - LabKey indicates all three issues will be patched in LabKey 18.3.0-61806.763 and shall be available in the next few days.
01/23/2019 - Tenable asks LabKey if 18.3.0 was released.
01/23/2019 - LabKey confirms the release occurred on Jan. 16th and all issues have been addressed.

All information within TRA advisories is provided “as is”, without warranty of any kind, including the implied warranties of merchantability and fitness for a particular purpose, and with no guarantee of completeness, accuracy, or timeliness. Individuals and organizations are responsible for assessing the impact of any actual or potential security vulnerability.

Tenable takes product security very seriously. If you believe you have found a vulnerability in one of our products, we ask that you please work with us to quickly resolve it in order to protect customers. Tenable believes in responding quickly to such reports, maintaining communication with researchers, and providing a solution in short order.

For more details on submitting vulnerability information, please see our Vulnerability Reporting Guidelines page.

If you have questions or corrections about this advisory, please email [email protected]

Try for Free Buy Now

Try Tenable.io

FREE FOR 60 DAYS

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Sign up now and run your first scan within 60 seconds.

Buy Tenable.io

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

65 assets

$2,190.00

Buy Now

Try for Free Buy Now

Try Nessus Professional Free

FREE FOR 7 DAYS

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy Nessus Professional

Nessus® is the most comprehensive vulnerability scanner on the market today. Nessus Professional will help automate the vulnerability scanning process, save time in your compliance cycles and allow you to engage your IT team.

Buy a multi-year license and save

Try for Free Buy Now

Try Tenable.io Web Application Scanning

FREE FOR 60 DAYS

Enjoy full access to our latest web application scanning offering designed for modern applications as part of the Tenable.io platform. Safely scan your entire online portfolio for vulnerabilities with a high degree of accuracy without heavy manual effort or disruption to critical web applications. Sign up now and run your first scan within 60 seconds.

Buy Tenable.io Web Application Scanning

Enjoy full access to a modern, cloud-based vulnerability management platform that enables you to see and track all of your assets with unmatched accuracy. Purchase your annual subscription today.

5 FQDNs

$3,578.00

Buy Now

Try for Free Contact Sales

Try Tenable.io Container Security

FREE FOR 60 DAYS

Enjoy full access to the only container security offering integrated into a vulnerability management platform. Monitor container images for vulnerabilities, malware and policy violations. Integrate with continuous integration and continuous deployment (CI/CD) systems to support DevOps practices, strengthen security and support enterprise policy compliance.

Buy Tenable.io Container Security

Tenable.io Container Security seamlessly and securely enables DevOps processes by providing visibility into the security of container images – including vulnerabilities, malware and policy violations – through integration with the build process.

Learn More about Industrial Security

Get a Demo of Tenable.sc

Please fill out the form below with your contact information and a sales representative will contact you shortly to schedule a demo. You may also include a short comment (limited to 255 characters). Please note that fields with asterisks (*) are mandatory.