Stored Cross Site Scripting (Outdated software library) in BMDWeb 2.0

Title

Stored Cross Site Scripting (Outdated software library)

Product

BMD BMDWeb 2.0

Vulnerable Version

BMD versions prior to 24.01.21

Fixed Version

24.01.21 and 24.02.11 or higher

CVE Number

-

Impact

high

Found

02.11.2020

By

Stefan Viehböck (Office Vienna) | SEC Consult Vulnerability Lab

BMDWeb 2.0 suffers from a stored cross site scripting vulnerability. It is caused by an outdated input sanitization library (DOMPurify).

Vendor description

"BMD develops high-quality business software and is one of the leading software manufacturers in Austria. But also many customers in Germany and Switzerland as well as in the international European region rely on the software solutions developed by BMD."

https://www.bmd.com/en/about-bmd/cdompany-profile.html

Business recommendation

The vendor provides a software update which should be installed immediately.

SEC Consult highly recommends to perform a thorough security review of the BMD Web product conducted by security professionals to identify and resolve potential further security issues.

Vulnerability overview/description

1) Stored Cross Site Scripting (Outdated software library)

BMDWeb 2.0 uses DOMPurify version 1.0.10 (released in Feb 19, 2019) for sanitizing untrusted user input. This outdated version suffers from many vulnerabilities that allow bypasses of the sanitization logic.

A few examples:
- https://github.com/cure53/DOMPurify/issues/482
- https://research.securitum.com/dompurify-bypass-using-mxss/
- https://research.securitum.com/mutation-xss-via-mathml-mutation-dompurify-2-0-17-bypass/
- https://portswigger.net/research/bypassing-dompurify-again-with-mutation-xss

An attacker can execute arbitrary JavaScript code in the context of the victim's BMD session, thus perform all actions in BMD, exfiltrate information, etc.

Note for DOMPurify users:
DOMPurify should be updated regularly. The project provides a mailing list with the latest security information.

Further information: https://github.com/cure53/DOMPurify#security-mailing-list

Additionally, input validation is another measure against Stored Cross Site Scripting.

Proof of concept

1) Stored Cross Site Scripting (Outdated software library)

The following XSS vector can be used in all kinds of BMD user input fields, e.g. time recording comment, service entry comment, etc.

<math><mtext><table><mglyph><style><![CDATA[</style><img title="]]&gt;&lt;/mglyph&gt;&lt;img&Tab;src=1&Tab;onerror=alert(0)&gt;">

This JavaScript code will then automatically get executed when the site which contains the payload is visited by the victim.

Vulnerable / tested versions

The vulnerability has been found in BMD 23.45.32 (Build 1004581) which was the latest version at the time of discovery. 

Vendor contact timeline

2021-02-22 Contacting vendor
2021-02-22 Conference call to discuss vulnerability.
2021-03-02 Vendor publishes patch.
2021-04-22 Coordinated release of security advisory.

Solution

Install BMD 24.01.21 or 24.02.11 or higher versions which are available to all customers with support contract.


Workaround

None


Advisory URL

https://sec-consult.com/vulnerability-lab/

 

EOF Stefan Viehböck / @2021