ID: 14383
Title: Fix code injection in watolib
Component: Setup
Level: 1
Class: Security fix
Version: 2.2.0i1
This Werk fixes a code injection vulnerability in watolib.
Prior to this Werk it was possible for authenticated users to inject PHP code in files
generated by Wato for NagVis integration.
The code would be executed once a request to the respective NagVis component is made.
The underlying reason for this issue was that user data entered in Wato was not properly
sanitized when writing to the PHP file.
We thank Stefan Schiller (SonarSource) for reporting this issue.
<b>Affected Versions</b>:
All currently supported versions are affected: 1.6, 2.0, and 2.1.
<b>Mitigations</b>:
As an immediate mitigation you can entirely disable PHP on your server.
Note that NagVis will not work anymore without PHP.
<b>Indicators of Compromise</b>:
Malicious code is injected in either of the files
<tt>var/check_mk/wato/auth/auth.php</tt> or
<tt>var/check_mk/wato/php-api/hosttags.php</tt>.
Check these files for suspicious code.
<b>Vulnerability Management</b>:
We have rated the issue with a CVSS Score of 9.1 (Critical) with the following CVSS
vector: <tt>CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L</tt>.
A CVE has been requested.
<b>Changes</b>:
This Werk fixes the vulnerability by improving sanitization.