VYPR
Moderate severityNVD Advisory· Published Oct 13, 2022· Updated Apr 23, 2025

Grafana users with email as a username can block other users from signing in

CVE-2022-39229

Description

Grafana is an open source data visualization platform for metrics, logs, and traces. Versions prior to 9.1.8 and 8.5.14 allow one user to block another user's login attempt by registering someone else'e email address as a username. A Grafana user’s username and email address are unique fields, that means no other user can have the same username or email address as another user. A user can have an email address as a username. However, the login system allows users to log in with either username or email address. Since Grafana allows a user to log in with either their username or email address, this creates an usual behavior where user_1 can register with one email address and user_2 can register their username as user_1’s email address. This prevents user_1 logging into the application since user_1's password won’t match with user_2's email address. Versions 9.1.8 and 8.5.14 contain a patch. There are no workarounds for this issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/grafana/grafanaGo
< 8.5.148.5.14
github.com/grafana/grafanaGo
>= 9.0.0, < 9.1.89.1.8

Affected products

1

Patches

1
5644758f0c5a

Add test for username/login field conflict

https://github.com/grafana/grafanalinomanSep 16, 2022via ghsa
1 file changed · +39 0
  • pkg/services/sqlstore/user_test.go+39 0 modified
    @@ -47,6 +47,45 @@ func TestUserDataAccess(t *testing.T) {
     		require.False(t, query.Result.IsDisabled)
     	})
     
    +	t.Run("Get User by login - user_2 uses user_1.email as login", func(t *testing.T) {
    +		ss = InitTestDB(t)
    +
    +		// create user_1
    +		cmd := models.CreateUserCommand{
    +			Email:      "user_1@mail.com",
    +			Name:       "user_1",
    +			Login:      "user_1",
    +			Password:   "user_1_password",
    +			IsDisabled: true,
    +		}
    +		user_1, err := ss.CreateUser(context.Background(), cmd)
    +		require.Nil(t, err)
    +
    +		// create user_2
    +		cmd = models.CreateUserCommand{
    +			Email:      "user_2@mail.com",
    +			Name:       "user_2",
    +			Login:      "user_1@mail.com",
    +			Password:   "user_2_password",
    +			IsDisabled: true,
    +		}
    +		user_2, err := ss.CreateUser(context.Background(), cmd)
    +		require.Nil(t, err)
    +
    +		// query user database for user_1 email
    +		query := models.GetUserByLoginQuery{LoginOrEmail: "user_1@mail.com"}
    +		err = ss.GetUserByLogin(context.Background(), &query)
    +		require.Nil(t, err)
    +
    +		// expect user_1 as result
    +		require.Equal(t, user_1.Email, query.Result.Email)
    +		require.Equal(t, user_1.Login, query.Result.Login)
    +		require.Equal(t, user_1.Name, query.Result.Name)
    +		require.NotEqual(t, user_2.Email, query.Result.Email)
    +		require.NotEqual(t, user_2.Login, query.Result.Login)
    +		require.NotEqual(t, user_2.Name, query.Result.Name)
    +	})
    +
     	t.Run("Testing DB - creates and loads disabled user", func(t *testing.T) {
     		ss = InitTestDB(t)
     		cmd := models.CreateUserCommand{
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.