Incorrect Permission Assignment for Critical Resource Affecting github.com/grafana/grafana/pkg/services/sqlstore/migrator package, versions <7.2.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (29th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMGRAFANAGRAFANAPKGSERVICESSQLSTOREMIGRATOR-6226593
  • published2 Feb 2024
  • disclosed24 May 2022
  • creditUnknown

Introduced: 24 May 2022

CVE-2020-12458  (opens in a new tab)
CWE-732  (opens in a new tab)

How to fix?

Upgrade github.com/grafana/grafana/pkg/services/sqlstore/migrator to version 7.2.1 or higher.

Overview

Affected versions of this package are vulnerable to Incorrect Permission Assignment for Critical Resource due to world-readable permissions set on the database directory /var/lib/grafana and database file /var/lib/grafana/grafana.db. An attacker can gain access to sensitive information, such as cleartext or encrypted datasource passwords, by accessing these files without proper authorization.

##Workaround 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

CVSS Scores

version 3.1