An information-disclosure flaw was found in Grafana through 6.7.3. The database directory /var/lib/grafana and database file /var/lib/grafana/grafana.db are world readable. This can result in exposure of sensitive information (e.g., cleartext or encrypted datasource passwords).
Notable fixes which removes readable bits:
- change permissions of /var/lib/grafana/grafana.db to 640 and user/group grafana:grafana
- change permissions of /var/lib/grafana to 750
Created grafana tracking bugs for this issue:
Affects: fedora-all [bug 1828735]
Manually change the directory and files permissions to remove readable bits for others:
# chmod 750 /var/lib/grafana
# chmod 640 /var/lib/grafana/grafana.db
# chown grafana:grafana /var/lib/grafana/grafana.db
ServiceMesh grafana also sets its grafana.db permissions to world readable, however it's located at /data/grafana:
bash-4.4$ ls -lah /data/grafana/grafana.db
-rw-r--r--. 1 1000570000 1000570000 992K May 5 04:36 grafana.db
Lowered the Severity Rating for ServiceMesh grafana. It would require an unlikely set of circumstances for this to be exploited (also increasing the attack complexity) due to grafana running within a container in ServiceMesh.
OCP 3.11 installs Grafana 5.4.3 which is vulnerable to this issue, despite being in the 5.x version series.
The versions of grafana shipped with Red Hat Gluster Storage 3, Red Hat Ceph Storage 3 and 4 sets the world readable permissions on grafana database directory and file, hence affected by this vulnerability.
In both OpenShift Container Platform (OCP) and OpenShift ServiceMesh (OSSM), the grafana containers set their database files to world readable. However, as it's run in a container image with SELinux MCS labels this prevents other processes on the host from reading it. Therefore, for both (OCP and OSSM) the impact is low.